:root {
    --header-h: 64px;
    --cell: clamp(24px, 4.4vh, 40px);
    --sideW: clamp(54px, 8vw, 76px);
    --feltA: rgba(8,58,46,.58);
    --feltB: rgba(5,32,25,.58);
    --gold1: #ffe39b;
    --gold2: #ffc94a;
    --chipA: #86efac;
    --chipB: #86efac;
    --chipText: #071018;
    --hlY-outline: rgba(255,210,77,.22);
    --hlY-bg: rgba(255,210,77,.10);
    --hlY-shadow: rgba(255,210,77,.10);
    --hlG-outline: rgba(120,255,200,.22);
    --hlG-shadow: rgba(120,255,200,.12);
    /* === VIDEO TUNING === */
    --ov-desktop-fit: cover;
    --ov-desktop-scale: 1.03;
    --ov-desktop-y: 4%;
    --ov-mobile-zoom: 2.5;
    --ov-mobile-y: -2%;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #000;
    color: #fff;
    font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

/* === TOPBAR === */
.topbar {
    height: var(--header-h);
    display: flex;
    align-items: center;
    background: rgba(0,0,0,.55);
    border-bottom: 1px solid rgba(255,255,255,.08);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 50;
}

.topbar-inner {
    width: min(1400px,96vw);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #78ffc8;
    box-shadow: 0 0 18px rgba(120,255,200,.55);
}

.brand-title {
    font-weight: 950;
    letter-spacing: .5px;
    opacity: .95;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(0,0,0,.28);
    font-weight: 850;
    font-size: 13px;
}

    .pill b {
        font-weight: 950;
    }

    .pill.gold {
        border-color: rgba(255,210,77,.35);
        background: rgba(255,210,77,.10);
    }

    .pill.live {
        font-weight: 950;
        letter-spacing: .2px;
    }

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #ff3355;
    box-shadow: 0 0 14px rgba(255,51,85,.55);
}

/* === STAGE/VIDEO === */
.stage {
    height: 100dvh;
    position: relative;
    overflow: hidden;
}

.video-full {
    position: absolute;
    inset: 0;
    background: #000;
    overflow: hidden;
}

.webrtc-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    overflow: hidden;
}

    /* ===== WEBRTC VIDEO WRAPPERS ===== */
    .webrtc-video,
    .webrtc-video > div,
    .webrtc-video > video {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        min-width: 0 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        background: #000 !important;
    }

        /* desktop/base */
        .webrtc-video video,
        .webrtc-video iframe,
        .webrtc-video canvas {
            width: 100% !important;
            height: 100% !important;
            max-width: none !important;
            max-height: none !important;
            display: block !important;
            object-fit: var(--ov-desktop-fit) !important;
            object-position: 50% 50% !important;
            transform: translateY(var(--ov-desktop-y)) scale(var(--ov-desktop-scale)) !important;
            transform-origin: 50% 50% !important;
            margin: 0 !important;
            background: #000 !important;
        }


/* === TIMER RING === */
.timer-ring {
    position: absolute;
    left: 50%;
    bottom: 440px;
    transform: translateX(-50%);
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    z-index: 20;
}

    .timer-ring[hidden] {
        display: none !important;
    }

.timer-svg {
    position: absolute;
    inset: 0;
    transform: scaleX(-1);
}

.timer-progress {
    fill: none;
    stroke: #35ff7a;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 326.73;
    stroke-dashoffset: 0;
    filter: drop-shadow(0 0 10px rgba(0,0,0,.4));
    transform-box: fill-box;
    transform-origin: center;
    transform: rotate(-90deg);
    transition: stroke 120ms linear, stroke-dashoffset 120ms linear;
    will-change: stroke-dashoffset, stroke;
}

.timer-text {
    position: relative;
    font-weight: 950;
    font-size: 30px;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0,0,0,.55);
}

/* === BADGES / UI === */
.round-result {
    position: absolute;
    left: 50%;
    bottom: 440px;
    transform: translateX(-50%);
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    backdrop-filter: none;
    font-weight: 950;
    letter-spacing: .2px;
    z-index: 21;
    display: grid;
    place-items: center;
}

    .round-result[hidden] {
        display: none !important;
    }

    .round-result .rr-num {
        width: 76px;
        height: 76px;
        border-radius: 18px;
        display: grid;
        place-items: center;
        color: #fff;
        font-size: 40px;
        line-height: 1;
        text-shadow: 0 2px 10px rgba(0,0,0,.45);
        border: 1px solid rgba(255,255,255,.14);
    }

    .round-result.green .rr-num {
        background: rgba(0,180,0,.85);
    }

    .round-result.red .rr-num {
        background: rgba(210,0,0,.85);
    }

    .round-result.black .rr-num {
        background: rgba(0,0,0,.85);
    }

.result-badge {
    position: absolute;
    left: 14px;
    bottom: 14px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(0,0,0,.50);
    border: 1px solid rgba(255,255,255,.12);
    backdrop-filter: blur(10px);
    font-weight: 950;
    z-index: 20;
    width: fit-content;
    max-width: calc(100vw - 28px);
    box-sizing: border-box;
}

    .result-badge[hidden] {
        display: none !important;
    }

    .result-badge.win {
        outline: 2px solid rgba(0,200,0,.35);
    }

    .result-badge.lose {
        outline: 2px solid rgba(200,0,0,.35);
    }

    .result-badge.push {
        outline: 2px solid rgba(180,180,180,.25);
    }

.last-results {
    position: absolute;
    right: 14px;
    top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(0,0,0,.35);
    border: 1px solid rgba(255,255,255,.12);
    backdrop-filter: blur(10px);
    z-index: 20;
}

.lr-title {
    font-weight: 950;
    font-size: 12px;
    opacity: .8;
    letter-spacing: .25px;
}

.lr-row {
    display: flex;
    gap: 6px;
}

.lr {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-weight: 950;
    font-size: 12px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(0,0,0,.18);
}

    .lr.red {
        background: rgba(150,20,28,.92);
    }

    .lr.black {
        background: rgba(10,12,16,.92);
    }

    .lr.green {
        background: rgba(8,115,72,.92);
    }

.icon-btn {
    position: absolute;
    right: 14px;
    top: 74px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(0,0,0,.38);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    backdrop-filter: blur(10px);
    z-index: 20;
}

.quality-btn {
    top: 74px;
    right: 66px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    min-width: 44px;
    padding: 0 12px;
}

.quality-badge {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    color: rgba(255,255,255,.92);
}

.quality-pop {
    position: absolute;
    right: 66px;
    top: 126px;
    display: none;
    min-width: 220px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(0,0,0,.56);
    backdrop-filter: blur(14px);
    box-shadow: 0 14px 36px rgba(0,0,0,.28);
    z-index: 24;
}

    .quality-pop.open {
        display: grid;
        gap: 10px;
    }

.quality-pop-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.quality-pop-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.72);
}

.quality-list {
    display: grid;
    gap: 8px;
}

.quality-option {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.06);
    color: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

    .quality-option:hover {
        background: rgba(255,255,255,.10);
        border-color: rgba(255,255,255,.16);
    }

    .quality-option:active {
        transform: scale(.985);
    }

    .quality-option span {
        font-size: 13px;
        font-weight: 800;
        letter-spacing: .01em;
    }

    .quality-option small {
        font-size: 11px;
        color: rgba(255,255,255,.62);
        font-weight: 700;
    }

    .quality-option.is-active,
    .quality-option[aria-selected="true"] {
        background: rgba(255,255,255,.14);
        border-color: rgba(255,255,255,.24);
        box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
    }

.quality-note {
    font-size: 12px;
    color: rgba(255,255,255,.78);
    text-align: right;
    font-weight: 600;
}

.vol-btn {
    top: 74px;
}

.vol-pop {
    top: 124px;
}

.vol-pop {
    position: absolute;
    right: 14px;
    top: 124px;
    display: none;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(0,0,0,.55);
    border: 1px solid rgba(255,255,255,.12);
    backdrop-filter: blur(10px);
    z-index: 23;
}

    .vol-pop.open {
        display: block;
    }

    .vol-pop input[type="range"] {
        width: 160px;
    }

/* === ROULETTE TABLE === */
.table-overlay {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 18px;
    z-index: 12;
    width: min(1180px,96vw);
    padding: 10px 10px 8px;
    border-radius: 16px;
    background: rgba(0,0,0,.18);
    border: 1px solid rgba(255,255,255,.10);
    backdrop-filter: blur(6px);
    transition: transform 260ms ease, opacity 260ms ease, filter 260ms ease;
    transform-origin: bottom center;
}

.table-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 6px 8px;
    font-weight: 950;
    letter-spacing: .25px;
    text-shadow: 0 2px 10px rgba(0,0,0,.55);
}

#betStateText {
    font-size: 12px;
    opacity: .85;
}

.table-wrap {
    padding: 10px;
    border-radius: 14px;
    background: radial-gradient(900px 260px at 50% 0%, rgba(255,255,255,.06), transparent 65%), linear-gradient(180deg, var(--feltA), var(--feltB));
    border: 2px solid rgba(120,255,200,.22);
    box-shadow: 0 0 22px rgba(120,255,200,.14);
}

/* GRID */
.rb-grid {
    display: grid;
    gap: 6px;
    grid-template-columns: var(--sideW) repeat(12,1fr) var(--sideW);
    grid-auto-rows: var(--cell);
    align-items: stretch;
    position: relative;
}

/* CELLS */
.rb-cell {
    display: grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.16);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.35);
    cursor: pointer;
    user-select: none;
    font-weight: 950;
    font-size: 14px;
    letter-spacing: .2px;
    position: relative;
    transition: transform .06s ease, filter .15s ease, box-shadow .15s ease, outline .15s ease, background .15s ease;
}

    .rb-cell:hover {
        transform: translateY(-1px);
        filter: brightness(1.05);
    }

    .rb-cell:active {
        transform: translateY(0) scale(.985);
    }

    .rb-cell.num.red {
        background: rgba(170,25,38,.88);
    }

    .rb-cell.num.black {
        background: rgba(10,12,16,.88);
    }

    .rb-cell.zero {
        background: rgba(8,125,80,.92);
        border-color: rgba(120,255,200,.22);
        font-size: 18px;
    }

    .rb-cell.out {
        background: rgba(0,0,0,.18);
        border-color: rgba(120,255,200,.12);
        font-weight: 900;
        font-size: 13px;
    }

        .rb-cell.out.big {
            font-size: 13px;
        }

    .rb-cell.selected {
        box-shadow: 0 0 0 3px rgba(255,210,77,.85) inset, 0 0 18px rgba(255,210,77,.18);
    }

    /* diamonds */
    .rb-cell.diamond {
        color: transparent;
    }

        .rb-cell.diamond::before {
            content: "";
            width: 22px;
            height: 22px;
            transform: rotate(45deg);
            border-radius: 4px;
            display: block;
        }

        .rb-cell.diamond.red::before {
            background: rgba(255,40,70,.92);
        }

        .rb-cell.diamond.black::before {
            background: rgba(0,0,0,.88);
            border: 1px solid rgba(255,255,255,.10);
        }

/* CHIP ON CELL */
.cell-chip {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-weight: 950;
    font-size: 12px;
    line-height: 1;
    color: #111;
    letter-spacing: .2px;
    background: radial-gradient(circle at 35% 28%, rgba(255,255,255,.55), rgba(255,255,255,0) 38%), radial-gradient(circle at 50% 65%, rgba(0,0,0,.25), rgba(0,0,0,0) 52%), linear-gradient(180deg, var(--chipA), var(--chipB));
    border: 2px solid rgba(255,255,255,.22);
    box-shadow: 0 10px 22px rgba(0,0,0,.45), inset 0 2px 2px rgba(255,255,255,.55), inset 0 -4px 10px rgba(0,0,0,.25);
    pointer-events: none;
    text-shadow: 0 1px 0 rgba(255,255,255,.25);
}

    .cell-chip::before {
        content: "";
        position: absolute;
        inset: 6px;
        border-radius: 999px;
        background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.35), rgba(255,255,255,0) 45%), linear-gradient(180deg, rgba(0,0,0,.10), rgba(255,255,255,.10));
        box-shadow: inset 0 0 0 2px rgba(0,0,0,.16), inset 0 0 0 6px rgba(255,255,255,.18);
        opacity: .95;
    }

    .cell-chip::after {
        content: "";
        position: absolute;
        inset: -2px;
        border-radius: 999px;
        background: repeating-conic-gradient(from -10deg, rgba(255,255,255,0) 0 10deg, rgba(255,255,255,.40) 10deg 14deg, rgba(255,255,255,0) 14deg 30deg);
        mask: radial-gradient(circle, transparent 0 58%, #000 60%);
        opacity: .55;
    }

@media (max-width:720px) {
    .cell-chip {
        width: 34px;
        height: 34px;
        font-size: 11px;
    }

        .cell-chip::before {
            inset: 5px;
        }
}

/* CHIPBAR */
.chipbar {
    margin-top: 10px;
    padding: 8px;
    border-radius: 14px;
    background: rgba(0,0,0,.20);
    border: 1px solid rgba(255,255,255,.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.chipbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.chipbar-label {
    font-weight: 900;
    opacity: .75;
}

.chipbar-right {
    font-size: 12px;
    opacity: .7;
    font-weight: 800;
}

.chip {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,.22);
    background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.18), rgba(0,0,0,.30)), rgba(30,40,58,.85);
    color: #fff;
    font-weight: 950;
    cursor: pointer;
    position: relative;
    box-shadow: 0 10px 20px rgba(0,0,0,.35);
    transition: transform .08s ease, filter .15s ease, box-shadow .15s ease;
}

    .chip span {
        position: relative;
        z-index: 2;
    }

    .chip::after {
        content: "";
        position: absolute;
        inset: 6px;
        border-radius: 999px;
        border: 2px dashed rgba(255,255,255,.22);
        opacity: .55;
    }

    .chip:hover {
        transform: translateY(-1px);
        filter: brightness(1.08);
    }

    .chip:active {
        transform: translateY(0) scale(.985);
    }

    .chip.active {
        color: #111 !important;
        border-color: rgba(255,210,77,.65);
        background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.30), rgba(0,0,0,.18)), linear-gradient(180deg, var(--gold1), var(--gold2));
        box-shadow: 0 0 0 4px rgba(255,210,77,.18), 0 12px 26px rgba(0,0,0,.45);
    }

.btn-clear {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,120,120,.25);
    background: rgba(210,70,70,.20);
    color: #fff;
    font-weight: 950;
    cursor: pointer;
}

    .btn-clear[disabled] {
        opacity: .55;
        pointer-events: none;
    }

/* OPEN vs MINI */
.table-overlay.open {
    opacity: .90;
    transform: translateX(-50%) translateY(0) scale(1);
    filter: none;
}

.table-overlay.mini {
    opacity: .50;
    transform: translateX(-50%) translateY(16px) scale(.60);
    filter: saturate(.9) brightness(.95);
}

    .table-overlay.mini .chipbar {
        display: none;
    }

.table-overlay.mini {
    padding: 8px 8px 6px;
}

.watermark {
    position: absolute;
    right: 12px;
    bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,.55);
    pointer-events: none;
    z-index: 12;
}

@media (max-width:720px) {
    .table-overlay {
        bottom: 10px;
    }

    .last-results {
        top: 10px;
        right: 10px;
    }

    .icon-btn {
        top: 64px;
        right: 10px;
    }

    .vol-pop {
        top: 114px;
        right: 10px;
    }

    .table-overlay.mini {
        transform: translateX(-50%) translateY(18px) scale(.70);
    }
}

/* ===== LOCKED ===== */
.table-overlay.locked {
    opacity: .78;
}

    .table-overlay.locked #betStateText {
        color: rgba(255,210,77,.95);
    }

    .table-overlay.locked .rb-grid {
        pointer-events: auto;
        filter: grayscale(.25) brightness(.95);
    }

    .table-overlay.locked .rb-cell {
        cursor: not-allowed;
    }

/* HIGHLIGHTS */
.rb-cell.grouped {
    filter: brightness(1.16);
    outline: 2px solid var(--hlG-outline);
    box-shadow: 0 0 18px var(--hlG-shadow);
}

.rb-cell.prehover {
    filter: brightness(1.14);
    outline: 2px solid rgba(255,210,77,.28);
    box-shadow: 0 0 18px rgba(255,210,77,.10);
}

.rb-cell.hovered {
    filter: brightness(1.14);
    outline: 2px solid rgba(255,210,77,.25);
}

.rb-cell[data-type="NUMBER"]:hover {
    filter: brightness(1.12);
    outline: 2px solid var(--hlY-outline);
    box-shadow: 0 0 16px var(--hlY-shadow);
}

.rb-cell[data-type="DOZEN"]:hover,
.rb-cell[data-type="COLUMN"]:hover {
    filter: brightness(1.10);
    background: var(--hlY-bg);
    outline: 2px solid var(--hlY-outline);
    box-shadow: 0 0 14px var(--hlY-shadow);
}

/* HOTSPOTS */
.bet-hotspot {
    position: absolute;
    z-index: 35;
    cursor: pointer;
    border-radius: 10px;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    transition: none !important;
}

    .bet-hotspot:hover,
    .bet-hotspot:active,
    .bet-hotspot:focus {
        background: transparent !important;
        outline: none !important;
        box-shadow: none !important;
    }

    .bet-hotspot .cell-chip {
        width: 34px;
        height: 34px;
        font-size: 11px;
    }

.table-overlay.locked .bet-hotspot {
    pointer-events: none;
}

.table-overlay.locked .rb-cell.prehover,
.table-overlay.locked .rb-cell.hovout,
.table-overlay.locked .rb-cell.hovcell,
.table-overlay.locked .rb-cell.hovered {
    filter: none !important;
    outline: none !important;
    box-shadow: none !important;
    transform: none !important;
}

/* =========================================================
   MOBILE PATCH (ONLY <=720px)
   ========================================================= */
@media (max-width: 720px) {

    :root {
        --header-h: 72px;
    }

    .topbar {
        height: var(--header-h);
    }

    .topbar-inner {
        width: 100%;
        padding: 8px 10px;
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 6px 10px;
        align-items: center;
    }

    .brand {
        grid-column: 1 / -1;
        grid-row: 1;
        min-width: 0;
    }

    .brand-title {
        font-size: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-right {
        grid-column: 1 / -1;
        grid-row: 2;
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        flex-wrap: nowrap;
        min-width: 0;
    }

    .pill {
        padding: 6px 10px;
        font-size: 11px;
        white-space: nowrap;
    }

        .pill.gold {
            padding: 6px 10px;
        }

    .stage {
        height: calc(100dvh - var(--header-h));
    }

    .last-results {
        position: fixed;
        top: calc(var(--header-h) + 8px);
        right: 10px;
        z-index: 15;
        pointer-events: none;
    }

    .table-overlay {
        z-index: 40;
    }

    .timer-ring {
        left: 12px;
        bottom: 12px;
        right: auto;
        top: auto;
        transform: none;
        width: 66px;
        height: 66px;
        z-index: 45;
    }

    .timer-text {
        font-size: 26px;
    }

    .table-overlay.mini {
        position: fixed;
        left: 50%;
        bottom: 10px;
        top: auto;
        transform: translateX(-50%);
        width: min(98vw, 820px);
        max-width: 98vw;
        padding: 8px 8px 6px;
        opacity: .55;
    }

        .table-overlay.mini .chipbar {
            display: none;
        }

    .table-wrap {
        padding: 8px;
        overflow: hidden;
    }

    :root {
        --sideW: clamp(38px, 7vw, 52px);
        --cell: clamp(22px, 4.2vh, 34px);
        --gap: 4px;
    }

    .rb-grid {
        gap: var(--gap);
        grid-auto-rows: var(--cell);
    }

    .rb-cell {
        border-radius: 7px;
        font-size: 12px;
    }

        .rb-cell.zero {
            font-size: 15px;
        }

    .chipbar-left {
        flex-wrap: wrap;
    }

    .chip {
        width: 38px;
        height: 38px;
    }

    .btn-clear {
        padding: 9px 12px;
    }

    .table-overlay {
        transition: opacity 220ms ease, filter 220ms ease;
        will-change: opacity, transform;
        transform: translateZ(0);
        backface-visibility: hidden;
    }

    .video-full {
        background: #000;
        overflow: hidden;
    }

    /* ===== MOBILE VIDEO ===== */
    .webrtc-video video,
    .webrtc-video iframe,
    .webrtc-video canvas {
        object-fit: contain !important;
        object-position: 50% 50% !important;
        transform: translateY(var(--ov-mobile-y)) scale(var(--ov-mobile-zoom)) !important;
        transform-origin: 50% 50% !important;
        background: #000 !important;
    }
}

/* PORTRAIT: OPEN = obrót 90° */
@media (max-width: 720px) and (orientation: portrait) {

    .table-overlay.open {
        position: fixed;
        left: 50%;
        top: calc(var(--header-h) + (100dvh - var(--header-h))/2);
        bottom: auto;
        width: calc(100dvh - var(--header-h) - 22px);
        max-width: none;
        transform-origin: center;
        transform: translate(-50%,-50%) rotate(90deg) scale(.90);
    }

    .table-overlay.mini {
        transform: translateX(-50%);
        width: min(98vw, 820px);
    }

    .rb-cell[data-type="COLUMN"] {
        white-space: nowrap;
    }
}

/* Ultra small */
@media (max-width: 380px) {
    :root {
        --sideW: 34px;
        --cell: 20px;
        --gap: 3px;
    }

    .rb-cell {
        font-size: 11px;
    }

        .rb-cell.zero {
            font-size: 14px;
        }

    .chip {
        width: 34px;
        height: 34px;
    }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .table-overlay {
        transition: none !important;
    }
}

@media (max-width: 720px) and (orientation: portrait) {

    .table-overlay.open .rb-cell[data-type="NUMBER"] {
        color: transparent;
    }

        .table-overlay.open .rb-cell[data-type="NUMBER"]::after {
            content: attr(data-value);
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%) rotate(-90deg);
            transform-origin: center;
            color: #fff;
            font-weight: 950;
            letter-spacing: .2px;
            line-height: 1;
            pointer-events: none;
            text-shadow: 0 2px 10px rgba(0,0,0,.55);
        }

    .table-overlay.open .rb-cell.zero[data-type="NUMBER"]::after {
        font-size: 18px;
    }
}

/* =========================================================
   MOBILE PORTRAIT / BETS OPEN
   ========================================================= */
@media (max-width: 720px) and (orientation: portrait) {

    .table-overlay.open .cell-chip {
        z-index: 6;
        transform: translate(-50%,-50%) rotate(-90deg);
        transform-origin: center;
    }

    .table-overlay.open .rb-cell[data-type="NUMBER"]::after {
        z-index: 2;
    }

    .table-overlay.open .rb-cell[data-type="NUMBER"]:has(.cell-chip)::after {
        top: 18%;
        transform: translate(-50%, -50%) rotate(-90deg);
    }

    .table-overlay.open .rb-cell.out:has(.cell-chip),
    .table-overlay.open .rb-cell[data-type="DOZEN"]:has(.cell-chip),
    .table-overlay.open .rb-cell[data-type="COLUMN"]:has(.cell-chip),
    .table-overlay.open .rb-cell[data-type="EVENODD"]:has(.cell-chip),
    .table-overlay.open .rb-cell[data-type="LOWHIGH"]:has(.cell-chip),
    .table-overlay.open .rb-cell[data-type="COLOR"]:has(.cell-chip) {
        place-items: start center;
        padding-top: 6px;
    }

    .table-overlay.open .rb-cell.out:has(.cell-chip),
    .table-overlay.open .rb-cell[data-type="DOZEN"]:has(.cell-chip),
    .table-overlay.open .rb-cell[data-type="COLUMN"]:has(.cell-chip) {
        font-size: 12px;
        line-height: 1;
    }
}

@media (max-width: 720px) and (orientation: portrait) {

    .table-overlay.open .chipbar-label,
    .table-overlay.open .chip span {
        display: inline-block;
        transform: rotate(-90deg);
        transform-origin: center;
    }

    .table-overlay.open .chip span {
        line-height: 1;
    }
}

@media (max-width: 720px) {

    .round-result {
        left: 50%;
        right: auto;
        top: 38%;
        bottom: auto;
        transform: translate(-50%, -50%);
        z-index: 46;
    }

        .round-result .rr-num {
            width: 64px;
            height: 64px;
            border-radius: 18px;
            font-size: 34px;
        }

    .result-badge {
        position: fixed;
        top: auto;
        left: auto;
        right: max(10px, env(safe-area-inset-right));
        bottom: max(10px, env(safe-area-inset-bottom));
        z-index: 9999;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: auto;
        max-width: min(calc(100vw - 20px), 280px);
        min-height: 44px;
        padding: 10px 14px;
        font-size: clamp(12px, 3.4vw, 15px);
        line-height: 1.2;
        text-align: center;
        white-space: normal;
        word-break: keep-all;
        overflow-wrap: anywhere;
        box-sizing: border-box;
    }
}

/* ===== LOADER FULLSCREEN ===== */
.app-loader {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    z-index: 99999;
    opacity: 1;
    transition: opacity .55s ease;
}

    .app-loader.is-hidden {
        opacity: 0;
        pointer-events: none;
    }

    .app-loader .loader-bg {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        transform: scale(1.03);
        filter: brightness(.95);
        pointer-events: none;
    }

    .app-loader::before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,.25);
    }

    .app-loader .loader-card {
        position: relative;
        z-index: 1;
        height: 100%;
        width: 100%;
        display: grid;
        place-items: center;
        gap: 10px;
        text-align: center;
        padding: calc(env(safe-area-inset-top) + 18px) 16px calc(env(safe-area-inset-bottom) + 18px);
        transition: transform .55s ease, opacity .55s ease;
    }

    .app-loader.is-hidden .loader-card {
        opacity: 0;
        transform: translateY(8px);
    }

.loader-img {
    width: min(320px, 80vw);
    height: auto;
    border-radius: 16px;
    animation: logoPulse 1.6s ease-in-out infinite;
    will-change: transform, filter, opacity;
}

.loader-copy {
    display: grid;
    gap: 10px;
    justify-items: center;
    width: min(640px, 86vw);
}

.loader-title {
    color: #fff;
    font-size: clamp(22px, 2.2vw, 30px);
    font-weight: 500;
    letter-spacing: .01em;
    text-transform: none;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .45);
}

.loader-sub {
    color: rgba(255,255,255,.92);
    font-size: clamp(14px, 1.2vw, 17px);
    line-height: 1.55;
    font-weight: 400;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
    max-width: 54ch;
}

.loader-hint {
    color: rgba(255,255,255,.68);
    font-size: 12px;
    line-height: 1.55;
    max-width: 58ch;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}

.app-loader[data-mode="loading"] .loader-title {
    letter-spacing: .02em;
}

.app-loader[data-mode="disconnect"] .loader-title,
.app-loader[data-mode="error"] .loader-title {
    color: rgba(255,255,255,.96);
}

@keyframes logoPulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(.85);
        opacity: .85;
    }

    50% {
        transform: scale(1.03);
        filter: brightness(1.20);
        opacity: 1;
    }
}

/* Quality icon (SVG) */
.quality-btn .quality-ic {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .95;
}

.quality-btn.is-auto .quality-badge {
    color: rgba(255,255,255,.82);
}

/* Volume icon (SVG) */
.vol-btn .vol-ic {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.vol-btn.is-muted .vol-ic--on {
    display: none;
}

.vol-btn:not(.is-muted) .vol-ic--muted {
    display: none;
}

/* === QUALITY / VOLUME MOBILE LAYOUT === */
@media (max-width: 720px) {
    .vol-btn,
    .quality-btn {
        position: fixed;
        right: 12px;
        left: auto;
        bottom: auto;
        z-index: 60;
    }

    .vol-btn {
        top: calc(var(--header-h, 72px) + 64px);
    }

    .quality-btn {
        top: calc(var(--header-h, 72px) + 116px);
        padding: 0 10px;
        min-width: 44px;
    }

    .quality-badge {
        font-size: 11px;
    }

    .quality-pop {
        position: fixed;
        top: calc(var(--header-h, 72px) + 168px);
        right: 12px;
        bottom: auto;
        left: auto;
        min-width: 190px;
        max-width: min(220px, calc(100vw - 24px));
        padding: 10px;
        z-index: 61;
    }

    .quality-pop-title,
    .quality-note {
        font-size: 11px;
    }

    .quality-option {
        padding: 10px 11px;
    }

        .quality-option span {
            font-size: 12px;
        }

        .quality-option small {
            font-size: 10px;
        }

    .vol-pop {
        display: none !important;
    }
}

/* === Desktop: lower results / volume / quality a bit === */
@media (min-width: 721px) {
    .last-results {
        top: 60px;
    }

    .vol-btn {
        top: 110px;
    }

    .quality-btn {
        top: 110px;
    }

    .vol-pop {
        top: 160px;
    }

    .quality-pop {
        top: 160px;
    }
}

/* === WebRTC hard autoplay / no direct interaction === */
.webrtc-video,
.webrtc-video video,
.webrtc-video iframe,
.webrtc-video canvas {
    pointer-events: none !important;
}

.stream-shield {
    position: absolute;
    inset: 0;
    z-index: 9;
    background: transparent;
    pointer-events: auto;
}

.icon-btn,
.quality-pop,
.vol-pop,
.timer-ring,
.round-result,
.result-badge,
.last-results,
.table-overlay,
.app-loader {
    z-index: 20;
}


/* =========================================================
   WHEEL THEME OVERRIDE
   - vertical side panel
   - same roulette rules / same betting sectors
   - sharper, more angular sectors
   ========================================================= */
body.theme-wheel {
    --feltA: rgba(27, 24, 70, .96);
    --feltB: rgba(9, 14, 30, .98);
    --chipA: #8cf7ff;
    --chipB: #6d9eff;
    --gold1: #9af6ff;
    --gold2: #5f8dff;
    --hlY-outline: rgba(115, 227, 255, .42);
    --hlY-bg: rgba(115, 227, 255, .12);
    --hlY-shadow: rgba(115, 227, 255, .12);
    --hlG-outline: rgba(255, 116, 186, .34);
    --hlG-shadow: rgba(255, 116, 186, .18);
    background:
        radial-gradient(circle at 20% 20%, rgba(86, 108, 255, .18), transparent 28%),
        radial-gradient(circle at 80% 15%, rgba(0, 226, 255, .10), transparent 22%),
        linear-gradient(180deg, #030610 0%, #050913 100%);
}

body.theme-wheel .timer-progress {
    stroke: #66e7ff;
}

body.theme-wheel .last-results,
body.theme-wheel .quality-pop,
body.theme-wheel .vol-pop,
body.theme-wheel .icon-btn,
body.theme-wheel .result-badge {
    background: rgba(9, 14, 30, .62);
    border-color: rgba(119, 138, 255, .18);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .20);
}

body.theme-wheel .quality-option {
    background: rgba(255,255,255,.045);
    border-color: rgba(119,138,255,.14);
}

body.theme-wheel .quality-option.is-active,
body.theme-wheel .quality-option[aria-selected="true"] {
    background: rgba(115, 227, 255, .14);
    border-color: rgba(115, 227, 255, .22);
}

body.theme-wheel .lr.red {
    background: linear-gradient(180deg, #d23558 0%, #7f162c 100%);
}

body.theme-wheel .lr.black {
    background: linear-gradient(180deg, #1f2937 0%, #05070d 100%);
}

body.theme-wheel .lr.green {
    background: linear-gradient(180deg, #11a779 0%, #0b6147 100%);
}

body.theme-wheel .table-overlay {
    left: auto;
    right: 18px;
    top: 50%;
    bottom: auto;
    width: min(440px, 34vw);
    max-height: calc(100dvh - 36px);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(18, 24, 44, .88) 0%, rgba(7, 10, 22, .94) 100%);
    border: 1px solid rgba(123, 140, 255, .24);
    box-shadow: 0 26px 80px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.05);
    backdrop-filter: blur(18px) saturate(1.12);
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateY(-50%);
    transform-origin: center right;
}

body.theme-wheel .table-overlay::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, #5f8dff 0%, #66e7ff 52%, #ff73c0 100%);
    opacity: .95;
}

body.theme-wheel .table-overlay::after {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.04);
    pointer-events: none;
}

body.theme-wheel .table-title {
    position: relative;
    z-index: 1;
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(95,141,255,.14) 0%, rgba(102,231,255,.07) 100%);
    border: 1px solid rgba(115, 227, 255, .12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

body.theme-wheel .tt-left {
    font-size: 14px;
    letter-spacing: .14em;
    color: #eef5ff;
}

body.theme-wheel #betStateText {
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(102, 231, 255, .92);
}

body.theme-wheel .table-wrap {
    padding: 12px;
    border-radius: 18px;
    background:
        radial-gradient(circle at 50% -10%, rgba(255,255,255,.08), transparent 40%),
        linear-gradient(180deg, rgba(27, 24, 70, .98), rgba(9, 14, 30, .98));
    border: 1px solid rgba(115, 227, 255, .18);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.03), 0 10px 24px rgba(0,0,0,.24);
}

body.theme-wheel .rb-grid {
    grid-template-columns: 52px repeat(12, minmax(0, 1fr)) 52px;
    grid-auto-rows: clamp(28px, 2.2vw, 40px);
    gap: 6px;
}

body.theme-wheel .rb-cell {
    border-radius: 4px;
    clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
    border: 1px solid rgba(164, 179, 255, .24);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.02), inset 0 -10px 16px rgba(0,0,0,.20);
    text-transform: uppercase;
}

body.theme-wheel .rb-cell:hover {
    filter: brightness(1.07);
}

body.theme-wheel .rb-cell.num.red {
    background: linear-gradient(180deg, #cf3d63 0%, #7f1733 100%);
}

body.theme-wheel .rb-cell.num.black {
    background: linear-gradient(180deg, #222b3a 0%, #0a0d15 100%);
}

body.theme-wheel .rb-cell.zero {
    background: linear-gradient(180deg, #19b98c 0%, #0b6a4d 100%);
    border-color: rgba(102, 231, 255, .34);
}

body.theme-wheel .rb-cell.out {
    background: linear-gradient(180deg, rgba(22, 31, 56, .96) 0%, rgba(11, 16, 31, .96) 100%);
    border-color: rgba(115, 227, 255, .12);
    color: #eef5ff;
    font-size: 12px;
}

body.theme-wheel .rb-cell.out.big {
    font-size: 12px;
}

body.theme-wheel .rb-cell.diamond::before {
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.08);
}

body.theme-wheel .rb-cell.selected {
    box-shadow: inset 0 0 0 3px rgba(102, 231, 255, .78), 0 0 18px rgba(102, 231, 255, .20);
}

body.theme-wheel .rb-cell.grouped {
    outline: 2px solid rgba(255, 115, 192, .34);
    box-shadow: 0 0 16px rgba(255, 115, 192, .14);
}

body.theme-wheel .rb-cell.prehover,
body.theme-wheel .rb-cell.hovered,
body.theme-wheel .rb-cell[data-type="NUMBER"]:hover,
body.theme-wheel .rb-cell[data-type="DOZEN"]:hover,
body.theme-wheel .rb-cell[data-type="COLUMN"]:hover {
    outline-color: rgba(102, 231, 255, .35);
    box-shadow: 0 0 16px rgba(102, 231, 255, .14);
}

body.theme-wheel .cell-chip {
    width: 34px;
    height: 34px;
    font-size: 11px;
    background:
        radial-gradient(circle at 35% 28%, rgba(255,255,255,.62), rgba(255,255,255,0) 38%),
        radial-gradient(circle at 50% 65%, rgba(0,0,0,.22), rgba(0,0,0,0) 52%),
        linear-gradient(180deg, #9af6ff 0%, #5f8dff 100%);
    border-color: rgba(255,255,255,.28);
    color: #071018;
}

body.theme-wheel .chipbar {
    margin-top: 0;
    padding: 12px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(15, 21, 39, .94), rgba(9, 12, 24, .94));
    border: 1px solid rgba(115, 227, 255, .12);
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: start;
}

body.theme-wheel .chipbar-left {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

body.theme-wheel .chipbar-label,
body.theme-wheel .btn-clear {
    grid-column: 1 / -1;
}

body.theme-wheel .chipbar-label {
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255,255,255,.62);
}

body.theme-wheel .chipbar-right {
    font-size: 11px;
    text-align: left;
    color: rgba(255,255,255,.65);
}

body.theme-wheel .chip {
    width: 100%;
    height: 46px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.16);
    background: linear-gradient(180deg, rgba(31, 43, 73, .92) 0%, rgba(14, 18, 33, .96) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 12px 18px rgba(0,0,0,.18);
}

body.theme-wheel .chip::after {
    inset: 6px;
    border-radius: 10px;
    border: 1px dashed rgba(255,255,255,.12);
}

body.theme-wheel .chip.active {
    color: #071018 !important;
    border-color: rgba(102, 231, 255, .45);
    background: linear-gradient(180deg, #9af6ff 0%, #5f8dff 100%);
    box-shadow: 0 0 0 4px rgba(102,231,255,.12), 0 12px 26px rgba(0,0,0,.28);
}

body.theme-wheel .btn-clear {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,115,162,.22);
    background: linear-gradient(180deg, rgba(188, 54, 95, .30) 0%, rgba(110, 16, 39, .26) 100%);
}

body.theme-wheel .table-overlay.open {
    opacity: .97;
    transform: translateY(-50%) scale(1);
}

body.theme-wheel .table-overlay.mini {
    opacity: .82;
    transform: translateY(-50%) scale(.94);
    filter: saturate(1) brightness(.96);
}

body.theme-wheel .table-overlay.mini .chipbar {
    display: grid;
    opacity: .85;
}

body.theme-wheel .table-overlay.locked {
    opacity: .88;
}

body.theme-wheel .table-overlay.locked #betStateText {
    color: rgba(255, 191, 96, .95);
}

@media (max-width: 1180px) {
    body.theme-wheel .table-overlay {
        width: min(400px, calc(100vw - 20px));
        right: 10px;
    }
}

@media (max-width: 900px) {
    body.theme-wheel .table-overlay {
        top: auto;
        bottom: 10px;
        right: 10px;
        width: min(390px, calc(100vw - 20px));
        max-height: min(68dvh, 720px);
        transform: none;
    }

    body.theme-wheel .table-overlay.open {
        transform: none;
    }

    body.theme-wheel .table-overlay.mini {
        transform: none scale(.96);
        transform-origin: bottom right;
    }
}

@media (max-width: 720px) {
    body.theme-wheel .table-overlay {
        width: calc(100vw - 20px);
        padding: 10px;
        border-radius: 18px;
        max-height: 72dvh;
    }

    body.theme-wheel .table-title,
    body.theme-wheel .table-wrap,
    body.theme-wheel .chipbar {
        border-radius: 14px;
    }

    body.theme-wheel .rb-grid {
        grid-template-columns: 44px repeat(12, minmax(0, 1fr)) 44px;
        grid-auto-rows: 28px;
    }

    body.theme-wheel .rb-cell {
        font-size: 11px;
    }

    body.theme-wheel .rb-cell.zero {
        font-size: 15px;
    }

    body.theme-wheel .chipbar-left {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.theme-wheel .chip {
        height: 42px;
    }

    body.theme-wheel .cell-chip {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }
}


/* =========================================================
   WHEEL THEME OVERRIDE v2
   - video on the left, control panel on the right
   - last results + sound + quality inside the panel
   - sharper geometry, no rounded corners
   - stake buttons smaller, number cells clearer
   ========================================================= */
body.theme-wheel {
    --wheel-panel-w: clamp(560px, 42vw, 620px);
}

body.theme-wheel .stage {
    height: 100dvh;
    padding: 18px;
}

body.theme-wheel .video-full {
    position: absolute;
    left: 18px;
    top: 18px;
    bottom: 18px;
    right: calc(var(--wheel-panel-w) + 36px);
    border: 1px solid rgba(123, 140, 255, .22);
    box-shadow: 0 20px 50px rgba(0,0,0,.36);
}

body.theme-wheel .webrtc-video,
body.theme-wheel .webrtc-video > div,
body.theme-wheel .webrtc-video > video {
    border-radius: 0;
}

body.theme-wheel .timer-ring,
body.theme-wheel .round-result {
    bottom: 28px;
}

body.theme-wheel .table-overlay {
    width: var(--wheel-panel-w);
    max-height: calc(100dvh - 36px);
    padding: 12px;
    gap: 12px;
    border-radius: 0;
    top: 18px;
    bottom: 18px;
    right: 18px;
    left: auto;
    transform: none;
    transform-origin: center right;
}

body.theme-wheel .table-overlay::before,
body.theme-wheel .table-overlay::after {
    border-radius: 0;
}

body.theme-wheel .table-title,
body.theme-wheel .table-wrap,
body.theme-wheel .chipbar,
body.theme-wheel .last-results,
body.theme-wheel .panel-btn,
body.theme-wheel .quality-pop,
body.theme-wheel .vol-pop,
body.theme-wheel .quality-option,
body.theme-wheel .btn-clear,
body.theme-wheel .cell-chip,
body.theme-wheel .result-badge {
    border-radius: 0 !important;
}

body.theme-wheel .table-title {
    padding: 10px 12px;
}

body.theme-wheel .panel-utility {
    display: grid;
    gap: 10px;
}

body.theme-wheel .panel-results {
    position: relative;
    inset: auto;
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: linear-gradient(180deg, rgba(13, 18, 34, .92), rgba(7, 10, 22, .96));
    border: 1px solid rgba(115, 227, 255, .12);
    box-shadow: none;
    backdrop-filter: none;
}

body.theme-wheel .panel-results .lr-title {
    white-space: nowrap;
    font-size: 11px;
    letter-spacing: .16em;
}

body.theme-wheel .panel-results .lr-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

body.theme-wheel .panel-controls {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    gap: 10px;
}

body.theme-wheel .control-group {
    position: relative;
    min-width: 0;
}

body.theme-wheel .panel-btn {
    position: relative;
    inset: auto;
    top: auto;
    right: auto;
    width: 100%;
    min-width: 0;
    height: 46px;
    display: grid;
    grid-template-columns: 18px 1fr auto;
    align-items: center;
    justify-items: start;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid rgba(115, 227, 255, .14);
    background: linear-gradient(180deg, rgba(17, 25, 46, .95), rgba(10, 13, 25, .98));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 10px 18px rgba(0,0,0,.14);
}

body.theme-wheel .panel-btn .quality-ic,
body.theme-wheel .panel-btn .vol-ic {
    width: 18px;
    height: 18px;
}

body.theme-wheel .panel-btn-text {
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .12em;
    color: #eef5ff;
}

body.theme-wheel .quality-badge {
    font-size: 11px;
    font-weight: 800;
}

body.theme-wheel .quality-pop,
body.theme-wheel .vol-pop {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: 0;
    z-index: 30;
    border: 1px solid rgba(115, 227, 255, .16);
}

body.theme-wheel .quality-pop {
    padding: 10px;
}

body.theme-wheel .vol-pop {
    padding: 10px 12px;
}

body.theme-wheel .vol-pop input[type="range"] {
    width: 100%;
}

body.theme-wheel .table-wrap {
    padding: 10px;
}

body.theme-wheel .rb-grid {
    grid-template-columns: 46px repeat(12, minmax(0, 1fr)) 46px;
    grid-auto-rows: clamp(30px, 2vw, 38px);
    gap: 4px;
}

body.theme-wheel .rb-cell {
    border-radius: 0;
    clip-path: none;
    font-size: 12px;
    border: 1px solid rgba(164, 179, 255, .22);
}

body.theme-wheel .rb-cell.zero {
    font-size: 16px;
}

body.theme-wheel .rb-cell.out,
body.theme-wheel .rb-cell.out.big {
    font-size: 11px;
}

body.theme-wheel .rb-cell.diamond::before {
    width: 18px;
    height: 18px;
    border-radius: 0;
}

body.theme-wheel .cell-chip {
    width: 30px;
    height: 30px;
    font-size: 10px;
}

body.theme-wheel .chipbar {
    padding: 10px 12px;
    gap: 8px;
}

body.theme-wheel .chipbar-left {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

body.theme-wheel .chipbar-label,
body.theme-wheel .chipbar-right,
body.theme-wheel .btn-clear {
    grid-column: 1 / -1;
}

body.theme-wheel .chipbar-right {
    font-size: 11px;
}

body.theme-wheel .chip {
    height: 38px;
    font-size: 13px;
    border-radius: 0;
}

body.theme-wheel .chip::after {
    border-radius: 0;
}

body.theme-wheel .btn-clear {
    height: 38px;
    padding: 8px 12px;
}

body.theme-wheel .table-overlay.open {
    transform: none;
}

body.theme-wheel .table-overlay.mini {
    transform: none scale(.98);
}

@media (max-width: 1440px) {
    body.theme-wheel {
        --wheel-panel-w: clamp(520px, 44vw, 580px);
    }
}

@media (max-width: 1180px) {
    body.theme-wheel {
        --wheel-panel-w: min(100%, 560px);
    }

    body.theme-wheel .stage {
        padding: 10px;
    }

    body.theme-wheel .video-full {
        right: 10px;
        bottom: calc(min(100%, 560px) + 20px);
        top: 10px;
        left: 10px;
    }

    body.theme-wheel .table-overlay {
        top: auto;
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
        max-height: min(48dvh, 480px);
    }
}

@media (max-width: 900px) {
    body.theme-wheel .panel-controls {
        grid-template-columns: 1fr;
    }

    body.theme-wheel .rb-grid {
        grid-template-columns: 40px repeat(12, minmax(0, 1fr)) 40px;
        grid-auto-rows: 28px;
    }

    body.theme-wheel .rb-cell {
        font-size: 10px;
    }

    body.theme-wheel .rb-cell.zero {
        font-size: 14px;
    }

    body.theme-wheel .chipbar-left {
        grid-template-columns: repeat(3, minmax(0,1fr));
    }
}

@media (max-width: 720px) {
    body.theme-wheel .video-full {
        bottom: 52dvh;
    }

    body.theme-wheel .table-overlay {
        max-height: 50dvh;
        padding: 8px;
    }

    body.theme-wheel .panel-results {
        grid-template-columns: 1fr;
    }

    body.theme-wheel .chipbar-left {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    body.theme-wheel .chip,
    body.theme-wheel .btn-clear,
    body.theme-wheel .panel-btn {
        height: 36px;
    }
}


/* =========================================================
   WHEEL THEME OVERRIDE v3
   - force controls/results into right panel
   - much smaller stake buttons
   ========================================================= */
body.theme-wheel #roulettePanel {
    z-index: 40;
}

body.theme-wheel .video-full {
    z-index: 10;
}

body.theme-wheel .panel-results {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    inset: auto !important;
    margin: 0 !important;
    width: 100% !important;
}

body.theme-wheel #qualityBtn,
body.theme-wheel #volBtn {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    inset: auto !important;
    margin: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
}

body.theme-wheel #qualityPop,
body.theme-wheel #volPop {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    margin: 0 !important;
}

body.theme-wheel .panel-controls {
    align-items: start;
}

body.theme-wheel .chipbar {
    padding: 8px 10px;
    gap: 6px;
}

body.theme-wheel .chipbar-left {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
}

body.theme-wheel .chip {
    height: 30px;
    min-height: 30px;
    padding: 0 4px;
    font-size: 11px;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 8px 14px rgba(0,0,0,.10);
}

body.theme-wheel .chip span {
    font-size: 11px;
    line-height: 1;
}

body.theme-wheel .chip::after {
    inset: 4px;
}

body.theme-wheel .btn-clear {
    height: 30px;
    min-height: 30px;
    padding: 6px 10px;
    font-size: 11px;
}

body.theme-wheel .chipbar-label {
    font-size: 10px;
    letter-spacing: .12em;
}

body.theme-wheel .chipbar-right {
    font-size: 10px;
}

@media (max-width: 1180px) {
    body.theme-wheel .chipbar-left {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    body.theme-wheel .chipbar-left {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.theme-wheel .chip,
    body.theme-wheel .btn-clear {
        height: 28px;
        min-height: 28px;
        font-size: 10px;
    }
}


/* =========================================================
   WHEEL THEME OVERRIDE v4
   - keep panel fully inside viewport
   - safer desktop sizing
   ========================================================= */
body.theme-wheel {
    --wheel-gap: 18px;
    --wheel-panel-w: clamp(380px, 30vw, 500px);
    --wheel-panel-real-w: min(var(--wheel-panel-w), calc(100vw - (var(--wheel-gap) * 2)));
}

body.theme-wheel .stage {
    padding: var(--wheel-gap);
}

body.theme-wheel .video-full {
    left: var(--wheel-gap);
    top: var(--wheel-gap);
    bottom: var(--wheel-gap);
    right: calc(var(--wheel-panel-real-w) + (var(--wheel-gap) * 2));
}

body.theme-wheel .table-overlay {
    width: var(--wheel-panel-real-w);
    max-width: calc(100vw - (var(--wheel-gap) * 2));
    left: auto;
    right: var(--wheel-gap);
    top: var(--wheel-gap);
    bottom: var(--wheel-gap);
    max-height: calc(100dvh - (var(--wheel-gap) * 2));
    overflow-x: hidden;
    box-sizing: border-box;
}

@media (max-width: 1600px) {
    body.theme-wheel {
        --wheel-panel-w: clamp(360px, 31vw, 470px);
    }
}

@media (max-width: 1400px) {
    body.theme-wheel {
        --wheel-panel-w: clamp(350px, 32vw, 440px);
    }

    body.theme-wheel .rb-grid {
        grid-template-columns: 42px repeat(12, minmax(0, 1fr)) 42px;
        grid-auto-rows: clamp(28px, 1.8vw, 34px);
    }

    body.theme-wheel .rb-cell {
        font-size: 11px;
    }

    body.theme-wheel .rb-cell.zero {
        font-size: 15px;
    }
}

@media (max-width: 1280px) {
    body.theme-wheel {
        --wheel-gap: 10px;
        --wheel-panel-w: clamp(340px, 34vw, 410px);
    }

    body.theme-wheel .video-full {
        right: calc(var(--wheel-panel-real-w) + (var(--wheel-gap) * 2));
    }

    body.theme-wheel .table-overlay {
        padding: 10px;
    }

    body.theme-wheel .panel-controls {
        grid-template-columns: 1fr;
    }

    body.theme-wheel .rb-grid {
        grid-template-columns: 38px repeat(12, minmax(0, 1fr)) 38px;
        grid-auto-rows: 26px;
        gap: 3px;
    }

    body.theme-wheel .rb-cell {
        font-size: 10px;
    }

    body.theme-wheel .rb-cell.out,
    body.theme-wheel .rb-cell.out.big {
        font-size: 10px;
    }

    body.theme-wheel .chipbar-left {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    body.theme-wheel .video-full {
        right: var(--wheel-gap);
        bottom: min(52dvh, 430px);
    }

    body.theme-wheel .table-overlay {
        width: auto;
        max-width: none;
        left: var(--wheel-gap);
        right: var(--wheel-gap);
        top: auto;
        bottom: var(--wheel-gap);
        max-height: min(46dvh, 420px);
    }
}

@media (max-width: 720px) {
    body.theme-wheel {
        --wheel-gap: 8px;
    }

    body.theme-wheel .video-full {
        left: var(--wheel-gap);
        right: var(--wheel-gap);
        top: var(--wheel-gap);
        bottom: 50dvh;
    }

    body.theme-wheel .table-overlay {
        left: var(--wheel-gap);
        right: var(--wheel-gap);
        bottom: var(--wheel-gap);
        max-height: 48dvh;
    }
}


/* =========================================================
   WHEEL THEME OVERRIDE v5
   - desktop 16:9 tuning
   - panel vertically centered instead of stuck to top
   - responsive across common 16:9 resolutions
   ========================================================= */
body.theme-wheel {
    --wheel-gap: 18px;
    --wheel-panel-w: clamp(360px, 27vw, 460px);
    --wheel-panel-real-w: min(var(--wheel-panel-w), calc(100vw - (var(--wheel-gap) * 2)));
}

body.theme-wheel .video-full {
    right: calc(var(--wheel-panel-real-w) + (var(--wheel-gap) * 2));
}

body.theme-wheel .table-overlay {
    width: var(--wheel-panel-real-w);
    max-width: calc(100vw - (var(--wheel-gap) * 2));
    left: auto;
    right: var(--wheel-gap);
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    max-height: min(780px, calc(100dvh - 72px));
    overflow-x: hidden;
    overflow-y: auto;
}

body.theme-wheel .table-overlay.open {
    transform: translateY(-50%) !important;
}

body.theme-wheel .table-overlay.mini {
    transform: translateY(-50%) scale(.98) !important;
    transform-origin: center right;
}

@media (max-height: 980px) {
    body.theme-wheel .table-overlay {
        max-height: calc(100dvh - 56px);
    }
}

@media (max-width: 1920px) {
    body.theme-wheel {
        --wheel-panel-w: clamp(350px, 27vw, 440px);
    }
}

@media (max-width: 1600px) {
    body.theme-wheel {
        --wheel-panel-w: clamp(340px, 28vw, 420px);
    }
}

@media (max-width: 1440px) {
    body.theme-wheel {
        --wheel-gap: 14px;
        --wheel-panel-w: clamp(330px, 29vw, 400px);
    }

    body.theme-wheel .table-overlay {
        max-height: calc(100dvh - 48px);
    }
}

@media (max-width: 1366px) {
    body.theme-wheel {
        --wheel-gap: 12px;
        --wheel-panel-w: clamp(320px, 30vw, 380px);
    }

    body.theme-wheel .rb-grid {
        grid-template-columns: 36px repeat(12, minmax(0, 1fr)) 36px;
        grid-auto-rows: 25px;
        gap: 3px;
    }

    body.theme-wheel .rb-cell {
        font-size: 9.5px;
    }

    body.theme-wheel .rb-cell.zero {
        font-size: 14px;
    }

    body.theme-wheel .rb-cell.out,
    body.theme-wheel .rb-cell.out.big {
        font-size: 9.5px;
    }

    body.theme-wheel .table-wrap,
    body.theme-wheel .chipbar,
    body.theme-wheel .table-title {
        padding-left: 8px;
        padding-right: 8px;
    }
}

@media (max-width: 1280px) {
    body.theme-wheel {
        --wheel-gap: 10px;
        --wheel-panel-w: clamp(310px, 31vw, 360px);
    }

    body.theme-wheel .table-overlay {
        max-height: calc(100dvh - 40px);
    }

    body.theme-wheel .panel-controls {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1180px) {
    body.theme-wheel .video-full {
        right: var(--wheel-gap);
        bottom: min(52dvh, 430px);
    }

    body.theme-wheel .table-overlay,
    body.theme-wheel .table-overlay.open,
    body.theme-wheel .table-overlay.mini {
        width: auto;
        max-width: none;
        left: var(--wheel-gap);
        right: var(--wheel-gap);
        top: auto;
        bottom: var(--wheel-gap);
        transform: none !important;
        max-height: min(46dvh, 420px);
    }
}

@media (max-width: 720px) {
    body.theme-wheel {
        --wheel-gap: 8px;
    }

    body.theme-wheel .video-full {
        left: var(--wheel-gap);
        right: var(--wheel-gap);
        top: var(--wheel-gap);
        bottom: 50dvh;
    }

    body.theme-wheel .table-overlay,
    body.theme-wheel .table-overlay.open,
    body.theme-wheel .table-overlay.mini {
        left: var(--wheel-gap);
        right: var(--wheel-gap);
        bottom: var(--wheel-gap);
        max-height: 48dvh;
        transform: none !important;
    }
}

/* =========================================================
   WHEEL MOBILE BET PANEL PATCH
   - większy panel na mobile
   - bez animacji/ruchu panelu
   - LED bar działa na desktop + mobile
   ========================================================= */

/* LED na desktopie i mobile */
body.theme-wheel .table-overlay::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;

    width: 42%;
    height: 4px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(102, 231, 255, .28),
        rgba(102, 231, 255, .95),
        rgba(255, 115, 192, .65),
        transparent
    );

    box-shadow:
        0 0 12px rgba(102, 231, 255, .55),
        0 0 22px rgba(255, 115, 192, .25);

    transform: translateX(-120%);
    animation: wheelLedMove 5.5s linear infinite !important;

    pointer-events: none;
    z-index: 2;
}

@keyframes wheelLedMove {
    from {
        transform: translateX(-120%);
    }

    to {
        transform: translateX(260%);
    }
}

/* Nie ruszamy panelu animacją */
body.theme-wheel .table-overlay {
    transition: none !important;
    animation: none !important;
}

/* Na mobile panel większy, ale bez przebudowy całego layoutu */
@media (max-width: 720px) {
    body.theme-wheel .table-overlay,
    body.theme-wheel .table-overlay.open,
    body.theme-wheel .table-overlay.mini {
        max-height: 58dvh !important;
        min-height: 50dvh !important;

        left: 8px !important;
        right: 8px !important;
        bottom: 8px !important;

        padding: 10px !important;

        transform: none !important;
        transition: none !important;
        animation: none !important;

        opacity: .98 !important;
        filter: none !important;

        overflow-y: auto !important;
        overscroll-behavior: contain;
    }

    body.theme-wheel .video-full {
        bottom: 60dvh !important;
    }

    body.theme-wheel .table-overlay::before {
        height: 5px;
        animation: wheelLedMove 5.5s linear infinite !important;
    }

    body.theme-wheel .panel-controls {
        grid-template-columns: 1fr !important;
    }

    body.theme-wheel .panel-results {
        grid-template-columns: 1fr !important;
    }

    body.theme-wheel .chipbar-left {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    body.theme-wheel .chip,
    body.theme-wheel .btn-clear {
        height: 42px !important;
        min-height: 42px !important;
        font-size: 13px !important;
    }

    body.theme-wheel .chip span {
        font-size: 13px !important;
    }

    body.theme-wheel #qualityBtn,
    body.theme-wheel #volBtn,
    body.theme-wheel .panel-btn {
        height: 46px !important;
    }
}

/* =========================================================
   WHEEL MOBILE BIG PANEL + FULL RGB LED BAR
   wklej NA SAMYM KOŃCU CSS
   ========================================================= */

/* LED jako pełny pasek RGB na desktop + mobile */
body.theme-wheel .table-overlay::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;

    width: 100% !important;
    height: 5px !important;

    background: linear-gradient(
        90deg,
        #66e7ff,
        #5f8dff,
        #ff73c0,
        #9af6ff,
        #66e7ff
    );

    background-size: 300% 100%;
    animation: wheelRgbLedFlow 10s linear infinite !important;

    box-shadow:
        0 0 10px rgba(102, 231, 255, .45),
        0 0 22px rgba(255, 115, 192, .25);

    transform: none !important;
    pointer-events: none;
    z-index: 5;
}

/* powolne przechodzenie kolorów, bez przesuwania kreski */
@keyframes wheelRgbLedFlow {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 300% 50%;
    }
}

/* panel bez animacji */
body.theme-wheel .table-overlay,
body.theme-wheel .table-overlay.open,
body.theme-wheel .table-overlay.mini {
    transition: none !important;
}

/* =========================================================
   MOBILE: mniejsze wideo, większy panel obstawiania
   ========================================================= */

/* =========================================================
   WHEEL RESPONSIVE HEIGHT PATCH
   - telefon: panel trochę niżej
   - tablet: panel wyżej / większy
   ========================================================= */

/* TELEFON */
@media (max-width: 720px) {
    body.theme-wheel .video-full {
        left: 8px !important;
        right: 8px !important;
        top: 8px !important;

        /* wideo trochę większe niż wcześniej */
        bottom: 64dvh !important;
        height: auto !important;
    }

    body.theme-wheel .table-overlay,
    body.theme-wheel .table-overlay.open,
    body.theme-wheel .table-overlay.mini {
        left: 8px !important;
        right: 8px !important;

        /* panel niżej na telefonie */
        top: 37dvh !important;
        bottom: 8px !important;

        width: auto !important;
        max-width: none !important;

        transform: none !important;
        max-height: none !important;
        height: auto !important;

        overflow-y: auto !important;
    }
}

/* MAŁY TELEFON */
@media (max-width: 420px) {
    body.theme-wheel .video-full {
        bottom: 66dvh !important;
    }

    body.theme-wheel .table-overlay,
    body.theme-wheel .table-overlay.open,
    body.theme-wheel .table-overlay.mini {
        top: 35dvh !important;
    }
}

/* TABLET / WIĘKSZY MOBILE */
@media (min-width: 721px) and (max-width: 1180px) {
    body.theme-wheel .video-full {
        left: 10px !important;
        right: 10px !important;
        top: 10px !important;

        /* mniejsze wideo, więcej panelu */
        bottom: 58dvh !important;
        height: auto !important;
    }

    body.theme-wheel .table-overlay,
    body.theme-wheel .table-overlay.open,
    body.theme-wheel .table-overlay.mini {
        left: 10px !important;
        right: 10px !important;

        /* panel wyżej na tablecie */
        top: 44dvh !important;
        bottom: 10px !important;

        width: auto !important;
        max-width: none !important;

        transform: none !important;
        max-height: none !important;
        height: auto !important;

        overflow-y: auto !important;
    }
}


/* =========================================================
   COSMIC IFRAME / WEBRTC LAYOUT THEME
   dodane przez ChatGPT — wygląd kosmiczny bez zmiany logiki JS
   ========================================================= */
body.theme-wheel {
    --cosmic-bg-0: #02030a;
    --cosmic-bg-1: #07112b;
    --cosmic-bg-2: #160b38;
    --cosmic-cyan: #58f7ff;
    --cosmic-blue: #6b7cff;
    --cosmic-pink: #ff4fd8;
    --cosmic-gold: #ffe08a;
    --cosmic-glass: rgba(10, 18, 42, .66);
    --cosmic-border: rgba(120, 235, 255, .34);
    --cosmic-shadow: rgba(88, 247, 255, .22);
    color-scheme: dark;
    background:
        radial-gradient(circle at 16% 12%, rgba(88, 247, 255, .18) 0, transparent 27%),
        radial-gradient(circle at 82% 22%, rgba(255, 79, 216, .18) 0, transparent 28%),
        radial-gradient(circle at 52% 88%, rgba(107, 124, 255, .17) 0, transparent 32%),
        linear-gradient(135deg, var(--cosmic-bg-0), var(--cosmic-bg-1) 46%, var(--cosmic-bg-2));
}

body.theme-wheel::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: .78;
    background-image:
        radial-gradient(circle, rgba(255,255,255,.95) 0 1px, transparent 1.6px),
        radial-gradient(circle, rgba(88,247,255,.65) 0 1px, transparent 1.8px),
        radial-gradient(circle, rgba(255,79,216,.48) 0 1px, transparent 2px);
    background-size: 120px 120px, 190px 190px, 280px 280px;
    background-position: 0 0, 44px 80px, 120px 22px;
    animation: cosmicStarsDrift 42s linear infinite;
}

body.theme-wheel::after {
    content: "";
    position: fixed;
    inset: -20%;
    pointer-events: none;
    z-index: 0;
    opacity: .34;
    background:
        conic-gradient(from 210deg at 50% 50%,
            transparent 0 18%,
            rgba(88,247,255,.18) 24%,
            transparent 32% 52%,
            rgba(255,79,216,.16) 61%,
            transparent 70% 100%);
    filter: blur(28px);
    animation: cosmicNebulaSpin 55s linear infinite;
}

body.theme-wheel .stage {
    z-index: 1;
    isolation: isolate;
    background:
        linear-gradient(115deg, rgba(3, 6, 18, .60), rgba(10, 10, 34, .38)),
        radial-gradient(circle at 22% 18%, rgba(88,247,255,.18), transparent 34%),
        radial-gradient(circle at 70% 82%, rgba(255,79,216,.15), transparent 34%);
}

/* Kosmiczna rama iframe/video */
body.theme-wheel .video-full {
    background:
        linear-gradient(#02030a, #02030a) padding-box,
        linear-gradient(135deg, rgba(88,247,255,.95), rgba(107,124,255,.42), rgba(255,79,216,.9)) border-box !important;
    border: 1px solid transparent !important;
    border-radius: 26px !important;
    overflow: hidden !important;
    box-shadow:
        0 0 0 1px rgba(255,255,255,.05) inset,
        0 0 34px rgba(88,247,255,.23),
        0 0 86px rgba(255,79,216,.13),
        0 28px 70px rgba(0,0,0,.65) !important;
}

body.theme-wheel .video-full::before {
    content: "";
    position: absolute;
    inset: -2px;
    pointer-events: none;
    z-index: 11;
    border-radius: 27px;
    background:
        linear-gradient(90deg,
            transparent,
            rgba(88,247,255,.62),
            rgba(255,79,216,.55),
            transparent);
    background-size: 220% 100%;
    mix-blend-mode: screen;
    opacity: .45;
    animation: cosmicBorderFlow 8s linear infinite;
}

body.theme-wheel .video-full::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 12;
    border-radius: 26px;
    background:
        linear-gradient(115deg, rgba(255,255,255,.12), transparent 18% 78%, rgba(88,247,255,.08)),
        repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 4px);
    opacity: .42;
}

body.theme-wheel .webrtc-video,
body.theme-wheel .webrtc-video > div,
body.theme-wheel .webrtc-video > video,
body.theme-wheel .webrtc-video video,
body.theme-wheel .webrtc-video iframe,
body.theme-wheel .webrtc-video canvas {
    border-radius: 24px !important;
    background: #02030a !important;
}

/* Panel jak hologram statku kosmicznego */
body.theme-wheel .table-overlay,
body.theme-wheel .table-overlay.open,
body.theme-wheel .table-overlay.mini {
    background:
        linear-gradient(180deg, rgba(16, 28, 66, .82), rgba(5, 10, 28, .78)) padding-box,
        linear-gradient(145deg, rgba(88,247,255,.80), rgba(107,124,255,.36), rgba(255,79,216,.74)) border-box !important;
    border: 1px solid transparent !important;
    border-radius: 26px !important;
    box-shadow:
        0 0 0 1px rgba(255,255,255,.06) inset,
        0 0 34px rgba(88,247,255,.20),
        0 0 78px rgba(255,79,216,.14),
        0 24px 70px rgba(0,0,0,.62) !important;
    backdrop-filter: blur(18px) saturate(155%);
    -webkit-backdrop-filter: blur(18px) saturate(155%);
    overflow: hidden;
}

body.theme-wheel .table-overlay::before {
    height: 6px !important;
    border-radius: 999px;
    background: linear-gradient(90deg,
        #58f7ff,
        #6b7cff,
        #ff4fd8,
        #ffe08a,
        #58f7ff) !important;
    background-size: 360% 100% !important;
    animation: wheelRgbLedFlow 8s linear infinite !important;
    box-shadow:
        0 0 14px rgba(88,247,255,.70),
        0 0 32px rgba(255,79,216,.36) !important;
}

body.theme-wheel .table-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background:
        radial-gradient(circle at 20% 0%, rgba(88,247,255,.14), transparent 38%),
        radial-gradient(circle at 90% 35%, rgba(255,79,216,.12), transparent 42%),
        repeating-linear-gradient(90deg, transparent 0 22px, rgba(255,255,255,.026) 22px 23px);
}

body.theme-wheel .table-overlay > * {
    position: relative;
    z-index: 2;
}

/* Nagłówki i sekcje */
body.theme-wheel .table-title,
body.theme-wheel .panel-results,
body.theme-wheel .panel-controls,
body.theme-wheel .chipbar,
body.theme-wheel .betslip,
body.theme-wheel .number-grid,
body.theme-wheel .outside-bets {
    border-color: rgba(88,247,255,.24) !important;
    background:
        linear-gradient(180deg, rgba(8, 18, 48, .74), rgba(4, 9, 24, .55)) !important;
    box-shadow:
        0 0 0 1px rgba(255,255,255,.035) inset,
        0 10px 24px rgba(0,0,0,.22);
}

body.theme-wheel .table-title {
    border-radius: 18px !important;
    color: #eafcff !important;
    text-shadow: 0 0 14px rgba(88,247,255,.45);
}

body.theme-wheel .tt-left,
body.theme-wheel .lr-title,
body.theme-wheel .quality-pop-title,
body.theme-wheel .slip-title {
    letter-spacing: .14em;
    color: #dffcff !important;
}

/* Przyciski/żetony jako neon */
body.theme-wheel .panel-btn,
body.theme-wheel .chip,
body.theme-wheel .btn-clear,
body.theme-wheel .bet-btn,
body.theme-wheel .quality-option,
body.theme-wheel .repeat-btn,
body.theme-wheel .double-btn,
body.theme-wheel .undo-btn,
body.theme-wheel .place-btn {
    border-radius: 16px !important;
    border-color: rgba(88,247,255,.28) !important;
    background:
        linear-gradient(180deg, rgba(20, 35, 84, .88), rgba(7, 13, 34, .82)) !important;
    color: #eefbff !important;
    box-shadow:
        0 0 0 1px rgba(255,255,255,.04) inset,
        0 0 18px rgba(88,247,255,.12);
}

body.theme-wheel .panel-btn:hover,
body.theme-wheel .chip:hover,
body.theme-wheel .btn-clear:hover,
body.theme-wheel .bet-btn:hover,
body.theme-wheel .quality-option:hover {
    border-color: rgba(88,247,255,.68) !important;
    box-shadow:
        0 0 0 1px rgba(255,255,255,.08) inset,
        0 0 22px rgba(88,247,255,.30),
        0 0 34px rgba(255,79,216,.14) !important;
    transform: translateY(-1px);
}

body.theme-wheel .chip.active,
body.theme-wheel .quality-option[aria-selected="true"],
body.theme-wheel .place-btn {
    background:
        linear-gradient(135deg, rgba(88,247,255,.95), rgba(107,124,255,.86), rgba(255,79,216,.88)) !important;
    color: #03101c !important;
    text-shadow: none !important;
    box-shadow:
        0 0 18px rgba(88,247,255,.42),
        0 0 34px rgba(255,79,216,.22) !important;
}

/* Komórki ruletki / siatka */
body.theme-wheel .num,
body.theme-wheel .outside,
body.theme-wheel .dozen,
body.theme-wheel .column,
body.theme-wheel .zero-cell {
    border-radius: 14px !important;
    border-color: rgba(255,255,255,.14) !important;
    box-shadow:
        0 0 0 1px rgba(255,255,255,.04) inset,
        0 8px 18px rgba(0,0,0,.22);
}

body.theme-wheel .num:hover,
body.theme-wheel .outside:hover,
body.theme-wheel .dozen:hover,
body.theme-wheel .column:hover,
body.theme-wheel .zero-cell:hover {
    filter: brightness(1.16) saturate(1.15);
    box-shadow:
        0 0 0 1px rgba(88,247,255,.34) inset,
        0 0 20px rgba(88,247,255,.22);
}

/* Wyniki i timer */
body.theme-wheel .timer-ring,
body.theme-wheel .round-result,
body.theme-wheel .result-badge {
    filter: drop-shadow(0 0 18px rgba(88,247,255,.40)) drop-shadow(0 0 28px rgba(255,79,216,.18));
}

body.theme-wheel .timer-track {
    stroke: rgba(255,255,255,.14) !important;
}

body.theme-wheel .timer-progress {
    stroke: #58f7ff !important;
    filter: drop-shadow(0 0 8px rgba(88,247,255,.85));
}

body.theme-wheel .timer-text {
    color: #eefbff !important;
    text-shadow: 0 0 18px rgba(88,247,255,.8);
}

/* Pop-up jakości/głośności */
body.theme-wheel .quality-pop,
body.theme-wheel .vol-pop {
    background:
        linear-gradient(180deg, rgba(12, 23, 58, .95), rgba(4, 8, 23, .95)) !important;
    border: 1px solid rgba(88,247,255,.30) !important;
    border-radius: 18px !important;
    box-shadow:
        0 0 28px rgba(88,247,255,.18),
        0 18px 42px rgba(0,0,0,.52) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Loader też w kosmicznym klimacie */
body.theme-wheel .app-loader {
    background:
        radial-gradient(circle at 20% 15%, rgba(88,247,255,.22), transparent 30%),
        radial-gradient(circle at 78% 30%, rgba(255,79,216,.18), transparent 34%),
        linear-gradient(135deg, #02030a, #07112b 52%, #160b38) !important;
}

body.theme-wheel .loader-card {
    border-radius: 28px !important;
    border: 1px solid rgba(88,247,255,.32) !important;
    background: rgba(5, 10, 30, .70) !important;
    box-shadow:
        0 0 36px rgba(88,247,255,.23),
        0 0 80px rgba(255,79,216,.12) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Responsywność kosmicznej ramki */
@media (max-width: 720px) {
    body.theme-wheel .stage {
        padding: 8px !important;
    }

    body.theme-wheel .video-full {
        border-radius: 18px !important;
    }

    body.theme-wheel .video-full::before,
    body.theme-wheel .video-full::after,
    body.theme-wheel .webrtc-video,
    body.theme-wheel .webrtc-video > div,
    body.theme-wheel .webrtc-video > video,
    body.theme-wheel .webrtc-video video,
    body.theme-wheel .webrtc-video iframe,
    body.theme-wheel .webrtc-video canvas {
        border-radius: 16px !important;
    }

    body.theme-wheel .table-overlay,
    body.theme-wheel .table-overlay.open,
    body.theme-wheel .table-overlay.mini {
        border-radius: 20px !important;
    }
}

@keyframes cosmicStarsDrift {
    from { background-position: 0 0, 44px 80px, 120px 22px; }
    to { background-position: 0 720px, 44px 510px, 120px 362px; }
}

@keyframes cosmicNebulaSpin {
    from { transform: rotate(0deg) scale(1.05); }
    to { transform: rotate(360deg) scale(1.05); }
}

@keyframes cosmicBorderFlow {
    from { background-position: 0% 50%; }
    to { background-position: 220% 50%; }
}

/* Osoby z wyłączonymi animacjami */
@media (prefers-reduced-motion: reduce) {
    body.theme-wheel::before,
    body.theme-wheel::after,
    body.theme-wheel .video-full::before,
    body.theme-wheel .table-overlay::before {
        animation: none !important;
    }
}

