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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
    padding: 10px;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

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

.title {
    text-align: center;
    color: white;
    font-size: 2.5em;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Waiting Screen */
#name-input-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
}

#player-name {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    border: 2px solid #667eea;
    border-radius: 10px;
    margin-bottom: 15px;
    outline: none;
}

#player-name:focus {
    border-color: #764ba2;
}

.btn {
    padding: 12px 20px;
    font-size: 1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    margin: 3px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
    padding: 15px;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    width: 100%;
    padding: 15px;
}

.btn-secondary {
    background: linear-gradient(135deg, #868f96 0%, #596164 100%);
    color: white;
    width: 100%;
    padding: 15px;
    margin-bottom: 10px;
}

.btn-buy, .btn-buy-max {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-sell, .btn-sell-all {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.btn-done {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
    width: 100%;
    margin-top: 10px;
    padding: 15px;
}

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

#waiting-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    margin-top: 20px;
    text-align: center;
}

#players-list {
    list-style: none;
    padding: 20px;
}

#players-list li {
    background: #f0f0f0;
    padding: 10px;
    margin: 5px 0;
    border-radius: 8px;
    font-size: 1.1em;
}

/* Game Screen */
.game-header {
    background: white;
    padding: 10px 15px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    margin-bottom: 10px;
    text-align: center;
}

.game-header h2 {
    font-size: 1.2em;
    color: #667eea;
    margin: 0;
}

/* Dice Display */
.dice-container {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    margin-bottom: 10px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.stock-price-display {
    background: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    margin-bottom: 10px;
    text-align: center;
    font-size: 1.3em;
    font-weight: bold;
    color: #11998e;
}

.dice {
    font-size: 3em;
    padding: 10px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

/* Player Stats */
.player-stats {
    margin-bottom: 10px;
}

.stat-box-compact {
    background: white;
    padding: 12px 15px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 10px;
}

.stat-item {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
}

.stat-item span {
    color: #667eea;
}

/* Stock Slider */
.slider-container {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    margin-bottom: 10px;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #666;
    margin-bottom: 5px;
}

#stock-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
    background: linear-gradient(to right, #fa709a 0%, #f0f0f0 50%, #4facfe 100%);
}

#stock-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

#stock-slider::-moz-range-thumb {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.slider-preview {
    margin-top: 10px;
    text-align: center;
}

#slider-action {
    font-size: 1.2em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

#slider-details {
    font-size: 0.9em;
    color: #666;
}

/* Charts */
.chart-container {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    margin-bottom: 10px;
    max-height: 200px;
}

.chart-container canvas {
    max-height: 170px;
}

/* Status Screen */
.status-info {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.status-section {
    margin-bottom: 25px;
}

.status-section:last-child {
    margin-bottom: 0;
}

.status-section h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.status-detail {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-size: 1.1em;
}

.status-detail:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: bold;
    color: #555;
}

.detail-value {
    color: #667eea;
    font-weight: 600;
}

.player-status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.player-status-item.done {
    border-left-color: #28a745;
    background: #d4edda;
}

.player-status-item.waiting {
    border-left-color: #ffc107;
    background: #fff3cd;
}

.player-status-name {
    font-weight: bold;
    font-size: 1.1em;
}

.player-status-info {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
}

.player-status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.player-status-badge.done {
    background: #28a745;
    color: white;
}

.player-status-badge.waiting {
    background: #ffc107;
    color: #333;
}

/* Results Screen */
.rankings {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.rankings h2 {
    text-align: center;
    color: #667eea;
    margin-bottom: 20px;
}

.ranking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin: 10px 0;
    border-radius: 10px;
    background: #f8f9fa;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.ranking-item.rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    font-size: 1.2em;
}

.ranking-item.rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
}

.ranking-item.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #e8a87c 100%);
}

.rank-position {
    font-weight: bold;
    font-size: 1.5em;
    margin-right: 15px;
}

.rank-name {
    flex-grow: 1;
    font-weight: bold;
}

.rank-networth {
    font-weight: bold;
    color: #667eea;
}

.results-message {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    text-align: center;
    font-size: 1.2em;
    color: #666;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .title {
        font-size: 1.8em;
    }
    
    .game-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .dice {
        font-size: 3em;
        margin: 5px;
        padding: 15px;
        min-width: 60px;
    }
    
    .stock-price-display {
        font-size: 1.5em;
    }
    
    .stat-value {
        font-size: 1.4em;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .player-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .container {
        padding: 10px;
    }
    
    .title {
        font-size: 1.5em;
        margin-bottom: 20px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 1em;
    }
    
    .dice {
        font-size: 2.5em;
        padding: 10px;
        min-width: 50px;
    }
}
