/*
 * ==========================================================================
 * MINES - New Design (Based on reference)
 * ==========================================================================
 */

/* ==============================
 * MAIN CONTAINER
 * ============================== */

.mines-game {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.mines-game__main {
    flex: 1;
    max-width: 750px;
}

.mines-game__sidebar {
    width: 320px;
    flex-shrink: 0;
}

/* ==============================
 * MULTIPLIER BAR (TOP)
 * ============================== */

.mines-multiplier {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
    padding: 0 10px;
}

.mines-multiplier__arrow {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-button, #364458);
    border-radius: var(--radius-md, 8px);
    color: var(--text-secondary, #8b9db6);
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}

.mines-multiplier__arrow:hover {
    background: var(--bg-button-hover, #2e3c50);
    color: var(--text-primary, #fff);
}

.mines-multiplier__arrow svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.mines-multiplier__wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.mines-multiplier__list {
    display: flex;
    gap: 5px;
    transition: transform 0.2s ease;
}

.mines-multiplier__item {
    flex: 0 0 calc(25% - 4px);
    min-width: calc(25% - 4px);
    padding: 8px 12px;
    background: var(--bg-card, #212b3a);
    border-radius: var(--radius-md, 8px);
    text-align: center;
    transition: all 0.15s ease;
}

.mines-multiplier__item--active {
    background: var(--accent-blue, #246bfd);
}

.mines-multiplier__item--active .mines-multiplier__label,
.mines-multiplier__item--active .mines-multiplier__value {
    color: var(--text-primary, #fff);
}

.mines-multiplier__item--win {
    background: #00d169;
}

.mines-multiplier__item--win .mines-multiplier__label,
.mines-multiplier__item--win .mines-multiplier__value {
    color: var(--text-primary, #fff);
}

.mines-multiplier__item--lose {
    background: #e52b48;
}

.mines-multiplier__item--lose .mines-multiplier__label,
.mines-multiplier__item--lose .mines-multiplier__value {
    color: var(--text-primary, #fff);
}

.mines-multiplier__label {
    font-size: 10px;
    color: var(--text-muted, #4c5562);
    margin-bottom: 2px;
}

.mines-multiplier__value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #fff);
}

/* ==============================
 * GAME FIELD
 * ============================== */

.mines-field {
    background: #151d28;
    border-radius: var(--radius-lg, 12px);
    padding: 15px;
    margin-bottom: 15px;
}

.mines-field__grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    max-width: 480px;
    margin: 0 auto;
}

.mines-field__cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #151d28;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted, #4c5562);
    cursor: pointer;
    transition: all 0.15s ease;
    border: 3px solid #232b39;
    position: relative;
    overflow: hidden;
}

.mines-field__cell:hover:not(.mines-field__cell--revealed):not(.mines-field__cell--disabled) {
    transform: translateY(-2px);
}

.mines-field__cell:active:not(.mines-field__cell--revealed):not(.mines-field__cell--disabled) {
    transform: scale(0.95);
}

.mines-field__cell--disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Revealed states */
.mines-field__cell--win {
    background: #151d28;
    color: #00d169;
    border-color: #00d169;
    animation: cell-win 0.3s ease;
}

.mines-field__cell--win::before {
    content: '';
    position: absolute;
    width: 60%;
    height: 60%;
    background: url('/images/games/mines/diamond.svg') no-repeat center center;
    background-size: contain;
}

.mines-field__cell--lose {
    background: #151d28;
    color: #e52b48;
    border-color: #e52b48;
    animation: cell-lose 0.3s ease;
}

.mines-field__cell--lose::before {
    content: '';
    position: absolute;
    width: 60%;
    height: 60%;
    background: url('/images/games/mines/bomb.svg') no-repeat center center;
    background-size: contain;
}

@keyframes cell-win {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes cell-lose {
    0% { transform: scale(0.8) rotate(-10deg); opacity: 0; }
    50% { transform: scale(1.1) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ==============================
 * ACTION BAR (Below field)
 * ============================== */

.mines-action {
    padding: 12px 15px;
    background: var(--bg-card, #212b3a);
    border-radius: var(--radius-lg, 12px);
    margin-bottom: 15px;
    transition: background 0.3s ease;
}

.mines-action--win {
    background: #00d169;
}

.mines-action__default {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
}

.mines-action__win {
    display: flex;
    align-items: center;
    min-height: 40px;
}

.mines-action__win-label,
.mines-action__win-amount {
    flex: 1;
}

.mines-action__win-label {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    text-align: left;
}

.mines-action__win-coeff {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-align: center;
}

.mines-action__win-amount {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-align: right;
}

.mines-action__text {
    font-size: 14px;
    color: var(--text-secondary, #8b9db6);
}

.mines-action__or {
    font-size: 12px;
    color: var(--text-muted, #4c5562);
    margin: 0 15px;
}

.mines-action__btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-button, #364458);
    border-radius: var(--radius-md, 8px);
    color: var(--text-primary, #fff);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}

.mines-action__btn:hover {
    background: var(--accent-blue, #3d7cfd);
}

.mines-action__btn svg {
    width: 16px;
    height: 16px;
}

/* ==============================
 * BETTING PANEL
 * ============================== */

.mines-bet {
    display: flex;
    align-items: stretch;
    gap: 10px;
    background: var(--bg-card, #212b3a);
    border-radius: var(--radius-lg, 12px);
    padding: 15px;
}

.mines-bet__group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mines-bet__label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.mines-bet__label-text {
    font-size: 12px;
    color: var(--text-secondary, #8b9db6);
}

.mines-bet__label-hint {
    font-size: 11px;
    color: var(--text-muted, #4c5562);
}

.mines-bet__input-wrap {
    display: flex;
    align-items: center;
    background: var(--bg-input, #19202c);
    border-radius: var(--radius-md, 8px);
    padding: 0 12px;
    height: 44px;
}

.mines-bet__input-wrap svg {
    width: 16px;
    height: 16px;
    fill: var(--text-muted, #4c5562);
    margin-right: 8px;
}

.mines-bet__input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary, #fff);
    font-size: 16px;
    font-weight: 600;
    outline: none;
    width: 100%;
}

.mines-bet__input::placeholder {
    color: var(--text-muted, #4c5562);
}

.mines-bet__controls {
    display: flex;
    gap: 5px;
    margin-left: 8px;
}

.mines-bet__ctrl {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-button, #364458);
    border-radius: var(--radius-sm, 6px);
    color: var(--text-secondary, #8b9db6);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}

.mines-bet__ctrl:hover {
    background: var(--bg-button-hover, #2e3c50);
    color: var(--text-primary, #fff);
}

/* Auto toggle */
.mines-bet__toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mines-bet__toggle-label {
    font-size: 12px;
    color: var(--text-secondary, #8b9db6);
}

.mines-bet__toggle-switch {
    width: 44px;
    height: 24px;
    background: var(--bg-button, #364458);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mines-bet__toggle-switch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--text-secondary, #8b9db6);
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.2s ease;
}

.mines-bet__toggle-switch.active {
    background: var(--accent-blue, #3d7cfd);
}

.mines-bet__toggle-switch.active::after {
    left: 23px;
    background: #fff;
}

/* Play button */
.mines-bet__play {
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mines-bet__play-btn {
    width: 100%;
    height: 100%;
    min-height: 70px;
    background: #246bfd;
    border: none;
    border-radius: var(--radius-lg, 12px);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mines-bet__play-btn:hover {
    box-shadow: var(--shadow-button-blue, 0 0 25px 0 rgba(36, 108, 253, 0.3));
    transform: translateY(-2px);
}

.mines-bet__play-btn:active {
    transform: scale(0.98);
}

.mines-bet__play-btn--take {
    background: var(--accent-green, #00d169);
}

.mines-bet__play-btn--take:hover {
    box-shadow: 0 0 25px 0 rgba(0, 209, 105, 0.3);
}


/* ==============================
 * SIDEBAR - BETS HISTORY
 * ============================== */

.mines-history {
    background: var(--bg-card, #212b3a);
    border-radius: var(--radius-lg, 12px);
    overflow: hidden;
}

.mines-history__tabs {
    display: flex;
    padding: 5px;
    gap: 5px;
    background: var(--bg-darkest, #1b2330);
}

.mines-history__tab {
    flex: 1;
    padding: 10px 15px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md, 8px);
    color: var(--text-secondary, #8b9db6);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.mines-history__tab:hover {
    color: var(--text-primary, #fff);
}

.mines-history__tab--active {
    background: var(--accent-blue, #3d7cfd);
    color: #fff;
}

.mines-history__list {
    max-height: 450px;
    overflow-y: auto;
    padding: 10px;
}

.mines-history__item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: var(--radius-md, 8px);
    margin-bottom: 5px;
    transition: all 0.15s ease;
}

.mines-history__item:hover {
    background: var(--bg-element, #2b3548);
}

.mines-history__avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md, 8px);
    margin-right: 10px;
    object-fit: cover;
}

.mines-history__info {
    flex: 1;
    min-width: 0;
}

.mines-history__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mines-history__bet {
    font-size: 12px;
    color: var(--text-muted, #4c5562);
}

.mines-history__result {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

.mines-history__coeff {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-sm, 6px);
    background: rgba(229, 43, 72, 0.15);
    color: var(--accent-red, #e52b48);
}

.mines-history__coeff--win {
    background: rgba(0, 209, 105, 0.15);
    color: var(--accent-green, #00d169);
}

.mines-history__payout {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-green, #00d169);
}

/* ==============================
 * RESPONSIVE - TABLET
 * ============================== */

@media (max-width: 1100px) {
    .mines-game {
        flex-direction: column;
    }

    .mines-game__main {
        max-width: 100%;
    }

    .mines-game__sidebar {
        width: 100%;
    }

    .mines-history__tabs {
        overflow-x: auto;
    }
}

/* ==============================
 * RESPONSIVE - MOBILE
 * ============================== */

@media (max-width: 768px) {
    .mines-game {
        padding: 15px;
    }

    .mines-multiplier {
        overflow-x: auto;
        padding-bottom: 5px;
        margin: 0 -15px 15px;
        padding: 0 15px 5px;
    }

    .mines-multiplier__list {
        overflow: visible;
    }

    .mines-multiplier__item {
        min-width: 60px;
        padding: 6px 10px;
    }

    .mines-multiplier__value {
        font-size: 12px;
    }

    .mines-field {
        padding: 10px;
    }

    .mines-field__grid {
        gap: 6px;
    }

    .mines-field__cell {
        font-size: 14px;
        border-radius: 16px;
    }

    .mines-bet {
        flex-wrap: wrap;
        padding: 12px;
    }

    .mines-bet__group {
        min-width: calc(50% - 5px);
    }

    .mines-bet__play {
        width: 100%;
        margin-top: 10px;
    }

    .mines-bet__play-btn {
        min-height: 50px;
    }

    .mines-action {
        flex-wrap: wrap;
        gap: 10px;
    }

    .mines-action__text {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .mines-bet__group {
        min-width: 100%;
    }

    .mines-bet__toggle {
        margin-top: 10px;
    }

    .mines-history__tab {
        padding: 8px 10px;
        font-size: 12px;
    }
}

/* ==============================
 * SCROLLBAR
 * ============================== */

.mines-history__list::-webkit-scrollbar {
    width: 5px;
}

.mines-history__list::-webkit-scrollbar-track {
    background: var(--bg-code, #1f2836);
    border-radius: 5px;
}

.mines-history__list::-webkit-scrollbar-thumb {
    background: var(--border-input, #334054);
    border-radius: 5px;
}

/* ==============================
 * MINES PAGE - HIDE CHAT & COMPACT VIEW
 * ============================== */

/* Скрываем чат на странице мин (десктоп) */
body.mines-page .chat {
    display: none !important;
}

/* Расширяем шапку когда чат скрыт */
body.mines-page .header {
    width: calc(100% - 210px);
    padding-right: 50px;
}

/* Компактный интерфейс на десктопе */
@media (min-width: 1101px) {
    body.mines-page .mines-game {
        max-width: 900px;
        justify-content: center;
    }

    body.mines-page .mines-game__main {
        max-width: 580px;
    }

    body.mines-page .mines-game__sidebar {
        width: 280px;
    }

    body.mines-page .mines-field {
        padding: 12px;
    }

    body.mines-page .mines-field__grid {
        gap: 6px;
    }

    body.mines-page .mines-field__cell {
        font-size: 14px;
        border-radius: 16px;
    }

    body.mines-page .mines-multiplier__item {
        flex: 0 0 calc(25% - 4px);
        min-width: calc(25% - 4px);
        padding: 6px 8px;
    }

    body.mines-page .mines-multiplier__label {
        font-size: 9px;
    }

    body.mines-page .mines-multiplier__value {
        font-size: 12px;
    }

    body.mines-page .mines-bet {
        padding: 12px;
        gap: 8px;
    }

    body.mines-page .mines-bet__input-wrap {
        height: 40px;
        padding: 0 10px;
    }

    body.mines-page .mines-bet__input {
        font-size: 14px;
    }

    body.mines-page .mines-bet__play-btn {
        min-height: 60px;
        font-size: 14px;
    }

    body.mines-page .mines-action {
        padding: 10px 12px;
    }

    body.mines-page .mines-action__text {
        font-size: 13px;
    }

    body.mines-page .mines-action__btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    body.mines-page .mines-history__tab {
        padding: 8px 12px;
        font-size: 12px;
    }

    body.mines-page .mines-history__list {
        max-height: 380px;
    }

    body.mines-page .mines-history__item {
        padding: 8px;
    }

    body.mines-page .mines-history__avatar {
        width: 32px;
        height: 32px;
    }

    body.mines-page .mines-history__name {
        font-size: 12px;
    }

    body.mines-page .mines-history__bet {
        font-size: 11px;
    }
}
