/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.container {
    display: grid;
    grid-template-columns: 1fr 300px;
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "header header"
        "main sidebar";
    min-height: 100vh;
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header Styles */
.header {
    grid-area: header;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2.5rem;
    color: #667eea;
    animation: pulse 2s infinite;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-stats {
    display: flex;
    gap: 30px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1.1rem;
}

.stat-item i {
    color: #667eea;
    font-size: 1.2rem;
}

.signin-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.signin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.signin-btn i {
    font-size: 1rem;
}

/* Main Content */
.main-content {
    grid-area: main;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Game Status */
.game-status {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.round-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.round-info h2 {
    font-size: 1.8rem;
    color: #333;
}

.timer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 600;
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    padding: 10px 15px;
    border-radius: 15px;
}

.timer i {
    animation: pulse 1s infinite;
}

.last-results h3 {
    margin-bottom: 15px;
    color: #333;
}

.result-history {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.result-item {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 0.9rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Betting Area */
.betting-area {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.color-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.color-option {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.color-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.color-option.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.05);
}

.color-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.color-option:hover .color-circle {
    transform: scale(1.1);
}

.color-circle.red {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
}

.color-circle.green {
    background: linear-gradient(135deg, #51cf66, #40c057);
}

.color-circle.blue {
    background: linear-gradient(135deg, #4dabf7, #339af0);
}

.color-option span {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
    display: block;
    margin-bottom: 8px;
}

.multiplier {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-block;
}

/* Betting Controls */
.betting-controls {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 20px;
    align-items: end;
}

.bet-amount label,
.selected-color label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.amount-input {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.amount-input input {
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    transition: border-color 0.3s ease;
}

.amount-input input:focus {
    outline: none;
    border-color: #667eea;
}

.quick-amounts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-btn {
    padding: 8px 12px;
    border: 1px solid #e1e5e9;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.quick-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.selected-color {
    text-align: center;
}

#selectedColorDisplay {
    padding: 15px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#selectedColorDisplay.red {
    background: rgba(255, 107, 107, 0.1);
    border-color: #ff6b6b;
    color: #ff6b6b;
}

#selectedColorDisplay.green {
    background: rgba(81, 207, 102, 0.1);
    border-color: #51cf66;
    color: #51cf66;
}

#selectedColorDisplay.blue {
    background: rgba(77, 171, 247, 0.1);
    border-color: #4dabf7;
    color: #4dabf7;
}

.place-bet-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 150px;
    justify-content: center;
}

.place-bet-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.place-bet-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Game Result */
.game-result {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.result-animation {
    margin-bottom: 30px;
}

.spinning-wheel {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    border: 8px solid #333;
    animation: spin 3s ease-out;
}

.wheel-segment {
    position: absolute;
    width: 50%;
    height: 50%;
    transform-origin: 100% 100%;
}

.wheel-segment.red {
    background: #ff6b6b;
    transform: rotate(0deg);
}

.wheel-segment.green {
    background: #51cf66;
    transform: rotate(60deg);
}

.wheel-segment.blue {
    background: #4dabf7;
    transform: rotate(120deg);
}

.wheel-segment:nth-child(4) {
    transform: rotate(180deg);
}

.wheel-segment:nth-child(5) {
    transform: rotate(240deg);
}

.wheel-segment:nth-child(6) {
    transform: rotate(300deg);
}

.result-message {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #333;
}

.result-details {
    font-size: 1.2rem;
    color: #666;
}

/* Recent Bets */
.recent-bets {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.recent-bets h3 {
    margin-bottom: 20px;
    color: #333;
}

.bets-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bet-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    border-left: 4px solid;
}

.bet-item.win {
    border-left-color: #51cf66;
    background: rgba(81, 207, 102, 0.1);
}

.bet-item.lose {
    border-left-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.bet-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bet-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.bet-color.red {
    background: #ff6b6b;
}

.bet-color.green {
    background: #51cf66;
}

.bet-color.blue {
    background: #4dabf7;
}

.bet-details {
    font-size: 0.9rem;
}

.bet-amount {
    font-weight: 600;
    color: #333;
}

.bet-result {
    font-weight: 600;
}

.bet-result.win {
    color: #51cf66;
}

.bet-result.lose {
    color: #ff6b6b;
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
}

.sidebar-section ul {
    list-style: none;
}

.sidebar-section li {
    padding: 8px 0;
    color: #666;
    position: relative;
    padding-left: 20px;
}

.sidebar-section li:before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #e1e5e9;
}

.stat-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
}

.leaderboard {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.leaderboard-rank {
    font-weight: 600;
    color: #667eea;
    min-width: 30px;
}

.leaderboard-name {
    flex: 1;
    margin: 0 10px;
}

.leaderboard-score {
    font-weight: 600;
    color: #333;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 2rem;
}

.modal-content p {
    margin-bottom: 30px;
    color: #666;
    font-size: 1.1rem;
    line-height: 1.6;
}

.start-btn,
.continue-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-btn:hover,
.continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.win-modal {
    background: linear-gradient(135deg, #51cf66, #40c057);
    color: white;
}

.win-modal h2,
.win-modal p {
    color: white;
}

/* Animations */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

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

    100% {
        transform: rotate(1440deg);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main"
            "sidebar";
    }

    .sidebar {
        order: 3;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
        gap: 15px;
    }

    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .user-stats {
        gap: 20px;
    }

    .game-status {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .color-options {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .betting-controls {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.5rem;
    }

    .round-info h2 {
        font-size: 1.5rem;
    }

    .timer {
        font-size: 1.2rem;
    }

    .color-circle {
        width: 60px;
        height: 60px;
    }

    .spinning-wheel {
        width: 150px;
        height: 150px;
    }
}