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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #2c5530, #1a3a1a);
    color: #fff;
    min-height: 100vh;
    overflow-x: auto;
}

.game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px;
}

.game-header {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #8B4513;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    text-align: center;
}

.game-header h1 {
    font-size: 28px;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
}

.status-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.stat {
    background: rgba(139, 69, 19, 0.7);
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #A0522D;
    font-weight: bold;
    white-space: nowrap;
}

#pauseBtn {
    background: #4169E1;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
}

#pauseBtn:hover {
    background: #1E90FF;
}

.game-layout {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.left-panel, .right-panel {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #8B4513;
    border-radius: 8px;
    padding: 15px;
    min-height: 800px;
}

.left-panel {
    width: 280px;
    flex-shrink: 0;
}

.right-panel {
    width: 220px;
    flex-shrink: 0;
}

.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.9);
    border: 3px solid #FFD700;
    border-radius: 12px;
    padding: 10px;
}

#pinballCanvas {
    border: 2px solid #8B4513;
    border-radius: 8px;
    background: #2a5a2a;
    display: block;
}

.controls-help {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #CCC;
    line-height: 1.4;
}

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

.panel-section h3 {
    color: #FFD700;
    font-size: 16px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #8B4513;
}

.cities-list {
    max-height: 120px;
    overflow-y: auto;
}

.city-item {
    background: rgba(139, 69, 19, 0.3);
    padding: 8px;
    margin: 5px 0;
    border-radius: 4px;
    border-left: 3px solid #FFD700;
    font-size: 14px;
}

.no-cities {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px 10px;
}

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

.wonder {
    background: rgba(139, 69, 19, 0.2);
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #8B4513;
}

.wonder-name {
    font-size: 14px;
    margin-bottom: 5px;
    color: #FFD700;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #666;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.resources {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.resource {
    background: rgba(139, 69, 19, 0.3);
    padding: 8px;
    border-radius: 4px;
    border-left: 3px solid #4ECDC4;
    font-size: 14px;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.tech-item {
    background: rgba(139, 69, 19, 0.2);
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #8B4513;
    text-align: center;
    font-size: 12px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.tech-item.researched {
    opacity: 1;
    background: rgba(255, 215, 0, 0.2);
    border-color: #FFD700;
    color: #FFD700;
}

.achievements {
    font-size: 13px;
    line-height: 1.6;
}

.achievement {
    padding: 8px;
    margin: 5px 0;
    background: rgba(139, 69, 19, 0.2);
    border-radius: 4px;
    border-left: 3px solid #666;
    transition: all 0.3s ease;
}

.achievement.achieved {
    border-left-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.advisor-section {
    border-top: 2px solid #8B4513;
    padding-top: 15px;
}

.advisor {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.advisor-portrait-wrapper {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.advisor-portrait {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #8B4513;
    flex-shrink: 0;
}

.advisor-portrait-fallback {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #8B4513;
    background: rgba(139, 69, 19, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #FFD700;
}

.advisor-text {
    font-size: 12px;
    line-height: 1.4;
    color: #DDD;
    font-style: italic;
    background: rgba(139, 69, 19, 0.2);
    padding: 8px;
    border-radius: 4px;
    border-left: 3px solid #FFD700;
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, #2c5530, #1a3a1a);
    border: 3px solid #FFD700;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.modal-content h2 {
    color: #FFD700;
    font-size: 28px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.modal-content p {
    margin: 10px 0;
    font-size: 18px;
}

.modal-content button {
    background: #4169E1;
    color: white;
    border: none;
    padding: 12px 24px;
    margin: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    font-weight: bold;
    transition: background 0.3s ease;
}

.modal-content button:hover {
    background: #1E90FF;
}

.footer {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
    border-top: 1px solid #666;
    margin-top: 20px;
}

.footer a {
    color: #4ECDC4;
    text-decoration: none;
}

.footer a:hover {
    color: #FFD700;
}

/* Responsive design */
@media (max-width: 1200px) {
    .game-layout {
        flex-direction: column;
    }
    
    .left-panel, .right-panel {
        width: 100%;
        min-height: auto;
    }
    
    .game-area {
        order: -1;
    }
    
    #pinballCanvas {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 768px) {
    .game-header h1 {
        font-size: 20px;
    }
    
    .status-bar {
        gap: 10px;
    }
    
    .stat {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .game-container {
        padding: 5px;
    }
    
    .left-panel, .right-panel {
        padding: 10px;
    }
    
    .controls-help {
        font-size: 11px;
    }
}

/* Scrollbar styling for Civ2 feel */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(139, 69, 19, 0.2);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: #8B4513;
    border-radius: 6px;
    border: 1px solid #A0522D;
}

::-webkit-scrollbar-thumb:hover {
    background: #A0522D;
}

/* Animation for achieved elements */
@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(76, 175, 80, 0.5); }
    50% { box-shadow: 0 0 20px rgba(76, 175, 80, 0.8); }
}

.achievement.achieved {
    animation: glow 2s ease-in-out;
}

/* Retro button effects */
button {
    position: relative;
    overflow: hidden;
}

button:active {
    transform: translateY(1px);
}

button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

button:hover::after {
    left: 100%;
}