* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Arial', sans-serif;
}

:root {
    --primary-color: #ff4757;
    --secondary-color: #3742fa;
    --accent-color: #ffa502;
    --dark-bg: #1e272e;
    --light-bg: #2f3542;
    --text-light: #f1f2f6;
    --text-muted: #a4b0be;
    --success-color: #2ed573;
    --danger-color: #ff6b81;
    --roulette-green: #2ecc71;
    --roulette-red: #e74c3c;
    --roulette-black: #2c3e50;
}

body {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #0c2461 100%);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

/* Game Header */
.game-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.game-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
}

.roulette-icon {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.roulette-icon .fa-spin {
    animation: spin 3s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

h1 {
    font-size: 3rem;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.stat {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: 15px;
    min-width: 120px;
    transition: transform 0.3s;
}

.stat:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-color);
}

/* Game Container Layout */
.game-container {
    display: flex;
    gap: 20px;
    min-height: 80vh;
}

.left-panel, .center-panel, .right-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px;
}

.left-panel, .right-panel {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.center-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Panel Sections */
.panel-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.panel-section h2 {
    color: var(--text-light);
    font-size: 1.3rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

/* Form Elements */
.form-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.form-input {
    flex: 1;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 10px;
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 15px rgba(55, 66, 250, 0.3);
}

.form-select {
    width: 100%;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 10px;
    color: var(--text-light);
    font-size: 1rem;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 71, 87, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
}

.btn-danger {
    background: linear-gradient(45deg, #ff3838, #ff9f1a);
    color: white;
}

.btn-spin {
    padding: 20px 50px;
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 30px auto;
    box-shadow: 0 10px 30px rgba(255, 71, 87, 0.4);
}

.btn-spin:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(255, 71, 87, 0.6);
}

.btn-spin:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Roulette Container */
.roulette-container {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wheel-wrapper {
    position: relative;
    width: 600px;
    height: 600px;
    margin: 0 auto;
}

#rouletteCanvas {
    border-radius: 50%;
    box-shadow: 
        0 0 50px rgba(255, 255, 255, 0.1),
        0 0 100px rgba(255, 71, 87, 0.2),
        inset 0 0 50px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s linear;
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: var(--dark-bg);
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pointer {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 80px;
    background: var(--accent-color);
    border-radius: 2px;
    z-index: 11;
}

.pointer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

/* Spin Controls */
.spin-controls {
    margin-top: 30px;
    width: 100%;
    max-width: 600px;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
}

.slider {
    flex: 1;
    -webkit-appearance: none;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.slot-display {
    text-align: center;
    margin-top: 20px;
}

.current-slot {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 30px;
    border-radius: 15px;
    font-size: 1.2rem;
}

.slot-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-left: 10px;
    text-shadow: 0 0 20px rgba(255, 165, 2, 0.5);
}

/* Winner Display */
.winner-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(30, 39, 46, 0.95);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    z-index: 100;
    border: 3px solid var(--accent-color);
    box-shadow: 0 0 100px rgba(255, 165, 2, 0.5);
    animation: popIn 0.5s ease-out;
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    80% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.winner-name {
    font-size: 3.5rem;
    color: var(--accent-color);
    margin: 20px 0;
    text-shadow: 0 0 30px rgba(255, 165, 2, 0.8);
    animation: glow 1.5s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px rgba(255, 165, 2, 0.7); }
    to { text-shadow: 0 0 40px rgba(255, 165, 2, 1); }
}

.winner-details {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.slot-highlight {
    color: var(--success-color);
    font-weight: bold;
    font-size: 1.5rem;
}

/* Friends List */
.friends-list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 10px;
}

.friend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.friend-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.friend-item.winner {
    border-left-color: var(--success-color);
    background: rgba(46, 213, 115, 0.1);
}

.friend-name {
    font-weight: 600;
}

.friend-slot {
    background: var(--secondary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Confetti */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: confettiFall 5s linear infinite;
}

.confetti:nth-child(2) {
    background: var(--secondary-color);
    animation-delay: 1s;
    left: 20%;
}

.confetti:nth-child(3) {
    background: var(--accent-color);
    animation-delay: 2s;
    right: 20%;
}

@keyframes confettiFall {
    0% {
        top: -20px;
        transform: rotate(0deg);
    }
    100% {
        top: 100%;
        transform: rotate(360deg);
    }
}

/* Toggle Switches */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-right: 10px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-toggle {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 24px;
}

.slider-toggle:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider-toggle {
    background-color: var(--success-color);
}

input:checked + .slider-toggle:before {
    transform: translateX(26px);
}

.setting-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--dark-bg);
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    border: 2px solid var(--secondary-color);
}

.modal-content textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 10px;
    color: var(--text-light);
    padding: 15px;
    margin: 20px 0;
    resize: vertical;
    font-size: 1rem;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Responsive Design */
@media (max-width: 1400px) {
    .game-container {
        flex-direction: column;
    }
    
    .left-panel, .right-panel {
        width: 100%;
    }
    
    .wheel-wrapper {
        width: 400px;
        height: 400px;
    }
    
    #rouletteCanvas {
        width: 400px;
        height: 400px;
    }
}

@media (max-width: 768px) {
    .game-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .stat {
        width: 200px;
    }
    
    .wheel-wrapper {
        width: 300px;
        height: 300px;
    }
    
    #rouletteCanvas {
        width: 300px;
        height: 300px;
    }
    
    .btn-spin {
        padding: 15px 30px;
        font-size: 1.2rem;
    }
}
