/* Общие стили для гэмблинг-виджетов (казино тема с новой палитрой) */
.gambling-widget {
    border: 3px solid #c0c0c0;
    border-radius: 12px;
    padding: 20px;
    margin: 20px auto;
    background-color: #1a2a44;
    color: #c0c0c0;
    box-shadow: 0 4px 15px rgba(192, 192, 192, 0.4);
    text-align: center;
    max-width: 450px;
    font-family: 'Verdana', sans-serif;
    position: relative;
    z-index: 1; /* Базовый z-index для виджета */
    overflow: hidden;
}

.gambling-widget::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(192, 192, 192, 0.1) 0%, transparent 70%);
    z-index: -1; /* Фон ниже содержимого */
    animation: glow 10s infinite alternate;
}

@keyframes glow {
    0% { transform: scale(1); }
    100% { transform: scale(1.2); }
}

.gambling-widget h3 {
    margin: 0 0 15px;
    color: #e0e0e0;
    text-shadow: 0 0 5px #c0c0c0, 0 0 10px #c0c0c0;
    font-size: 1.5em;
    position: relative;
    z-index: 2;
}

.gambling-widget input[type="number"],
.gambling-widget select {
    width: 100%;
    margin: 10px 0;
    padding: 10px;
    border: 2px solid #c0c0c0;
    border-radius: 6px;
    background-color: #2e4060;
    color: #c0c0c0;
    font-size: 1em;
    box-sizing: border-box;
    z-index: 3; /* Выше фона и содержимого */
    cursor: text;
    position: relative;
}

.gambling-widget input[type="number"]::placeholder,
.gambling-widget select option {
    color: #a0a0a0;
    opacity: 0.8;
}

.gambling-widget input[type="number"]:focus,
.gambling-widget select:focus {
    outline: none;
    border-color: #e0e0e0;
    box-shadow: 0 0 10px rgba(192, 192, 192, 0.6);
    color: #fff;
}

.gambling-widget button {
    width: 100%;
    padding: 12px;
    background-color: #ff4040;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s, transform 0.2s;
    position: relative;
    z-index: 4; /* Повышен z-index для кнопок */
    pointer-events: auto; /* Убеждаемся, что события мыши работают */
}

.gambling-widget button:hover {
    background-color: #e03a3a;
    transform: translateY(-2px);
}

.gambling-widget button:active {
    transform: translateY(0);
}

.gambling-widget p {
    margin-top: 15px;
    font-weight: bold;
    color: #e0e0e0;
    text-shadow: 0 0 3px #c0c0c0;
    position: relative;
    z-index: 2;
}

/* Слот-машина: барабаны с горизонтальным расположением */
.slots-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    margin: 15px 0;
}

.slot-reel {
    width: 60px;
    height: 60px;
    line-height: 60px;
    font-size: 40px;
    border: 2px solid #c0c0c0;
    border-radius: 8px;
    margin: 0 8px;
    overflow: hidden;
    background-color: #2e4060;
    color: #c0c0c0;
    text-align: center;
    box-shadow: inset 0 0 10px #c0c0c0;
    position: relative;
    z-index: 2;
}

.symbols {
    display: flex;
    flex-direction: column;
    transition: transform 2s ease-out;
}

.symbols span {
    height: 60px;
    line-height: 60px;
    display: block;
    min-height: 60px;
}

.symbols.spin {
    /* Анимация управляется в JS */
}

/* Рулетка: стили и анимация */
.roulette-wheel {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 3px solid #e0e0e0;
    background: conic-gradient(
        red 0% 2.7%, black 2.7% 5.4%, red 5.4% 8.1%, black 8.1% 10.8%,
        red 10.8% 13.5%, black 13.5% 16.2%, red 16.2% 18.9%, black 18.9% 21.6%,
        red 21.6% 24.3%, black 24.3% 27%, red 27% 29.7%, black 29.7% 32.4%,
        red 32.4% 35.1%, black 35.1% 37.8%, red 37.8% 40.5%, black 40.5% 43.2%,
        red 43.2% 45.9%, black 45.9% 48.6%, red 48.6% 51.3%, black 51.3% 54%,
        red 54% 56.7%, black 56.7% 59.4%, red 59.4% 62.1%, black 62.1% 64.8%,
        red 64.8% 67.5%, black 67.5% 70.2%, red 70.2% 72.9%, black 72.9% 75.6%,
        red 75.6% 78.3%, black 78.3% 81%, red 81% 83.7%, black 83.7% 86.4%,
        red 86.4% 89.1%, black 89.1% 91.8%, red 91.8% 94.5%, black 94.5% 97.2%,
        green 97.2% 100%
    );
    margin: 15px auto;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.3);
    overflow: hidden;
    z-index: 2;
}

.roulette-wheel.spin {
    animation: spin 4s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(4320deg); }
}

/* Монета: 3D флип с блеском */
.coin {
    width: 100px;
    height: 100px;
    margin: 15px auto;
    perspective: 1200px;
    position: relative;
    z-index: 2;
}

.coin-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    backface-visibility: hidden;
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.8);
    background: linear-gradient(45deg, #c0c0c0, #a0a0a0);
    color: #1a2a44;
    z-index: 2;
}

.coin-face.tails {
    transform: rotateY(180deg);
    background: linear-gradient(45deg, #808080, #606060);
}

.coin.flip-heads .coin-inner {
    transform: rotateY(1800deg);
}

.coin.flip-tails .coin-inner {
    transform: rotateY(1980deg);
}

.coin.result-heads .coin-inner {
    transform: rotateY(0deg);
}

.coin.result-tails .coin-inner {
    transform: rotateY(180deg);
}

/* Кубики: ролл с тенью */
.dice-roller .dice {
    width: 60px;
    height: 60px;
    margin: 10px;
    display: inline-block;
    background-color: #e0e0e0;
    border: 2px solid #c0c0c0;
    border-radius: 6px;
    line-height: 60px;
    font-size: 28px;
    font-weight: bold;
    color: #1a2a44;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    transition: transform 1.2s ease-out, box-shadow 0.3s;
    z-index: 2;
}

.dice.roll {
    transform: rotate(720deg) scale(1.1);
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.5);
}

/* Угадай число: ревеал с эффектом */
.reveal-number {
    opacity: 0;
    transform: scale(0.8) rotate(-5deg);
    transition: opacity 0.5s ease, transform 0.5s ease;
    color: #e0e0e0;
    z-index: 2;
}

.reveal-number.show {
    opacity: 1;
    transform: scale(1) rotate(0);
    text-shadow: 0 0 10px #c0c0c0;
}