/* Dice roller (PHP / vanilla) — визуал в духе oxqq game-widget */
.game-page--dice-php button.oxqq-dice-nav-reset {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
}

.game-page--dice-php .oxqq-dice-app {
    width: 100%;
    max-width: 100%;
    min-height: min(32rem, calc(100vh - 12rem));
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem 1.25rem;
    margin-top: 0.5rem;
}

body.game-page--dice-php.dark-theme .oxqq-dice-app {
    background: #15202b;
    border-color: #334155;
}

.oxqq-dice-app__layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 52rem) {
    .oxqq-dice-app__layout {
        grid-template-columns: minmax(14rem, 18rem) 1fr;
        align-items: start;
    }
}

.oxqq-dice-app__panel-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
    color: #334155;
}

body.game-page--dice-php.dark-theme .oxqq-dice-app__panel-title {
    color: #cbd5e1;
}

.oxqq-dice-app__rows {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.oxqq-dice-app__row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.oxqq-dice-app__row label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 5rem;
    font-size: 0.9375rem;
    color: #475569;
}

body.game-page--dice-php.dark-theme .oxqq-dice-app__row label {
    color: #94a3b8;
}

.oxqq-dice-app__row .oxqq-dice-num {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.oxqq-dice-app__row input[type="number"] {
    width: 3rem;
    text-align: center;
    padding: 0.35rem 0.25rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.25rem;
    background: #fff;
    color: #0f172a;
    font-size: 0.9375rem;
}

body.game-page--dice-php.dark-theme .oxqq-dice-app__row input[type="number"] {
    background: #1e293b;
    border-color: #475569;
    color: #f1f5f9;
}

.oxqq-dice-app__btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.25rem;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

body.game-page--dice-php.dark-theme .oxqq-dice-app__btn-icon {
    background: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

.oxqq-dice-app__btn-icon:hover:not(:disabled) {
    background: #e2e8f0;
}

body.game-page--dice-php.dark-theme .oxqq-dice-app__btn-icon:hover:not(:disabled) {
    background: #334155;
}

.oxqq-dice-app__btn-icon:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.oxqq-dice-app__arena {
    border: 1px dashed #cbd5e1;
    border-radius: 0.5rem;
    min-height: 12rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

body.game-page--dice-php.dark-theme .oxqq-dice-app__arena {
    border-color: #475569;
}

.oxqq-dice-app__hint {
    text-align: center;
    color: #64748b;
    font-size: 1rem;
    max-width: 18rem;
    line-height: 1.45;
}

body.game-page--dice-php.dark-theme .oxqq-dice-app__hint {
    color: #94a3b8;
}

.oxqq-dice-app__results {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: flex-start;
}

.oxqq-dice-app__group {
    text-align: center;
}

.oxqq-dice-app__group-head {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.35rem;
}

body.game-page--dice-php.dark-theme .oxqq-dice-app__group-head {
    color: #94a3b8;
}

.oxqq-dice-app__faces {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
}

.oxqq-dice-face {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.5rem;
    background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
    border: 1px solid #cbd5e1;
    border-radius: 0.35rem;
    font-weight: 700;
    font-size: 1.125rem;
    color: #0f172a;
    animation: oxqqDicePop 0.35s ease-out;
}

body.game-page--dice-php.dark-theme .oxqq-dice-face {
    background: linear-gradient(145deg, #334155, #1e293b);
    border-color: #64748b;
    color: #f8fafc;
}

@keyframes oxqqDicePop {
    0% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    70% {
        transform: scale(1.06);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.oxqq-dice-app__total-line {
    margin-top: 0.75rem;
    font-size: 0.9375rem;
    color: #475569;
}

body.game-page--dice-php.dark-theme .oxqq-dice-app__total-line {
    color: #cbd5e1;
}

.oxqq-dice-app__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
}

.oxqq-dice-app__toolbar button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: 0.35rem;
    font-size: 0.9375rem;
    cursor: pointer;
    border: 1px solid transparent;
}

.oxqq-dice-app__toolbar .oxqq-dice-app__roll {
    background: #2563eb;
    color: #fff;
    border-color: #1d4ed8;
}

.oxqq-dice-app__toolbar .oxqq-dice-app__roll:hover:not(:disabled) {
    background: #1d4ed8;
}

.oxqq-dice-app__toolbar .oxqq-dice-app__roll:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.oxqq-dice-app__toolbar .oxqq-dice-app__secondary {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

body.game-page--dice-php.dark-theme .oxqq-dice-app__toolbar .oxqq-dice-app__secondary {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #475569;
}

.oxqq-dice-app__toolbar .oxqq-dice-app__secondary:hover:not(:disabled) {
    background: #e2e8f0;
}

body.game-page--dice-php.dark-theme .oxqq-dice-app__toolbar .oxqq-dice-app__secondary:hover:not(:disabled) {
    background: #334155;
}

/* Modal history */
.oxqq-dice-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.oxqq-dice-modal-overlay.is-open {
    display: flex;
}

.oxqq-dice-modal {
    background: #fff;
    color: #0f172a;
    border-radius: 0.5rem;
    max-width: 28rem;
    width: 100%;
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid #e2e8f0;
}

body.game-page--dice-php.dark-theme .oxqq-dice-modal {
    background: #15202b;
    color: #f1f5f9;
    border-color: #334155;
}

.oxqq-dice-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
}

body.game-page--dice-php.dark-theme .oxqq-dice-modal__head {
    border-color: #334155;
}

.oxqq-dice-modal__close {
    border: none;
    background: transparent;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    padding: 0.25rem;
}

.oxqq-dice-modal__body {
    padding: 0.75rem 1rem 1rem;
    font-size: 0.875rem;
}

.oxqq-dice-modal__body ul {
    margin: 0;
    padding-left: 1.1rem;
}

.oxqq-dice-modal__body li + li {
    margin-top: 0.5rem;
}

.oxqq-dice-modal__foot {
    padding: 0 1rem 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}
