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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #2c3e50, #3498db);
    overflow: hidden;
}

#scene-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

#ui-overlay > * {
    pointer-events: auto;
}

#game-info {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.player-panel h3 {
    margin-bottom: 10px;
    color: #f39c12;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.resources {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.resource {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.resource:hover {
    transform: translateY(-2px);
}

.victory-points {
    font-weight: bold;
    color: #e74c3c;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

#ai-players {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ai-player {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 12px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    min-width: 200px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.ai-player:hover {
    transform: translateX(-5px);
}

.ai-avatar {
    font-size: 24px;
    text-align: center;
    margin-bottom: 5px;
}

.ai-name {
    font-weight: bold;
    text-align: center;
    color: #3498db;
    margin-bottom: 5px;
}

.ai-vp {
    text-align: center;
    font-size: 12px;
    color: #ecf0f1;
}

.ai-speech {
    margin-top: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    font-style: italic;
    font-size: 12px;
    min-height: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-left: 3px solid #f39c12;
}

#game-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
}

.primary-btn, .secondary-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.primary-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.secondary-btn {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
}

.secondary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 73, 94, 0.4);
}

#dice-result {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
}

.dice-display {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(10px);
}

.die {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.total {
    color: white;
    font-weight: bold;
    font-size: 18px;
}

#trade-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 25px;
    border-radius: 15px;
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    min-width: 400px;
}

#trade-panel h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #f39c12;
}

.trade-offer {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.give-section, .get-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
}

.give-section h4, .get-section h4 {
    margin-bottom: 10px;
    color: #3498db;
}

.resource-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.resource-selector button {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.resource-selector button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.trade-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.trade-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

#propose-trade {
    background: #27ae60;
    color: white;
}

#propose-trade:hover {
    background: #2ecc71;
    transform: translateY(-2px);
}

#cancel-trade {
    background: #e74c3c;
    color: white;
}

#cancel-trade:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.hidden {
    display: none !important;
}

/* Responsive design */
@media (max-width: 768px) {
    #game-info {
        top: 10px;
        left: 10px;
        padding: 10px;
        font-size: 14px;
    }
    
    #ai-players {
        top: 10px;
        right: 10px;
    }
    
    .ai-player {
        min-width: 150px;
        padding: 8px;
    }
    
    #game-controls {
        bottom: 10px;
        flex-direction: column;
        align-items: center;
    }
    
    .primary-btn, .secondary-btn {
        padding: 10px 15px;
        font-size: 12px;
    }
    
    #trade-panel {
        min-width: 300px;
        padding: 20px;
    }
}

/* Animations */
@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(243, 156, 18, 0.5); }
    50% { box-shadow: 0 0 20px rgba(243, 156, 18, 0.8); }
}

.resource:hover {
    animation: glow 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.die:hover {
    animation: bounce 0.6s;
}