/* City Builder Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #87CEEB 0%, #98FB98 100%);
    color: #2c3e50;
    min-height: 100vh;
    padding: 20px;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(135, 206, 235, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(152, 251, 152, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(255, 255, 224, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    background: linear-gradient(45deg, #ff6b6b, #ffd93d, #6bcf7f, #4d96ff);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

header p {
    font-size: 1.2em;
    opacity: 0.8;
}

.game-area {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    margin-bottom: 30px;
}

.city-grid-container {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.city-grid {
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    grid-template-rows: repeat(15, 1fr);
    gap: 1px;
    background: #34495e;
    border: 2px solid #2c3e50;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 4/3;
    max-width: 100%;
}

.grid-cell {
    background: #27ae60;
    border: 1px solid #229954;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    transition: all 0.2s ease;
    position: relative;
}

.grid-cell:hover {
    background: #2ecc71;
    transform: scale(1.1);
    z-index: 10;
}

.grid-cell.empty:hover {
    background: #f39c12;
}

.grid-cell.selected {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.8); }
    50% { box-shadow: 0 0 15px rgba(255, 215, 0, 1); }
    100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.8); }
}

.grid-cell.residential { background: #e74c3c; }
.grid-cell.commercial { background: #f39c12; }
.grid-cell.industrial { background: #9b59b6; }
.grid-cell.power { background: #f1c40f; }
.grid-cell.water { background: #3498db; }
.grid-cell.park { background: #27ae60; }
.grid-cell.hospital { background: #e91e63; }
.grid-cell.school { background: #ff9800; }

.control-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.building-selection, .city-stats {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.building-selection h3, .city-stats h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.building-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 15px;
}

.building-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

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

.building-btn.active {
    background: linear-gradient(135deg, #ffd93d, #ff6b6b);
    animation: buildingGlow 2s infinite;
}

@keyframes buildingGlow {
    0%, 100% { box-shadow: 0 2px 10px rgba(255, 217, 61, 0.4); }
    50% { box-shadow: 0 2px 15px rgba(255, 217, 61, 0.8); }
}

.cost {
    position: absolute;
    top: 5px;
    right: 8px;
    font-size: 0.7em;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
}

.tool-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.tool-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tool-btn:hover {
    background: #7f8c8d;
    transform: translateY(-1px);
}

.tool-btn.active {
    background: #3498db;
}

.stat-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: bold;
    color: #2c3e50;
}

.stat-value {
    font-weight: bold;
    color: #e74c3c;
}

.stat-value.positive { color: #27ae60; }
.stat-value.warning { color: #f39c12; }
.stat-value.danger { color: #e74c3c; }

.game-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.game-controls button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.game-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 300px;
}

.notification {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-left: 4px solid #3498db;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success { border-left-color: #27ae60; }
.notification.warning { border-left-color: #f39c12; }
.notification.error { border-left-color: #e74c3c; }

.instructions {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.instructions h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.instructions ul {
    list-style: none;
    padding: 0;
}

.instructions li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.instructions li:before {
    content: "🏗️";
    position: absolute;
    left: 0;
    color: #f39c12;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .game-area {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .city-grid {
        grid-template-columns: repeat(15, 1fr);
        grid-template-rows: repeat(12, 1fr);
    }
}

@media (max-width: 768px) {
    .city-grid {
        grid-template-columns: repeat(12, 1fr);
        grid-template-rows: repeat(10, 1fr);
    }

    .building-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .tool-buttons {
        grid-template-columns: repeat(3, 1fr);
    }

    .game-controls {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 2em;
    }
}

@media (max-width: 480px) {
    .city-grid {
        grid-template-columns: repeat(10, 1fr);
        grid-template-rows: repeat(8, 1fr);
    }

    .building-buttons {
        grid-template-columns: 1fr;
    }

    .tool-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .tool-buttons button:last-child {
        grid-column: span 2;
    }
}