@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

:root {
    --primary-color: #00a2ff;
    --secondary-color: #00ffff;
    --dark-bg: #0a192f;
    --card-bg: #112240;
    --text-color: #ffffff;
    --button-gradient: linear-gradient(45deg, #00a2ff, #00ffff);
    --button-hover-gradient: linear-gradient(45deg, #00ffff, #00a2ff);
    --glow-color: rgba(0, 162, 255, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #0a1525;
    color: white;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(10, 30, 60, 0.5) 0%, rgba(5, 15, 30, 0.8) 70%, rgba(0, 5, 15, 1) 100%);
    z-index: -2;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

body.loaded::before {
    opacity: 1;
}

.container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    text-align: center;
    z-index: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s, transform 1s;
}

body.loaded .container {
    opacity: 1;
    transform: translateY(0);
}

h1 {
    font-size: 3.5rem;
    margin-bottom: 30px;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: transparent;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 0 0 10px rgba(255, 0, 128, 0.5);
    animation: hotlineGlow 3s infinite ease-in-out;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
}

@keyframes hotlineGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(255, 0, 128, 0.5);
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 20px rgba(255, 0, 128, 0.8), 0 0 30px rgba(255, 0, 128, 0.6), 0 0 40px rgba(255, 0, 128, 0.4);
        transform: scale(1.05);
    }
}

.roulette-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 30px auto;
    padding: 0;
    overflow: hidden;
}

.arrow-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 40px;
    z-index: 3;
    display: flex;
    justify-content: center;
    align-items: center;
}

.arrow-top {
    top: -20px;
}

.arrow-bottom {
    bottom: -20px;
}

.arrow {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.arrow::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    z-index: 2;
}

.arrow-top .arrow::before {
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 15px solid var(--primary-color);
    top: 15px;
}

.arrow-bottom .arrow::before {
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 15px solid var(--primary-color);
    bottom: 15px;
}

.arrow::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 15px #fff, 0 0 30px var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s;
}

.arrow-top .arrow::after {
    top: -5px;
}

.arrow-bottom .arrow::after {
    bottom: -5px;
}

.arrow.spinning::before {
    animation: arrowPulse 0.3s ease-in-out infinite alternate;
}

.arrow.spinning::after {
    opacity: 1;
    animation: glowPulse 0.3s ease-in-out infinite alternate;
}

@keyframes arrowPulse {
    0% {
        filter: drop-shadow(0 0 8px var(--primary-color));
        transform: scale(1);
    }
    100% {
        filter: drop-shadow(0 0 15px var(--primary-color));
        transform: scale(1.1);
    }
}

@keyframes glowPulse {
    0% {
        opacity: 0.5;
        box-shadow: 0 0 15px #fff, 0 0 30px var(--primary-color);
    }
    100% {
        opacity: 1;
        box-shadow: 0 0 20px #fff, 0 0 40px var(--primary-color);
    }
}

.roulette-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 150px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    background-color: rgba(0, 0, 0, 0.3);
}

.roulette-items {
    display: flex;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    transition: transform 5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.roulette-item {
    position: relative;
    width: 120px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s, filter 0.3s;
    overflow: hidden;
    cursor: pointer;
    box-sizing: border-box;
    padding: 5px;
}

.roulette-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
    border-radius: 8px;
}

.roulette-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.5) 100%);
    opacity: 0.7;
    z-index: 1;
    pointer-events: none;
}

.result-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 230px;
    height: 275px;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s, transform 0.5s;
    display: none;
}

.result-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 15px var(--secondary-color));
}

.result-frame.active {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
    display: none;
}

.result-frame.active img {
    animation: none;
}

.button-container {
    margin-top: 30px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.spin-button {
    background: var(--button-gradient);
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 5px 15px rgba(255, 62, 62, 0.4);
    outline: none;
}

.spin-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 62, 62, 0.6);
    background: var(--button-hover-gradient);
}

.spin-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(255, 62, 62, 0.4);
}

.spin-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 5px 15px rgba(255, 62, 62, 0.2);
}

.spin-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    transform: scale(0);
    transition: transform 0.5s;
}

.spin-button:hover::before {
    transform: scale(1);
}

.result {
    margin-top: 0;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 600;
    color: white;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s, transform 0.5s;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.result.active {
    opacity: 1;
    transform: translateY(0);
}

.result span {
    color: var(--primary-color);
    position: relative;
    font-weight: 700;
    text-shadow: 0 0 10px var(--primary-color);
}

.result span::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    animation: pulseBackground 2s infinite;
    box-shadow: 0 0 10px var(--primary-color);
}

/* Эффект свечения вокруг рулетки */
.glow-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 15px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s;
    box-shadow: 0 0 30px var(--primary-color);
}

.glow-effect.active {
    opacity: 1;
    animation: glowAnimation 2s infinite alternate;
}

@keyframes glowAnimation {
    0% {
        box-shadow: 0 0 20px var(--primary-color);
    }
    100% {
        box-shadow: 0 0 40px var(--primary-color), 0 0 60px rgba(255, 62, 62, 0.4);
    }
}

/* Анимация для элементов рулетки */
.roulette-item.highlight {
    z-index: 2;
}

.roulette-item.highlight img {
    transform: scale(1.05);
    filter: brightness(1.2);
}

/* Адаптивность */
@media (max-width: 700px) {
    h1 {
        font-size: 2rem;
    }
    
    .roulette-wrapper {
        max-width: 320px;
        margin: 20px auto;
    }
    
    .roulette-container {
        max-width: 320px;
        height: 100px;
    }
    
    .roulette-item {
        width: 80px;
        height: 100px;
    }
    
    .result-frame {
        width: 150px;
        height: 180px;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
        padding: 20px 10px;
    }
    
    .arrow-container {
        width: 30px;
        height: 40px;
    }
    
    .arrow-top .arrow::before {
        border-left: 12px solid transparent;
        border-right: 12px solid transparent;
        border-bottom: 12px solid var(--primary-color);
        top: 15px;
        filter: drop-shadow(0 0 5px var(--primary-color));
    }
    
    .arrow-bottom .arrow::before {
        border-left: 12px solid transparent;
        border-right: 12px solid transparent;
        border-top: 12px solid var(--primary-color);
        bottom: 15px;
        filter: drop-shadow(0 0 5px var(--primary-color));
    }
    
    .spin-button {
        padding: 12px 30px;
        font-size: 16px;
    }
    
    .result {
        font-size: 20px;
        margin-top: 0;
        margin-bottom: 25px;
    }
    
    .background-cell {
        width: 60px;
        height: 60px;
        opacity: 0.12;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .roulette-wrapper {
        max-width: 280px;
    }
    
    .roulette-container {
        max-width: 280px;
        height: 90px;
    }
    
    .roulette-item {
        width: 80px;
        height: 90px;
    }
    
    .container {
        padding: 15px 5px;
    }
    
    .spin-button {
        padding: 10px 25px;
        font-size: 14px;
    }
    
    .result {
        font-size: 18px;
        padding: 0 10px;
        margin-top: 0;
        margin-bottom: 20px;
        line-height: 1.4;
    }
    
    .result span::after {
        bottom: -3px;
        height: 1px;
    }
    
    .arrow-container {
        width: 25px;
        height: 35px;
    }
    
    .arrow-top .arrow::before {
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-bottom: 10px solid var(--primary-color);
        top: 15px;
    }
    
    .arrow-bottom .arrow::before {
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 10px solid var(--primary-color);
        bottom: 15px;
    }
    
    .background-cell {
        width: 50px;
        height: 50px;
        opacity: 0.1;
    }
}

/* Удаляем старые стили для частиц */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

/* Стили для фоновых ячеек */
.background-cell {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 10px;
    opacity: 0.15;
    filter: blur(2px) brightness(0.8);
    transform-origin: center center;
    pointer-events: none;
    z-index: -1;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    mask-image: radial-gradient(circle, rgba(255,255,255,0.8) 50%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle, rgba(255,255,255,0.8) 50%, transparent 80%);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    transition: opacity 0.5s, filter 0.5s;
}

.background-cell.red {
    background-image: url('red cell.png');
    filter: blur(2px) brightness(0.8) hue-rotate(-10deg);
}

.background-cell.black {
    background-image: url('black cell.png');
    filter: blur(2px) brightness(0.7) hue-rotate(10deg);
}

.background-cell.fire {
    background-image: url('fire cell.png');
    filter: blur(2px) brightness(0.9) hue-rotate(0deg);
    animation-duration: calc(var(--duration) * 0.8);
}

/* Добавляем эффект свечения для некоторых ячеек */
.background-cell.glow {
    animation: cellGlow calc(var(--duration) * 0.5) infinite alternate;
}

@keyframes cellGlow {
    0% {
        filter: blur(2px) brightness(0.8);
        opacity: 0.15;
    }
    100% {
        filter: blur(3px) brightness(1.2);
        opacity: 0.25;
    }
}

@keyframes floatAnimation {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(var(--move-x), var(--move-y)) rotate(var(--rotate-deg));
    }
    50% {
        transform: translate(var(--move-x2), var(--move-y2)) rotate(calc(var(--rotate-deg) * 2));
    }
    75% {
        transform: translate(var(--move-x3), var(--move-y3)) rotate(calc(var(--rotate-deg) * 3));
    }
    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

/* Анимация для кнопки во время вращения */
.spin-button.spinning {
    animation: buttonPulse 1s infinite alternate;
}

@keyframes buttonPulse {
    0% {
        box-shadow: 0 5px 15px rgba(255, 62, 62, 0.4);
    }
    100% {
        box-shadow: 0 5px 25px rgba(255, 62, 62, 0.8), 0 0 40px rgba(255, 62, 62, 0.4);
    }
}

/* Анимация для выделения выбранного элемента */
.selected-item {
    z-index: 10;
    animation: selectedItemPulse 2s infinite;
    box-shadow: 0 0 20px var(--primary-color);
}

.selected-item img {
    transform: scale(1.1);
    filter: brightness(1.2) drop-shadow(0 0 10px var(--primary-color));
}

@keyframes selectedItemPulse {
    0%, 100% {
        box-shadow: 0 0 15px var(--primary-color);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 25px var(--primary-color), 0 0 40px var(--primary-color);
        transform: scale(1.05);
    }
}

/* Анимация загрузки */
.loading-animation {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
}

.loading-animation.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.loading-dots {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    margin: 0 5px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    animation: dotPulse 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes dotPulse {
    0%, 80%, 100% { 
        transform: scale(0);
        opacity: 0.5;
    }
    40% { 
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 10px var(--primary-color);
    }
}

.loading-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 162, 255, 0.5);
    letter-spacing: 1px;
    animation: textPulse 2s infinite alternate;
}

@keyframes textPulse {
    0% {
        opacity: 0.7;
        text-shadow: 0 0 5px rgba(0, 162, 255, 0.5);
    }
    100% {
        opacity: 1;
        text-shadow: 0 0 15px rgba(0, 162, 255, 0.8);
    }
}

/* Адаптивность для анимации загрузки */
@media (max-width: 700px) {
    .loading-text {
        font-size: 16px;
    }
    
    .loading-dots span {
        width: 10px;
        height: 10px;
        margin: 0 4px;
    }
}

@media (max-width: 480px) {
    .loading-text {
        font-size: 14px;
    }
    
    .loading-dots span {
        width: 8px;
        height: 8px;
        margin: 0 3px;
    }
}

/* Стили для надписи Analysis на рулетке */
.analysis-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--primary-color);
    font-size: 36px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s, visibility 0.5s;
    text-shadow: 0 0 15px var(--primary-color);
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.analysis-overlay.active {
    opacity: 1;
    visibility: visible;
    animation: analysisPulse 2s infinite alternate;
}

.analysis-overlay::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 162, 255, 0.2) 0%, transparent 70%);
    opacity: 0;
    animation: glowRadial 2s infinite alternate;
}

.analysis-overlay::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--primary-color);
    filter: blur(15px);
    opacity: 0.5;
    animation: orbitAnimation 4s infinite linear;
}

@keyframes analysisPulse {
    0% {
        text-shadow: 0 0 10px var(--primary-color);
        transform: scale(1);
    }
    100% {
        text-shadow: 0 0 20px var(--primary-color), 0 0 30px var(--primary-color);
        transform: scale(1.05);
    }
}

@keyframes glowRadial {
    0% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    100% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

@keyframes orbitAnimation {
    0% {
        transform: rotate(0deg) translateX(80px) rotate(0deg);
    }
    100% {
        transform: rotate(360deg) translateX(80px) rotate(-360deg);
    }
}

/* Стили для кнопки Back */
.back-button-link {
    text-decoration: none;
    display: inline-block;
}

.back-button {
    background: transparent;
    color: var(--primary-color);
    padding: 12px 30px;
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
    box-shadow: 0 0 15px rgba(0, 162, 255, 0.2);
    outline: none;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 162, 255, 0.4);
    background-color: rgba(0, 162, 255, 0.1);
}

.back-button:active {
    transform: translateY(1px);
    box-shadow: 0 0 10px rgba(0, 162, 255, 0.3);
}

/* Стили для кнопки CASH DYNASTY */
.dynasty-button-link {
    text-decoration: none;
    display: inline-block;
    margin-top: 10px;
}

.dynasty-button {
    background: linear-gradient(45deg, #0088cc, #29b6f6);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 5px 15px rgba(0, 136, 204, 0.4);
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dynasty-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 136, 204, 0.6);
    background: linear-gradient(45deg, #29b6f6, #0088cc);
}

.dynasty-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(0, 136, 204, 0.4);
}

.dynasty-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.5));
}

.dynasty-button span {
    display: inline-block;
    vertical-align: middle;
}

/* Адаптивность для кнопки CASH DYNASTY */
@media (max-width: 700px) {
    .dynasty-button {
        padding: 10px 25px;
        font-size: 14px;
    }
    
    .dynasty-icon {
        width: 20px;
        height: 20px;
        margin-right: 8px;
    }
}

@media (max-width: 480px) {
    .dynasty-button {
        padding: 8px 20px;
        font-size: 12px;
    }
    
    .dynasty-icon {
        width: 18px;
        height: 18px;
        margin-right: 6px;
    }
}

/* Адаптивность для надписи Analysis и кнопки Back */
@media (max-width: 700px) {
    .analysis-overlay {
        font-size: 28px;
    }
    
    .back-button {
        padding: 10px 25px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .analysis-overlay {
        font-size: 24px;
    }
    
    .back-button {
        padding: 8px 20px;
        font-size: 12px;
    }
} 