* {
    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: 1600px;
    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;
}

.main-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.network-canvas, .training-panel, .data-panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

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

canvas {
    width: 100%;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #f8f9fa;
}

#networkCanvas {
    height: 300px;
}

#lossCanvas {
    height: 200px;
}

#dataCanvas {
    height: 250px;
}

.layer-info, .data-info {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.9em;
    color: #666;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.metric-item {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
}

.metric-label {
    display: block;
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
}

.metric-value {
    display: block;
    font-size: 1.2em;
    font-weight: bold;
    color: #667eea;
    font-family: 'Courier New', monospace;
}

.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: 900px;
}

.task-section, .layer-builder, .example-networks, .layer-config, .training-config, .architecture-list {
    margin-bottom: 20px;
}

select, input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95em;
}

select:focus, input:focus {
    outline: none;
    border-color: #667eea;
}

.layer-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.example-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.layer-btn, .example-btn {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9em;
}

.layer-btn:hover, .example-btn:hover {
    border-color: #667eea;
    background: #f8f9fa;
    transform: translateY(-2px);
}

.example-btn {
    background: linear-gradient(135deg, #f8f9fa 0%, #e8f5e9 100%);
    border-color: #48bb78;
    font-weight: 600;
}

.example-btn:hover {
    background: linear-gradient(135deg, #e8f5e9 0%, #d4edda 100%);
    border-color: #38a169;
}

.config-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.config-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.config-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    outline: none;
    border-radius: 3px;
}

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

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

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

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

.btn-primary {
    background: #667eea;
    color: white;
}

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

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

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

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

.btn-danger:hover {
    background: #4a5568;
}

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

#layerList {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.layer-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.layer-name {
    font-weight: 600;
    color: #333;
}

.layer-params {
    font-size: 0.85em;
    color: #666;
    font-family: 'Courier New', monospace;
}

.layer-remove {
    padding: 4px 8px;
    background: #f56565;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
}

.layer-remove:hover {
    background: #e53e3e;
}

.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;
    margin-bottom: 20px;
}

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

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

.tutorial strong {
    color: #667eea;
}

.tips {
    background: #e8f5e9;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #48bb78;
    margin-bottom: 15px;
}

.tips h4 {
    color: #2f855a;
    margin-bottom: 10px;
}

.tips p {
    margin: 5px 0;
    color: #2f855a;
    font-size: 0.9em;
}

.examples-info {
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

.examples-info h4 {
    color: #856404;
    margin-bottom: 10px;
}

.examples-info p {
    margin: 5px 0;
    color: #856404;
    font-size: 0.9em;
}

@media (max-width: 1200px) {
    .game-area {
        grid-template-columns: 1fr;
    }
}
