/* ============================================================
   WHEEL — Stake-style Roulette
   ============================================================ */

.screen#wheel-screen {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    padding-bottom: 10px;
}

#wheel-screen #wheel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 2px 0 4px;
}

#wheel-screen #wheel-header h1 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 850;
    letter-spacing: -0.5px;
    font-style: normal;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ffffff 40%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== WHEEL CANVAS — жёстко квадрат ===== */

#wheel-screen #wheel-wrap {
    position: relative;
    width: min(100%, 55vh);
    aspect-ratio: 1 / 1;
    margin: 0 auto 4px;
    border-radius: 50%;
    box-shadow:
        0 0 60px rgba(102,126,234,0.15),
        0 20px 60px rgba(0,0,0,0.8);
}

#wheel-screen #wheel-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 10px 40px rgba(0,0,0,0.9));
}

#wheel-screen #wheel-pointer {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) scale(1);
    width: 26px;
    height: 34px;
    background: linear-gradient(180deg, #667eea 0%, #5b4fdb 100%);
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    box-shadow: 0 0 20px rgba(102,126,234,0.9), 0 0 40px rgba(102,126,234,0.4);
    z-index: 3;
    pointer-events: none;
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    transform-origin: top center;
}

/* Спин — лёгкий пульс */
#wheel-screen.spinning #wheel-pointer {
    animation: pointerPulse 0.5s ease-in-out infinite;
}
@keyframes pointerPulse {
    0%,100% { transform: translateX(-50%) scale(1); }
    50%     { transform: translateX(-50%) scale(1.15); }
}


/* Указатель УВЕЛИЧИВАЕТСЯ + подсвечивается цветом выпавшего сегмента */
#wheel-screen #wheel-pointer.hit {
    transform: translateX(-50%) scale(1.65);
    /* background и box-shadow задаются inline через JS — цвет сегмента */
    transition: transform 0.25s ease-out, background 0.2s, box-shadow 0.2s;
}
/* ===== ЦЕНТР ===== */

#wheel-screen #wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 42%;
    height: 42%;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 30%, #0e1621 0%, #050508 100%);
    border: 2px solid rgba(102,126,234,0.35);
    box-shadow:
        inset 0 0 40px rgba(102,126,234,0.2),
        inset 0 2px 8px rgba(255,255,255,0.08),
        0 8px 30px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
}

#wheel-screen #wheel-center-label {
    font-size: 10px;
    font-weight: 800;
    color: #7d8b99;
    letter-spacing: 3px;
    margin-bottom: 4px;
}

#wheel-screen #wheel-center-mult {
    font-size: 38px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    transition: all 0.3s;
}

#wheel-screen #wheel-center-mult.win {
    animation: winPulse 0.6s ease-out;
    color: #4dcd5e !important;
    -webkit-text-fill-color: #4dcd5e !important;
    background: none !important;
    text-shadow: 0 0 30px rgba(77,205,94,0.9);
}

#wheel-screen #wheel-center-mult.lose {
    animation: loseShake 0.4s ease-in-out;
    color: #e74c3c !important;
    -webkit-text-fill-color: #e74c3c !important;
    background: none !important;
    text-shadow: 0 0 30px rgba(231,76,60,0.9);
}

@keyframes winPulse {
    0%   { transform: scale(0.5); opacity: 0.3; }
    60%  { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(1.15); opacity: 1; }
}

@keyframes loseShake {
    0%,100% { transform: translateX(0); }
    25%     { transform: translateX(-6px); }
    75%     { transform: translateX(6px); }
}

/* ===== COLOR PICKER ===== */

#wheel-screen #wheel-color-picker {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}

#wheel-screen .color-btn {
    background: linear-gradient(155deg, #0e111a 0%, #030408 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 10px 4px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    min-width: 0;
    box-sizing: border-box;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12), 0 4px 10px rgba(0, 0, 0, 0.6);
}

#wheel-screen .color-btn .c-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    box-shadow: 0 0 12px currentColor, inset 0 -2px 4px rgba(0,0,0,0.4);
    position: relative;
    z-index: 1;
}

#wheel-screen .color-btn .c-mult {
    font-size: 12px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.5px;
    z-index: 1;
    font-variant-numeric: tabular-nums;
}

#wheel-screen .color-btn:active {
    transform: scale(0.95);
}

#wheel-screen .color-btn.active {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.15);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.5), inset 0 0 16px rgba(168, 85, 247, 0.2);
}

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

#wheel-screen #wheel-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

#wheel-screen #wbet-display {
    text-align: center;
    padding: 6px 0;
    background: linear-gradient(155deg, #0e111a 0%, #030408 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.20);
    box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, 0.15), 0 8px 24px rgba(0, 0, 0, 0.7);
}

#wheel-screen #wbet-main {
    font-size: 38px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    padding: 6px 0 2px;
    background: linear-gradient(135deg, #ffffff 0%, #6a9fd8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#wheel-screen #wbet-sub {
    font-size: 12px;
    color: #e74c3c;
    font-weight: 600;
    padding-bottom: 8px;
    min-height: 16px;
}

#wheel-screen #wbet-sub.ok {
    color: #7d8b99;
}

/* ===== CHIPS ===== */

#wheel-screen .chips-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    width: 100%;
    box-sizing: border-box;
}

#wheel-screen .chips-row.small {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

#wheel-screen .chip {
    background: #08080f;
    border: 1px solid rgba(102,126,234,0.16);
    border-radius: 11px;
    color: #e8e8ec;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 13.5px;
    padding: 11px 4px;
    cursor: pointer;
    transition: all 0.15s;
    font-variant-numeric: tabular-nums;
    -webkit-tap-highlight-color: transparent;
    min-width: 0;
    box-sizing: border-box;
}

#wheel-screen .chip:active {
    border-color: #667eea;
}

#wheel-screen .chip.active {
    background: linear-gradient(135deg, #667eea, #5b4fdb);
    border-color: #667eea;
    color: #fff;
    box-shadow: 0 5px 16px rgba(102,126,234,0.5);
}

#wheel-screen .chip.small {
    font-size: 13px;
    padding: 9px 4px;
}

/* ===== SPIN BUTTON ===== */

#wheel-screen .btn-primary {
    width: 100%;
    box-sizing: border-box;
    padding: 16px;
    background: linear-gradient(135deg, #667eea, #5b4fdb);
    color: #fff;
    border: none;
    border-radius: 13px;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    letter-spacing: 0.8px;
    box-shadow: 0 8px 24px rgba(102,126,234,0.5);
    transition: all 0.2s;
    margin-top: 2px;
    text-transform: uppercase;
    -webkit-tap-highlight-color: transparent;
}

#wheel-screen .btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

#wheel-screen .btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

#wheel-screen .btn-primary.spinning {
    background: linear-gradient(135deg, #4a5568, #2d3748);
    box-shadow: none;
    cursor: wait;
}

/* ===== БАННЕР РЕЗУЛЬТАТА ===== */

#wheel-screen .result-banner {
    position: absolute;
    top: 18%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.3);
    font-size: 52px;
    font-weight: 900;
    letter-spacing: 3px;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    padding: 14px 28px;
    border-radius: 22px;
    background: rgba(5, 8, 15, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 3px solid currentColor;
    box-shadow:
        0 0 40px currentColor,
        0 8px 30px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#wheel-screen .result-banner.show {
    animation: bannerPop 1.6s ease-out forwards;
}

#wheel-screen .result-banner.win {
    color: #4dcd5e;
    text-shadow: 0 0 30px rgba(77,205,94,0.9), 0 0 60px rgba(77,205,94,0.5);
}

#wheel-screen .result-banner.lose {
    color: #e74c3c;
    text-shadow: 0 0 30px rgba(231,76,60,0.9), 0 0 60px rgba(231,76,60,0.5);
}

@keyframes bannerPop {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
    20%  { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
    40%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    80%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); }
}

/* ===== ТРЯСКА ЭКРАНА ПРИ МИМО ===== */
#wheel-screen.shake {
    animation: screenShake 0.4s ease-in-out;
}

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

/* ===== ЧАСТИЦЫ ПРИ ВЫИГРЫШЕ ===== */
.win-particle {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    z-index: 999;
    pointer-events: none;
    animation: particleFly 1.2s ease-out forwards;
}

@keyframes particleFly {
    0%   { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}