* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
}

body {
    background: linear-gradient(135deg, #1F4E79, #2980B9);
    min-height: 100vh;
    overflow: hidden;
}

.game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    background: #ECF0F1;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Header Styles */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #F4D03F, #F7DC6F);
    border-bottom: 3px solid #D4AC0D;
    border-radius: 8px 8px 0 0;
}

.title-section h1 {
    color: #7D6608;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 4px;
}

.weather {
    font-size: 12px;
    color: #B7950B;
}

.score-section {
    display: flex;
    gap: 20px;
}

.score-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    color: #7D6608;
}

.controls-section {
    display: flex;
    gap: 8px;
}

.control-btn {
    background: #34495E;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: #2C3E50;
}

.control-btn.active {
    background: #E74C3C;
}

/* Main Game Area */
.game-main {
    display: flex;
    flex: 1;
    min-height: 0;
}

.side-panel {
    width: 250px;
    background: #BDC3C7;
    padding: 16px;
    border-right: 2px solid #95A5A6;
    overflow-y: auto;
}

.panel-section {
    margin-bottom: 20px;
    background: white;
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.panel-section h3 {
    color: #2C3E50;
    font-size: 14px;
    margin-bottom: 10px;
    border-bottom: 1px solid #ECF0F1;
    padding-bottom: 6px;
}

.line-colors {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.color-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #BDC3C7;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-btn:hover,
.color-btn.active {
    border-color: #2C3E50;
    transform: scale(1.1);
}

.tram-info,
.station-details,
.budget-info {
    font-size: 12px;
    color: #2C3E50;
}

.tram-count,
.budget-info div {
    margin-bottom: 8px;
}

.action-btn {
    background: #27AE60;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    width: 100%;
    transition: background 0.2s ease;
}

.action-btn:hover {
    background: #229954;
}

.action-btn:disabled {
    background: #95A5A6;
    cursor: not-allowed;
}

/* Canvas Area */
.canvas-container {
    flex: 1;
    position: relative;
    background: #1F4E79;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    cursor: crosshair;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.canvas-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 11px;
    pointer-events: none;
}

/* Bottom Toolbar */
.bottom-toolbar {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: #34495E;
    border-top: 2px solid #2C3E50;
    border-radius: 0 0 8px 8px;
}

.tool-btn {
    background: #7F8C8D;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    min-width: 80px;
}

.tool-btn:hover {
    background: #95A5A6;
}

.tool-btn.active {
    background: #E67E22;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        gap: 8px;
        padding: 8px 12px;
    }
    
    .score-section {
        gap: 8px;
    }
    
    .score-item {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .side-panel {
        width: 200px;
        padding: 8px;
    }
    
    .panel-section {
        padding: 8px;
        margin-bottom: 12px;
    }
    
    .bottom-toolbar {
        padding: 8px 12px;
        flex-wrap: wrap;
    }
    
    .tool-btn {
        font-size: 10px;
        padding: 8px 12px;
        min-width: 60px;
    }
}

/* Animations */
@keyframes tramMove {
    0% { transform: translateX(-2px); }
    50% { transform: translateX(2px); }
    100% { transform: translateX(-2px); }
}

.tram-moving {
    animation: tramMove 0.5s ease-in-out infinite;
}

@keyframes stationPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.station-active {
    animation: stationPulse 1s ease-in-out infinite;
}

/* Pixel Art Styling */
.pixel-perfect {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}