/* BeeWin — наши игры v2 (Mines / Dice / Limbo / Wheel). Общая оболочка .gm + стили каждой игры. */

.gm {
    --gm-bg: #141722;
    --gm-card: #1b1f2c;
    --gm-panel: #171a26;
    --gm-input: #10131c;
    --gm-chip: #252b3d;
    --gm-chip-hover: #2f3750;
    --gm-line: rgba(255, 255, 255, .06);
    --gm-text: #ffffff;
    --gm-muted: #8a93ab;
    --gm-accent: #367cff;
    --gm-accent2: #66a4ff;
    --gm-win: #22c55e;
    --gm-lose: #ef4444;
    --gm-shadow: 0 18px 50px rgba(0, 0, 0, .35);
    color: var(--gm-text);
    margin: 6px 0 26px;
    font-family: inherit;
}

body.bw-light .gm {
    --gm-bg: #eef2f9;
    --gm-card: #ffffff;
    --gm-panel: #f5f7fc;
    --gm-input: #ffffff;
    --gm-chip: #e4eaf5;
    --gm-chip-hover: #d5def0;
    --gm-line: rgba(20, 35, 70, .09);
    --gm-text: #1b2233;
    --gm-muted: #75809a;
    --gm-shadow: 0 18px 40px rgba(30, 50, 100, .10);
}

.gm *,
.gm *::before,
.gm *::after {
    box-sizing: border-box;
}

/* Быстрые нажатия без двойного тапа-зума на телефоне */
.gm,
.gm button,
.gm input,
.gmm-cell,
.gmd-range {
    touch-action: manipulation;
}

.gm button {
    -webkit-user-select: none;
    user-select: none;
}

/* В играх не показываем нижнее меню и кнопку поддержки */
body:has(main[data-barba-namespace="mines_page"]) .bw-bottom-dock,
body:has(main[data-barba-namespace="dice_page"]) .bw-bottom-dock,
body:has(main[data-barba-namespace="bubbles_page"]) .bw-bottom-dock,
body:has(main[data-barba-namespace="wheel_page"]) .bw-bottom-dock,
body:has(main[data-barba-namespace="mines_page"]) div[class^="_widget_"],
body:has(main[data-barba-namespace="dice_page"]) div[class^="_widget_"],
body:has(main[data-barba-namespace="bubbles_page"]) div[class^="_widget_"],
body:has(main[data-barba-namespace="wheel_page"]) div[class^="_widget_"],
body:has(main[data-barba-namespace="mines_page"]) div[class*=" _widget_"],
body:has(main[data-barba-namespace="dice_page"]) div[class*=" _widget_"],
body:has(main[data-barba-namespace="bubbles_page"]) div[class*=" _widget_"],
body:has(main[data-barba-namespace="wheel_page"]) div[class*=" _widget_"] {
    display: none !important;
}

body:has(main[data-barba-namespace="mines_page"]),
body:has(main[data-barba-namespace="dice_page"]),
body:has(main[data-barba-namespace="bubbles_page"]),
body:has(main[data-barba-namespace="wheel_page"]) {
    padding-bottom: 0 !important;
}

.gm button {
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

/* В шрифте Gotham нет «½» и «₽» — для мелких кнопок берём системный */
.gm .gm-mini,
.gm .gm-chip {
    font-family: "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
}

.gm-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.gm-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: .01em;
}

.gm-title__ico {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: linear-gradient(140deg, #4b8bff, #1f5fe0);
    color: #fff;
    font-size: 16px;
    box-shadow: 0 6px 18px rgba(54, 124, 255, .35);
}

.gm-title small {
    display: block;
    margin-top: 2px;
    color: var(--gm-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
}

.gm-fair {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 13px;
    border: 1px solid var(--gm-line);
    border-radius: 999px;
    background: var(--gm-card);
    color: var(--gm-muted);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: color .2s, border-color .2s;
}

.gm-fair:hover {
    color: var(--gm-win);
    border-color: rgba(34, 197, 94, .4);
}

.gm-fair i {
    color: var(--gm-win);
}

.gm-body {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--gm-line);
    border-radius: 20px;
    background: var(--gm-card);
    box-shadow: var(--gm-shadow);
}

.gm-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    padding: 16px;
    border-radius: 15px;
    background: var(--gm-panel);
}

.gm-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 440px;
    padding: 18px;
    overflow: hidden;
    border-radius: 15px;
    background:
        radial-gradient(120% 80% at 50% -10%, rgba(54, 124, 255, .20), transparent 60%),
        var(--gm-bg);
}

.gm-stage.is-win {
    animation: gmFlashWin .7s ease;
}

.gm-stage.is-lose {
    animation: gmFlashLose .55s ease;
}

@keyframes gmFlashWin {
    0% { box-shadow: inset 0 0 0 0 rgba(34, 197, 94, 0); }
    30% { box-shadow: inset 0 0 0 3px rgba(34, 197, 94, .8), inset 0 0 60px rgba(34, 197, 94, .25); }
    100% { box-shadow: inset 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes gmFlashLose {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
}

/* Поля ввода */
.gm-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.gm-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--gm-muted);
    font-size: 12px;
    font-weight: 800;
}

.gm-label b {
    color: var(--gm-text);
    font-weight: 900;
}

.gm-input {
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 6px 0 14px;
    border: 1px solid var(--gm-line);
    border-radius: 12px;
    background: var(--gm-input);
    transition: border-color .2s, box-shadow .2s;
}

.gm-input:focus-within {
    border-color: var(--gm-accent);
    box-shadow: 0 0 0 3px rgba(54, 124, 255, .15);
}

.gm-input.is-locked {
    opacity: .6;
    pointer-events: none;
}

.gm-input input {
    flex: 1;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: var(--gm-text);
    font-size: 16px;
    font-weight: 800;
    -moz-appearance: textfield;
}

.gm-input input::-webkit-outer-spin-button,
.gm-input input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.gm-input input:disabled {
    background: transparent;
    color: var(--gm-text);
    -webkit-text-fill-color: var(--gm-text);
}

.gm-input__unit {
    margin: 0 8px 0 4px;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--gm-muted);
    font-size: 14px;
    font-weight: 900;
}

.gm-mini {
    flex: none;
    height: 34px;
    min-width: 40px;
    margin-left: 4px;
    padding: 0 9px;
    border: 0;
    border-radius: 9px;
    background: var(--gm-chip);
    color: var(--gm-text);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    transition: background .15s;
}

.gm-mini:hover {
    background: var(--gm-chip-hover);
}

.gm-chips {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.gm-chip {
    height: 32px;
    padding: 0 6px;
    border: 0;
    border-radius: 9px;
    background: var(--gm-chip);
    color: var(--gm-text);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    transition: background .15s, color .15s, transform .1s;
}

.gm-chip:hover {
    background: var(--gm-chip-hover);
}

.gm-chip:active,
.gm-mini:active {
    transform: scale(.96);
}

.gm-chip.is-active {
    background: var(--gm-accent);
    color: #fff;
}

.gm-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.gm-stat {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--gm-line);
    border-radius: 11px;
    background: var(--gm-input);
}

.gm-stat span {
    display: block;
    color: var(--gm-muted);
    font-size: 11px;
    font-weight: 800;
}

.gm-stat b {
    display: block;
    overflow: hidden;
    margin-top: 2px;
    font-size: 15px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gm-stat b.is-win {
    color: var(--gm-win);
}

/* Кнопки действия */
.gm-play {
    position: relative;
    width: 100%;
    height: 56px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(180deg, #4d8dff 0%, #2563eb 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: .02em;
    box-shadow: 0 10px 26px rgba(54, 124, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
    cursor: pointer;
    transition: transform .12s, filter .2s, box-shadow .2s;
}

.gm-play:hover {
    filter: brightness(1.08);
}

.gm-play:active {
    transform: scale(.985);
}

.gm-play:disabled {
    filter: saturate(.5) brightness(.8);
    cursor: default;
    transform: none;
}

.gm-play.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 18px;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: gmSpin .7s linear infinite;
}

@keyframes gmSpin {
    to { transform: rotate(360deg); }
}

.gm-play--cash {
    background: linear-gradient(180deg, #37d97c 0%, #15a34a 100%);
    box-shadow: 0 10px 26px rgba(34, 197, 94, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
}

.gm-play small {
    display: block;
    margin-top: 1px;
    font-size: 11px;
    font-weight: 800;
    opacity: .85;
}

.gm-ghost {
    width: 100%;
    height: 42px;
    border: 1px solid var(--gm-line);
    border-radius: 12px;
    background: var(--gm-chip);
    color: var(--gm-text);
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.gm-ghost:hover {
    background: var(--gm-chip-hover);
}

.gm-hint {
    color: var(--gm-muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
}

/* Лента последних результатов */
.gm-recent {
    display: flex;
    gap: 6px;
    min-height: 28px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
}

.gm-recent span {
    flex: none;
    height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    background: var(--gm-chip);
    font-size: 12px;
    font-weight: 900;
    line-height: 28px;
    animation: gmPop .3s ease;
}

.gm-recent span.is-win {
    background: rgba(34, 197, 94, .16);
    color: var(--gm-win);
}

.gm-recent span.is-lose {
    background: rgba(239, 68, 68, .14);
    color: #ff6b6b;
}

@keyframes gmPop {
    from { opacity: 0; transform: scale(.7); }
    to { opacity: 1; transform: scale(1); }
}

/* Окно «Честная игра» */
.gm-modal {
    position: fixed;
    inset: 0;
    z-index: 10250;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(6, 9, 16, .72);
    backdrop-filter: blur(4px);
}

.gm-modal.is-open {
    display: flex;
}

.gm-modal__box {
    width: 100%;
    max-width: 440px;
    padding: 20px;
    border: 1px solid var(--gm-line);
    border-radius: 18px;
    background: var(--gm-card);
    color: var(--gm-text);
    box-shadow: var(--gm-shadow);
    animation: gmPop .2s ease;
}

.gm-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 17px;
    font-weight: 900;
}

.gm-modal__close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 9px;
    background: var(--gm-chip);
    color: var(--gm-text);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.gm-modal p {
    margin: 0 0 12px;
    color: var(--gm-muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

.gm-hash {
    padding: 12px;
    border: 1px dashed var(--gm-line);
    border-radius: 11px;
    background: var(--gm-input);
    color: var(--gm-text);
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 11px;
    line-height: 1.5;
    word-break: break-all;
}

/* ---------- MINES ---------- */
.gmm-strip {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.gmm-strip::-webkit-scrollbar {
    display: none;
}

.gmm-strip span {
    flex: none;
    min-width: 62px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--gm-line);
    border-radius: 10px;
    background: var(--gm-panel);
    color: var(--gm-muted);
    font-size: 12px;
    font-weight: 900;
    line-height: 32px;
    text-align: center;
    transition: all .25s;
}

.gmm-strip span.is-done {
    border-color: rgba(34, 197, 94, .35);
    background: rgba(34, 197, 94, .12);
    color: var(--gm-win);
}

.gmm-strip span.is-next {
    border-color: var(--gm-accent);
    background: rgba(54, 124, 255, .14);
    color: var(--gm-text);
}

.gmm-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 470px;
    margin: auto;
}

.gmm-cell {
    position: relative;
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(180deg, #2d3550 0%, #232a40 100%);
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .06);
    cursor: default;
    transition: transform .15s, background .2s, box-shadow .2s, opacity .3s;
}

body.bw-light .gmm-cell {
    background: linear-gradient(180deg, #dbe3f2 0%, #c9d4ea 100%);
    box-shadow: inset 0 -4px 0 rgba(40, 60, 110, .12), inset 0 1px 0 rgba(255, 255, 255, .6);
}

.gmm-grid.is-live .gmm-cell:not(.is-open) {
    cursor: pointer;
}

.gmm-grid.is-live .gmm-cell:not(.is-open):hover {
    transform: translateY(-3px);
    background: linear-gradient(180deg, #3a64c9 0%, #2c4fa8 100%);
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25), 0 8px 18px rgba(54, 124, 255, .25);
}

.gmm-grid:not(.is-live) .gmm-cell:not(.is-open) {
    opacity: .75;
}

.gmm-cell svg {
    position: absolute;
    inset: 16%;
    width: 68%;
    height: 68%;
    animation: gmmReveal .35s cubic-bezier(.2, 1.4, .4, 1);
}

.gmm-cell.is-open {
    background: var(--gm-panel);
    box-shadow: inset 0 0 0 1px var(--gm-line);
}

.gmm-cell.is-gem.is-picked {
    background: radial-gradient(circle at 50% 45%, rgba(34, 197, 94, .30), rgba(34, 197, 94, .06) 70%), var(--gm-panel);
    box-shadow: inset 0 0 0 2px rgba(34, 197, 94, .55);
}

.gmm-cell.is-bomb.is-picked {
    background: radial-gradient(circle at 50% 45%, rgba(239, 68, 68, .40), rgba(239, 68, 68, .08) 70%), var(--gm-panel);
    box-shadow: inset 0 0 0 2px rgba(239, 68, 68, .7);
}

.gmm-cell.is-open:not(.is-picked) svg {
    opacity: .38;
    filter: saturate(.6);
}

@keyframes gmmReveal {
    from { opacity: 0; transform: scale(.4) rotate(-12deg); }
    to { opacity: 1; transform: scale(1) rotate(0); }
}

.gmm-count {
    display: grid;
    grid-template-columns: 48px 1fr 48px;
    gap: 6px;
}

.gmm-count .gm-input {
    justify-content: center;
    padding: 0;
}

.gmm-count .gm-input input {
    text-align: center;
}

.gmm-count .gm-mini {
    width: 48px;
    height: 48px;
    margin: 0;
    font-size: 18px;
}

/* ---------- DICE ---------- */
.gmd-stage {
    justify-content: center;
    gap: 26px;
}

.gmd-result {
    text-align: center;
}

.gmd-result__num {
    font-size: clamp(46px, 7vw, 84px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: .02em;
    font-variant-numeric: tabular-nums;
    transition: color .25s;
}

.gmd-result__num.is-win {
    color: var(--gm-win);
    text-shadow: 0 0 34px rgba(34, 197, 94, .45);
}

.gmd-result__num.is-lose {
    color: #ff5b5b;
}

.gmd-result__sub {
    margin-top: 8px;
    color: var(--gm-muted);
    font-size: 14px;
    font-weight: 800;
}

.gmd-bar {
    position: relative;
    height: 18px;
    margin: 18px 6px 26px;
    border-radius: 999px;
    background: rgba(138, 147, 171, .22);
}

.gmd-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    transition: width .2s;
}

.gmd-zone--low {
    left: 0;
    border-radius: 999px 0 0 999px;
    background: linear-gradient(90deg, #16a34a, #22c55e);
}

.gmd-zone--high {
    right: 0;
    border-radius: 0 999px 999px 0;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.gmd-scale {
    position: absolute;
    top: 26px;
    right: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    color: var(--gm-muted);
    font-size: 11px;
    font-weight: 800;
}

.gmd-marker {
    position: absolute;
    top: -34px;
    left: 0;
    z-index: 2;
    opacity: 0;
    transform: translateX(-50%);
    transition: left .38s cubic-bezier(.2, .9, .2, 1), opacity .2s;
}

.gmd-marker.is-on {
    opacity: 1;
}

.gmd-marker b {
    display: block;
    padding: 4px 9px;
    border-radius: 8px;
    background: var(--gm-text);
    color: var(--gm-bg);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.gmd-marker::after {
    content: "";
    display: block;
    width: 4px;
    height: 34px;
    margin: 0 auto;
    border-radius: 2px;
    background: var(--gm-text);
}

.gmd-marker.is-win b,
.gmd-marker.is-win::after {
    background: var(--gm-win);
    color: #fff;
}

.gmd-marker.is-lose b,
.gmd-marker.is-lose::after {
    background: var(--gm-lose);
    color: #fff;
}

.gmd-range {
    width: 100%;
    height: 8px;
    margin: 6px 0 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gm-accent) var(--fill, 50%), var(--gm-chip) var(--fill, 50%));
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.gmd-range::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
    border: 4px solid #fff;
    border-radius: 50%;
    background: var(--gm-accent);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
    -webkit-appearance: none;
    appearance: none;
}

.gmd-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: 4px solid #fff;
    border-radius: 50%;
    background: var(--gm-accent);
}

.gmd-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.gmd-btns .gm-play {
    height: 62px;
    line-height: 1.15;
}

.gmd-btns .gm-play--low {
    background: linear-gradient(180deg, #37d97c 0%, #15a34a 100%);
    box-shadow: 0 10px 24px rgba(34, 197, 94, .28), inset 0 1px 0 rgba(255, 255, 255, .25);
}

.gmd-btns .gm-play--high {
    background: linear-gradient(180deg, #fbbf24 0%, #e08a00 100%);
    box-shadow: 0 10px 24px rgba(245, 158, 11, .28), inset 0 1px 0 rgba(255, 255, 255, .25);
}

/* ---------- LIMBO ---------- */
.gml-stage {
    align-items: stretch;
}

.gml-center {
    position: relative;
    z-index: 2;
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
}

.gml-x {
    font-size: clamp(56px, 9vw, 112px);
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: .01em;
    transition: color .2s, text-shadow .2s;
}

.gml-x.is-win {
    color: var(--gm-win);
    text-shadow: 0 0 40px rgba(34, 197, 94, .5);
}

.gml-x.is-lose {
    color: #ff5b5b;
    text-shadow: 0 0 30px rgba(239, 68, 68, .35);
}

.gml-target {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(138, 147, 171, .14);
    color: var(--gm-muted);
    font-size: 13px;
    font-weight: 800;
}

.gml-target b {
    color: var(--gm-text);
}

.gml-msg {
    min-height: 22px;
    margin-top: 12px;
    font-size: 15px;
    font-weight: 900;
}

.gml-msg.is-win {
    color: var(--gm-win);
}

.gml-msg.is-lose {
    color: var(--gm-muted);
}

.gml-bubbles {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.gml-bubbles i {
    position: absolute;
    bottom: -60px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .55), rgba(102, 164, 255, .22) 45%, rgba(54, 124, 255, .08) 75%);
    box-shadow: inset 0 0 0 1px rgba(140, 190, 255, .35), 0 0 18px rgba(54, 124, 255, .18);
    animation: gmlRise linear infinite;
}

.gml-stage.is-rolling .gml-bubbles i {
    animation-duration: 2.2s !important;
}

@keyframes gmlRise {
    from { transform: translateY(0) scale(.8); opacity: 0; }
    15% { opacity: 1; }
    to { transform: translateY(-560px) scale(1.1); opacity: 0; }
}

/* ---------- WHEEL ---------- */
.gmw-stage {
    align-items: center;
    gap: 16px;
}

.gmw-wrap {
    position: relative;
    width: min(400px, 100%);
    aspect-ratio: 1;
    margin: 4px auto 0;
}

.gmw-disc {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 8px rgba(255, 255, 255, .04), 0 20px 60px rgba(0, 0, 0, .45);
    will-change: transform;
}

.gmw-disc svg {
    display: block;
    width: 100%;
    height: 100%;
}

.gmw-seg text {
    fill: #fff;
    font-size: 15px;
    font-weight: 900;
    text-anchor: middle;
    dominant-baseline: middle;
}

.gmw-pointer {
    position: absolute;
    top: -6px;
    left: 50%;
    z-index: 3;
    width: 34px;
    height: 40px;
    transform: translateX(-50%);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .45));
}

.gmw-hub {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 46%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, #262c42, #141826 70%);
    box-shadow: 0 0 0 6px rgba(255, 255, 255, .05), inset 0 0 30px rgba(0, 0, 0, .5);
    transform: translate(-50%, -50%);
    text-align: center;
    transition: box-shadow .4s;
}

body.bw-light .gmw-hub {
    background: radial-gradient(circle at 50% 35%, #ffffff, #e4eaf5 70%);
    box-shadow: 0 0 0 6px rgba(20, 35, 70, .06), inset 0 0 20px rgba(30, 50, 100, .12);
}

.gmw-hub b {
    display: block;
    font-size: clamp(30px, 6vw, 46px);
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.gmw-hub span {
    display: block;
    margin-top: 4px;
    color: var(--gm-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.gmw-hub.blue { box-shadow: 0 0 0 6px #4c6fff, 0 0 40px rgba(76, 111, 255, .45); }
.gmw-hub.red { box-shadow: 0 0 0 6px #ff4d5e, 0 0 40px rgba(255, 77, 94, .45); }
.gmw-hub.purple { box-shadow: 0 0 0 6px #a259ff, 0 0 40px rgba(162, 89, 255, .45); }
.gmw-hub.gold { box-shadow: 0 0 0 6px #ffc23d, 0 0 40px rgba(255, 194, 61, .5); }

.gmw-timer {
    width: min(400px, 100%);
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(138, 147, 171, .2);
}

.gmw-timer i {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #367cff, #66a4ff);
    transition: width 1s linear;
}

.gmw-hist {
    display: flex;
    gap: 6px;
    width: 100%;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
}

.gmw-hist > div {
    flex: none;
    min-width: 36px;
    height: 28px;
    padding: 0 8px;
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    line-height: 28px;
    text-align: center;
}

.gmw-hist > div.is-new {
    animation: gmPop .3s ease;
}

.gmw-hist .color-blue { background: #4c6fff; }
.gmw-hist .color-red { background: #ff4d5e; }
.gmw-hist .color-purple { background: #a259ff; }
.gmw-hist .color-gold { background: #ffc23d; color: #3b2a00; }

.gmw-bets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.gmw-bet {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 12px;
    border: 0;
    border-radius: 13px;
    color: #fff;
    text-align: left;
    cursor: pointer;
    transition: transform .12s, filter .2s;
}

.gmw-bet:hover {
    filter: brightness(1.1);
}

.gmw-bet:active {
    transform: scale(.97);
}

.gmw-bet__x {
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
}

.gmw-bet__meta {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    opacity: .9;
}

.gmw-bet--blue { background: linear-gradient(160deg, #5c7cff, #3a55e6); box-shadow: 0 8px 20px rgba(76, 111, 255, .3); }
.gmw-bet--red { background: linear-gradient(160deg, #ff6372, #e3344a); box-shadow: 0 8px 20px rgba(255, 77, 94, .3); }
.gmw-bet--purple { background: linear-gradient(160deg, #b277ff, #8a3ff0); box-shadow: 0 8px 20px rgba(162, 89, 255, .3); }
.gmw-bet--gold { background: linear-gradient(160deg, #ffd166, #f5a700); box-shadow: 0 8px 20px rgba(255, 194, 61, .3); color: #3b2a00; }

/* ---------- История ставок под играми ---------- */
#history-block .title-index-mini {
    font-size: 16px;
    font-weight: 900;
}

#history-block .history table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
}

#history-block .history thead td {
    padding: 0 10px 2px;
    color: #8a93ab;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

/* ---------- Адаптив ---------- */
@media (max-width: 991px) {
    .gm-body {
        grid-template-columns: 300px minmax(0, 1fr);
    }
}

@media (max-width: 860px) {
    .gm {
        margin-top: 0;
    }

    .gm-body {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        padding: 10px;
        border-radius: 18px;
    }

    .gm-stage {
        order: -1;
        min-height: 0;
        padding: 14px;
    }

    .gm-panel {
        padding: 14px;
        gap: 12px;
    }

    /* На телефоне кнопка игры сразу под полем — не листать вниз */
    .gm-panel > .gm-play,
    .gm-panel > .gmd-btns,
    .gm-panel > .gmw-colors {
        order: -2;
    }

    .gm-panel > #gmmRandom {
        order: -1;
        margin-top: -4px;
    }

    .gml-center {
        min-height: 230px;
    }

    .gmd-stage {
        gap: 18px;
        padding-top: 22px;
    }

    .gmm-grid {
        gap: 8px;
        max-width: 420px;
    }

    .gmm-cell {
        border-radius: 12px;
    }
}

@media (max-width: 520px) {
    .gm-head {
        margin-bottom: 10px;
    }

    .gm-title {
        font-size: 18px;
    }

    .gm-title__ico {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .gm-fair span {
        display: none;
    }

    .gm-body {
        margin: 0 -6px;
        padding: 8px;
    }

    .gm-stage {
        padding: 12px;
    }

    .gmm-grid {
        gap: 7px;
    }

    .gmm-cell {
        border-radius: 10px;
    }

    .gm-play {
        height: 54px;
    }

    .gmw-wrap {
        width: min(290px, 100%);
    }

    #history-block .history td:nth-child(4) {
        display: none;
    }

    .gmw-seg text {
        font-size: 16px;
    }
}

/* ---------- Лента «Ставки в реальном времени» под играми ---------- */
#history-block > br {
    display: none;
}

.gh {
    --gh-card: #1b1f2c;
    --gh-row: #151925;
    --gh-line: rgba(255, 255, 255, .06);
    --gh-text: #ffffff;
    --gh-muted: #8a93ab;
    margin: 4px 0 30px;
    padding: 16px;
    border: 1px solid var(--gh-line);
    border-radius: 20px;
    background: var(--gh-card);
    color: var(--gh-text);
}

body.bw-light .gh {
    --gh-card: #ffffff;
    --gh-row: #f3f6fb;
    --gh-line: rgba(20, 35, 70, .09);
    --gh-text: #1b2233;
    --gh-muted: #75809a;
}

.gh-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.gh-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 900;
}

.gh-live {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .6);
    animation: ghPulse 1.8s ease-out infinite;
}

@keyframes ghPulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.gh-online {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(34, 197, 94, .12);
    color: #22c55e;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.gh-cols,
.gh-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) 110px 90px 120px;
    align-items: center;
    gap: 10px;
}

.gh-cols {
    padding: 0 14px 6px;
    color: var(--gh-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.gh-cols span:nth-child(n+3) {
    text-align: right;
}

.gh-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gh-row {
    min-height: 52px;
    padding: 8px 14px;
    border-radius: 13px;
    background: var(--gh-row);
    animation: ghIn .35s ease;
}

@keyframes ghIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

.gh-game {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--gh-muted);
    font-size: 12px;
    font-weight: 900;
}

.gh-game i {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(54, 124, 255, .15);
    color: #66a4ff;
    font-size: 12px;
}

.gh-user {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.gh-user img {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    object-fit: cover;
    background: #0d1018;
}

.gh-user b {
    overflow: hidden;
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gh-meta {
    display: contents;
}

.gh-bet,
.gh-x,
.gh-res {
    font-size: 13px;
    font-weight: 900;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.gh-bet {
    color: var(--gh-muted);
}

.gh-row.is-win .gh-x {
    color: #66a4ff;
}

.gh-row.is-lose .gh-x {
    color: var(--gh-muted);
}

.gh-row.is-win .gh-res {
    color: #22c55e;
}

.gh-row.is-lose .gh-res {
    color: #ff6b6b;
    opacity: .85;
}

.gh-empty {
    padding: 22px;
    border: 1px dashed var(--gh-line);
    border-radius: 13px;
    color: var(--gh-muted);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

@media (max-width: 760px) {
    .gh {
        padding: 12px;
        border-radius: 18px;
    }

    .gh-title {
        font-size: 14px;
    }

    .gh-cols {
        display: none;
    }

    .gh-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "user res"
            "game meta";
        row-gap: 4px;
        min-height: 0;
        padding: 9px 12px;
    }

    .gh-user { grid-area: user; }
    .gh-res { grid-area: res; font-size: 14px; }
    .gh-game { grid-area: game; font-size: 11px; }

    .gh-game i {
        width: 20px;
        height: 20px;
        border-radius: 6px;
        font-size: 10px;
    }

    .gh-meta {
        grid-area: meta;
        display: flex;
        justify-content: flex-end;
        gap: 8px;
    }

    .gh-bet,
    .gh-x {
        font-size: 11px;
    }

    .gh-user img {
        width: 26px;
        height: 26px;
    }
}