:root { --cosmic-gold: #ffd700; --cosmic-pink: #ff69b4; --cosmic-cyan: #00ffff; }
body { display: flex; flex-direction: column; align-items: center; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.container { max-width: 1200px; width: 100%; margin: 0 auto; padding: 20px; position: relative; z-index: 1; }
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; flex-wrap: wrap; gap: 15px; }
.back-btn { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); text-decoration: none; font-weight: 600; transition: all 0.3s; padding: 10px 20px; border-radius: 50px; background: rgba(75,0,130,0.3); border: 1px solid rgba(138,43,226,0.3); }
.back-btn:hover { color: var(--text-light); border-color: var(--accent-purple); box-shadow: 0 0 20px rgba(138,43,226,0.3); }
@keyframes cosmicFloat { 0%,100%{transform:translateY(0) rotate(0deg)} 25%{transform:translateY(-10px) rotate(5deg)} 75%{transform:translateY(5px) rotate(-5deg)} }
@keyframes roulettePulse { 0%,100%{box-shadow:0 0 30px rgba(138,43,226,0.5),0 0 60px rgba(191,64,191,0.3)} 50%{box-shadow:0 0 50px rgba(138,43,226,0.8),0 0 100px rgba(191,64,191,0.5),0 0 150px rgba(0,255,255,0.2)} }
@keyframes resultAppear { 0%{transform:scale(0) rotate(-180deg);opacity:0} 60%{transform:scale(1.2) rotate(10deg);opacity:1} 100%{transform:scale(1) rotate(0deg);opacity:1} }
@keyframes winGlow { 0%,100%{filter:brightness(1)} 50%{filter:brightness(1.5) drop-shadow(0 0 20px var(--cosmic-gold))} }
@keyframes loseShake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }
@keyframes particleFloat { 0%{transform:translateY(0) translateX(0);opacity:1} 100%{transform:translateY(-200px) translateX(var(--px));opacity:0} }
@keyframes slideInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalIn { from { opacity: 0; transform: scale(0.9) translateY(-30px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.header { text-align: center; margin-bottom: 40px; }
.header-icon { font-size: 5rem; animation: cosmicFloat 6s ease-in-out infinite; display: inline-block; will-change: transform; }
h1 { font-family: 'Orbitron', 'Montserrat', sans-serif; font-size: 3rem; margin-bottom: 15px; background: linear-gradient(to right, #fff, var(--cosmic-cyan), var(--accent-purple), var(--cosmic-pink)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; letter-spacing: 2px; }
.subtitle { color: var(--text-muted); font-size: 1.1rem; max-width: 600px; margin: 0 auto; line-height: 1.6; }

.resources-bar { display: flex; align-items: center; justify-content: center; gap: 25px; margin-bottom: 25px; padding: 15px 25px; background: rgba(75,0,130,0.3); border-radius: 20px; border: 1px solid rgba(138,43,226,0.4); backdrop-filter: blur(10px); flex-wrap: wrap; }
.resource-item { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: rgba(0,0,0,0.3); border-radius: 12px; }
.resource-icon { font-size: 1.5rem; }
.resource-info { display: flex; flex-direction: column; }
.resource-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.resource-value { font-size: 1.1rem; font-weight: 700; }
.resource-value.tickets { color: #ffd700; }
.resource-value.rubles { color: #ba68c8; }
.btn-buy-tickets { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; background: linear-gradient(135deg, #8e44ad, #9b59b6); border: 1px solid rgba(138,43,226,0.5); border-radius: 50px; color: white; cursor: pointer; font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 0.9rem; transition: all 0.3s; white-space: nowrap; }
.btn-buy-tickets:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(138,43,226,0.4); background: linear-gradient(135deg, #9b59b6, #8e44ad); }

.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 1000; justify-content: center; align-items: center; padding: 20px; }
.modal-overlay.active { display: flex; }
.modal { background: rgba(20,0,40,0.98); border-radius: 24px; padding: 30px; border: 2px solid rgba(138,43,226,0.5); box-shadow: 0 25px 60px rgba(0,0,0,0.6), 0 0 40px rgba(138,43,226,0.3); max-width: 500px; width: 100%; animation: modalIn 0.3s ease; backdrop-filter: blur(20px); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.modal-title { font-family: 'Orbitron', sans-serif; font-size: 1.4rem; font-weight: 700; color: var(--accent-purple); display: flex; align-items: center; gap: 10px; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; padding: 5px; transition: all 0.3s; }
.modal-close:hover { color: var(--danger); transform: rotate(90deg); }
.modal-packages { display: flex; flex-direction: column; gap: 12px; margin-bottom: 25px; }
.package-card { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: rgba(45,0,54,0.5); border: 2px solid rgba(138,43,226,0.3); border-radius: 16px; cursor: pointer; transition: all 0.3s; }
.package-card:hover { border-color: var(--accent-purple); background: rgba(45,0,54,0.7); }
.package-card.selected { border-color: var(--gold); background: rgba(45,0,54,0.8); box-shadow: 0 0 20px rgba(255,215,0,0.2); }
.package-left { display: flex; align-items: center; gap: 12px; }
.package-icon { font-size: 2rem; }
.package-info { display: flex; flex-direction: column; }
.package-name { font-weight: 700; font-size: 1rem; }
.package-desc { font-size: 0.75rem; color: var(--text-muted); }
.package-right { text-align: right; }
.package-price { font-size: 1.2rem; font-weight: 700; color: var(--gold); }
.package-per-ticket { font-size: 0.7rem; color: var(--text-muted); }
.modal-footer { display: flex; gap: 10px; }
.btn-modal { flex: 1; padding: 14px 20px; border-radius: 12px; font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 1rem; cursor: pointer; transition: all 0.3s; border: none; }
.btn-buy { background: linear-gradient(135deg, #8e44ad, #9b59b6); color: white; }
.btn-buy:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(138,43,226,0.4); }
.btn-buy:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-cancel { background: rgba(138,43,226,0.2); color: var(--text-muted); border: 1px solid rgba(138,43,226,0.3); }
.btn-cancel:hover { color: var(--text-light); border-color: var(--accent-purple); }
.modal-error { background: rgba(237,66,69,0.1); border: 1px solid var(--danger); color: #ff6b6b; padding: 10px 16px; border-radius: 10px; font-size: 0.85rem; margin-bottom: 15px; display: none; }

.roulette-card { background: rgba(30,0,50,0.8); border-radius: 30px; padding: 30px; backdrop-filter: blur(20px); border: 2px solid rgba(138,43,226,0.4); box-shadow: 0 25px 60px rgba(0,0,0,0.5), inset 0 0 30px rgba(138,43,226,0.1); animation: roulettePulse 3s ease-in-out infinite; position: relative; overflow: hidden; will-change: box-shadow; }
.roulette-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; }
.wheel-section { display: flex; justify-content: center; align-items: flex-start; padding-top: 40px; }
.wheel-canvas-wrapper { width: 400px; height: 400px; position: relative; z-index: 1; background: transparent; }
#wheelCanvas { width: 100%; height: 100%; display: block; image-rendering: auto; background: transparent; }
.controls-section { display: flex; flex-direction: column; gap: 20px; min-height: 400px; }
.input-group { display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
.input-label { font-weight: 600; color: var(--accent-purple); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 2px; display: flex; align-items: center; gap: 8px; }
.cosmic-input { width: 100%; padding: 16px 20px; background: rgba(0,0,0,0.5); border: 2px solid rgba(138,43,226,0.4); border-radius: 15px; color: var(--text-light); font-size: 1.2rem; font-family: 'Orbitron', 'Montserrat', sans-serif; transition: all 0.3s ease; outline: none; }
.cosmic-input:focus { border-color: var(--neon-purple); box-shadow: 0 0 25px rgba(191,64,191,0.3); background: rgba(0,0,0,0.7); }
.spin-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 18px 30px; background: linear-gradient(135deg, var(--primary-purple), var(--dark-purple)); border: none; border-radius: 50px; color: white; font-size: 1.3rem; font-weight: 700; font-family: 'Orbitron', 'Montserrat', sans-serif; cursor: pointer; transition: all 0.3s ease; letter-spacing: 2px; text-transform: uppercase; overflow: hidden; -webkit-tap-highlight-color: transparent; will-change: transform, box-shadow; flex-shrink: 0; position: relative; }
.spin-btn::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent); transition: left 0.5s; }
.spin-btn:hover::before { left: 100%; }
.spin-btn:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 15px 40px rgba(138,43,226,0.5); background: linear-gradient(135deg, var(--neon-purple), var(--primary-purple)); }
.spin-btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.spin-btn i { font-size: 1.5rem; }
.spin-btn:not(:disabled) i { animation: cosmicFloat 2s ease-in-out infinite; }
.result-container { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; min-height: 200px; }
.result-icon { font-size: 4rem; animation: resultAppear 0.8s cubic-bezier(0.68,-0.55,0.265,1.55) forwards; display: none; }
.result-icon.visible { display: block; }
.result-title { font-family: 'Orbitron', 'Montserrat', sans-serif; font-size: 2.2rem; font-weight: 900; margin: 10px 0; animation: resultAppear 0.8s cubic-bezier(0.68,-0.55,0.265,1.55) forwards; display: none; }
.result-title.visible { display: block; }
.result-title.win { background: linear-gradient(45deg, var(--cosmic-gold), #ffaa00); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; animation: resultAppear 0.8s cubic-bezier(0.68,-0.55,0.265,1.55) forwards, winGlow 1s ease-in-out 0.8s infinite; }
.result-title.lose { background: linear-gradient(45deg, #ff4444, #ff6666); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; animation: resultAppear 0.8s cubic-bezier(0.68,-0.55,0.265,1.55) forwards, loseShake 0.3s ease-in-out 0.8s 2; }
.result-chance { font-size: 1rem; color: var(--text-muted); margin-top: 5px; font-family: 'Orbitron', sans-serif; }
.result-percent { font-size: 1.5rem; font-weight: 700; color: var(--cosmic-cyan); font-family: 'Orbitron', sans-serif; }
.particles { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 100; }
.particle { position: absolute; width: 10px; height: 10px; border-radius: 50%; animation: particleFloat 1.5s ease-out forwards; will-change: transform, opacity; }
.user-profile-card { display: flex; align-items: center; gap: 10px; background: rgba(75,0,130,0.4); padding: 5px 16px 5px 5px; border-radius: 50px; border: 1px solid rgba(138,43,226,0.3); backdrop-filter: blur(10px); text-decoration: none; cursor: pointer; transition: all 0.3s ease; }
.user-profile-card:hover { border-color: var(--accent-purple); box-shadow: 0 0 20px rgba(138,43,226,0.3); }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--accent-purple); box-shadow: 0 0 10px var(--accent-purple); object-fit: cover; }
.user-name { font-weight: 600; color: var(--text-light); font-size: 0.85rem; }
.profile-hint { font-size: 0.7rem; color: var(--text-muted); opacity: 0.7; }
.footer { text-align: center; margin-top: 40px; padding: 20px; color: var(--text-muted); font-size: 0.85rem; opacity: 0.7; }
.error-message { color: #ff4444; font-size: 0.9rem; margin-top: 5px; display: none; }
.toast { position: fixed; top: 20px; right: 20px; background: rgba(30,0,50,0.95); border: 1px solid var(--success); color: var(--text-light); padding: 15px 25px; border-radius: 15px; z-index: 9999; animation: slideInUp 0.3s ease; backdrop-filter: blur(10px); font-weight: 600; max-width: 400px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: #ffa500; }
.freeze-modal .modal { border-color: #00bcd4; box-shadow: 0 25px 60px rgba(0,0,0,0.6), 0 0 40px rgba(0,188,212,0.3); }
.freeze-modal .modal-title { color: #00bcd4; }
.freeze-icon { font-size: 5rem; display: block; text-align: center; margin: 20px 0; animation: cosmicFloat 3s ease-in-out infinite; }
.freeze-message { text-align: center; color: var(--text-muted); line-height: 1.6; margin: 20px 0; }
.freeze-reason { background: rgba(0,188,212,0.1); border: 1px solid rgba(0,188,212,0.3); border-radius: 12px; padding: 15px; margin: 15px 0; color: #80deea; font-style: italic; }
.btn-ok-freeze { display: block; margin: 20px auto 0; padding: 12px 40px; background: rgba(0,188,212,0.2); border: 2px solid #00bcd4; border-radius: 50px; color: #00bcd4; font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 1rem; cursor: pointer; transition: all 0.3s; }
.btn-ok-freeze:hover { background: rgba(0,188,212,0.3); box-shadow: 0 0 20px rgba(0,188,212,0.4); transform: translateY(-2px); }
@media (max-width: 968px) { .roulette-layout{grid-template-columns:1fr;gap:25px} .wheel-canvas-wrapper{width:350px;height:350px;margin:0 auto} }
@media (max-width: 768px) { h1{font-size:2rem} .roulette-card{padding:20px} .wheel-canvas-wrapper{width:300px;height:300px} .result-title{font-size:1.8rem} .spin-btn{font-size:1.1rem;padding:15px 25px} .top-bar{justify-content:center} .cosmic-input{font-size:1rem;padding:14px 16px} .resources-bar{flex-direction:column;gap:12px} .resource-item{width:100%;justify-content:center} .btn-buy-tickets{width:100%;justify-content:center} }
@media (max-width: 480px) { h1{font-size:1.5rem} .wheel-canvas-wrapper{width:260px;height:260px} .roulette-card{padding:15px;border-radius:20px} .modal{padding:20px} }
