* {
    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%);
    min-height: 100vh;
    padding: 20px;
}

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

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

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

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

.canvas-container {
    position: relative;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#terrainCanvas {
    width: 100%;
    height: 600px;
    border-radius: 10px;
    cursor: crosshair;
}

.gradient-arrow {
    position: absolute;
    width: 60px;
    height: 60px;
    pointer-events: none;
    display: none;
}

.control-panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    overflow-y: auto;
    max-height: 640px;
}

.info-section, .control-section, .level-section {
    margin-bottom: 25px;
}

h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 5px;
}

.info-grid {
    display: grid;
    gap: 10px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

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

.value {
    font-family: 'Courier New', monospace;
    color: #667eea;
    font-weight: bold;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.control-group select,
.control-group input[type="range"] {
    width: 100%;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

.control-group select:focus {
    outline: none;
    border-color: #667eea;
}

input[type="range"] {
    height: 6px;
    background: #e0e0e0;
    outline: none;
    padding: 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #667eea;
    cursor: pointer;
    border-radius: 50%;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #667eea;
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

.btn-primary {
    background: #667eea;
    color: white;
    grid-column: 1 / -1;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #48bb78;
    color: white;
}

.btn-secondary:hover {
    background: #38a169;
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
}

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

.level-grid {
    display: grid;
    gap: 10px;
}

.level-btn {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    text-align: left;
}

.level-btn:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.level-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.level-btn.completed {
    border-color: #48bb78;
    background: #48bb78;
    color: white;
}

.tutorial {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.tutorial h3 {
    color: #667eea;
    margin-bottom: 15px;
}

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

.tutorial li {
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.tutorial li:last-child {
    border-bottom: none;
}

.tutorial strong {
    color: #667eea;
}

@media (max-width: 1024px) {
    .game-area {
        grid-template-columns: 1fr;
    }
    
    #terrainCanvas {
        height: 400px;
    }
}
