* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Helvetica', sans-serif;
    background: linear-gradient(135deg, #1a472a 0%, #0d2818 100%);
    color: #fff;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #d4af37 0%, #aa8b2e 100%);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    border: 3px solid #f4d03f;
}

header h1 {
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    color: #1a1a1a;
    letter-spacing: 3px;
}

.header-stats {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.stat-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 30px;
    border-radius: 8px;
    border: 2px solid #f4d03f;
}

.stat-box .stat-label {
    font-size: 0.9em;
    color: #f4d03f;
    display: block;
}

.stat-box .stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #fff;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 20px;
    margin-bottom: 20px;
}

/* Stats Panel (Left) */
.stats-panel {
    background: rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #d4af37;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.stat-section {
    margin-bottom: 25px;
}

.stat-section h2 {
    font-size: 1.1em;
    color: #d4af37;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 8px;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 0.95em;
    color: #ccc;
}

.stat-value {
    font-weight: bold;
    font-size: 1.1em;
    color: #fff;
}

.stat-percent {
    font-size: 0.9em;
    color: #d4af37;
    min-width: 50px;
    text-align: right;
}

.red-text {
    color: #ff4444 !important;
}

.black-text {
    color: #fff !important;
}

.green-text {
    color: #00ff88 !important;
}

.streak {
    color: #00ff88 !important;
    font-size: 0.9em !important;
}

/* Board Panel (Center) */
.board-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.roulette-board {
    background: linear-gradient(135deg, #1a5c2e 0%, #0f3d1f 100%);
    padding: 25px;
    border-radius: 10px;
    border: 3px solid #d4af37;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

.board-header {
    text-align: center;
    margin-bottom: 20px;
}

.board-header h2 {
    font-size: 1.3em;
    color: #d4af37;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.selected-display {
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #d4af37;
}

.selected-display span {
    font-size: 3em;
    font-weight: bold;
    color: #fff;
}

/* Board Grid */
.board-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3px;
    margin-bottom: 20px;
}

.numbers-grid {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.number-row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 3px;
}

.number-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    user-select: none;
}

.number-cell.red {
    background: linear-gradient(135deg, #d32f2f 0%, #9a0007 100%);
    color: #fff;
}

.number-cell.black {
    background: linear-gradient(135deg, #424242 0%, #1a1a1a 100%);
    color: #fff;
}

.number-cell.green {
    background: linear-gradient(135deg, #00a651 0%, #006837 100%);
    color: #fff;
    font-size: 1.5em;
}

.zero-column {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.zero-column .number-cell {
    flex: 1;
    padding: 5px 15px;
    font-size: 1.3em;
    writing-mode: horizontal-tb;
    min-width: 50px;
}

.number-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.6);
    border-color: #ffd700;
}

.number-cell.selected {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.9);
    border: 3px solid #ffd700;
    z-index: 10;
}

.number-cell:active {
    transform: scale(0.98);
}

/* Board Actions */
.board-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    padding: 15px 35px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-submit {
    background: linear-gradient(135deg, #00a651 0%, #006837 100%);
    color: #fff;
    border: 2px solid #00ff88;
}

.btn-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #00cc66 0%, #008844 100%);
    box-shadow: 0 6px 16px rgba(0, 255, 136, 0.4);
    transform: translateY(-2px);
}

.btn-submit:disabled {
    background: #555;
    border-color: #777;
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-clear {
    background: linear-gradient(135deg, #757575 0%, #424242 100%);
    color: #fff;
    border: 2px solid #999;
}

.btn-clear:hover {
    background: linear-gradient(135deg, #888 0%, #555 100%);
    transform: translateY(-2px);
}

.btn-fullscreen {
    background: linear-gradient(135deg, #1976d2 0%, #0d47a1 100%);
    color: #fff;
    border: 2px solid #42a5f5;
    width: 100%;
    margin-bottom: 10px;
}

.btn-fullscreen:hover {
    background: linear-gradient(135deg, #2196f3 0%, #1565c0 100%);
    box-shadow: 0 6px 16px rgba(66, 165, 245, 0.4);
    transform: translateY(-2px);
}

.btn-reset {
    background: linear-gradient(135deg, #d32f2f 0%, #9a0007 100%);
    color: #fff;
    border: 2px solid #ff4444;
    width: 100%;
}

.btn-reset:hover {
    background: linear-gradient(135deg, #e53935 0%, #b71c1c 100%);
    box-shadow: 0 6px 16px rgba(255, 68, 68, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(135deg, #d4af37 0%, #aa8b2e 100%);
    color: #1a1a1a;
    border: 2px solid #f4d03f;
    padding: 12px 30px;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #f4d03f 0%, #d4af37 100%);
    transform: translateY(-2px);
}

/* Recent History */
.recent-history {
    background: rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #d4af37;
}

.total-spins-display {
    margin-top: 15px;
    text-align: center;
    padding: 10px;
    background: rgba(212, 175, 55, 0.2);
    border-radius: 6px;
    border: 1px solid #d4af37;
}

.total-spins-display .stat-label {
    color: #d4af37;
    font-size: 0.95em;
    margin-right: 10px;
}

.total-spins-display .stat-value {
    color: #fff;
    font-size: 1.3em;
    font-weight: bold;
}

.last-spin-details {
    margin-top: 10px;
    text-align: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(212, 175, 55, 0.5);
    font-size: 0.9em;
    line-height: 1.6;
    color: #ccc;
}

.last-spin-details .detail-label {
    font-weight: bold;
    color: #d4af37;
    font-size: 1em;
}

.last-spin-details > div > .detail-label {
    font-size: 1.5em;
    letter-spacing: 1px;
}

.last-spin-details .detail-item {
    display: inline;
    margin: 0 8px;
}

.recent-history h3 {
    color: #d4af37;
    margin-bottom: 15px;
    text-align: center;
    letter-spacing: 1px;
}

.recent-numbers {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    min-height: 50px;
    align-items: center;
}

.recent-number {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.1em;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.recent-number.red {
    background: linear-gradient(135deg, #d32f2f 0%, #9a0007 100%);
    color: #fff;
}

.recent-number.black {
    background: linear-gradient(135deg, #424242 0%, #1a1a1a 100%);
    color: #fff;
}

.recent-number.green {
    background: linear-gradient(135deg, #00a651 0%, #006837 100%);
    color: #fff;
}

.recent-number.most-recent {
    border: 3px solid #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 215, 0, 1);
        transform: scale(1.1);
    }
}

/* Hot/Cold Panel (Right) */
.hot-cold-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hot-numbers, .cold-numbers {
    background: rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #d4af37;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.hot-numbers h2, .cold-numbers h2 {
    font-size: 1.1em;
    color: #d4af37;
    margin-bottom: 15px;
    text-align: center;
    letter-spacing: 1px;
}

.number-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 150px;
}

.number-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.number-badge {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1em;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.number-badge.red {
    background: linear-gradient(135deg, #d32f2f 0%, #9a0007 100%);
    color: #fff;
}

.number-badge.black {
    background: linear-gradient(135deg, #424242 0%, #1a1a1a 100%);
    color: #fff;
}

.number-badge.green {
    background: linear-gradient(135deg, #00a651 0%, #006837 100%);
    color: #fff;
}

.hit-count {
    font-size: 1.1em;
    font-weight: bold;
    color: #d4af37;
}

.no-data {
    color: #888;
    text-align: center;
    font-style: italic;
    padding: 20px;
}

/* History Section */
.history-section {
    text-align: center;
    margin-top: 20px;
}

/* 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.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #1a5c2e 0%, #0f3d1f 100%);
    padding: 30px;
    border-radius: 10px;
    border: 3px solid #d4af37;
    max-width: 90%;
    max-height: 80%;
    overflow: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 15px;
}

.modal-header h2 {
    color: #d4af37;
    letter-spacing: 2px;
}

.close-modal {
    background: none;
    border: none;
    color: #fff;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    min-height: 200px;
}

.full-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
}

.history-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.history-number {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.2em;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.history-number.red {
    background: linear-gradient(135deg, #d32f2f 0%, #9a0007 100%);
    color: #fff;
}

.history-number.black {
    background: linear-gradient(135deg, #424242 0%, #1a1a1a 100%);
    color: #fff;
}

.history-number.green {
    background: linear-gradient(135deg, #00a651 0%, #006837 100%);
    color: #fff;
}

.history-time {
    font-size: 0.75em;
    color: #999;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .main-content {
        grid-template-columns: 250px 1fr 250px;
    }
    
    .number-cell {
        font-size: 1.1em;
    }
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .stats-panel, .hot-cold-panel {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
}
