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

.input-panel, .fusion-panel, .result-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;
}

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

.modality-box {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    background: #f8f9fa;
}

.modality-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.modality-icon {
    font-size: 1.5em;
}

.modality-title {
    font-weight: 600;
    color: #333;
}

#visionCanvas, #audioCanvas {
    display: block;
    width: 100%;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    margin-bottom: 10px;
}

#textInput {
    width: 100%;
    height: 280px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95em;
    resize: none;
    margin-bottom: 10px;
}

#textInput:focus {
    outline: none;
    border-color: #667eea;
}

.modality-controls {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.draw-btn, .preset-btn, .audio-btn {
    flex: 1;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s;
}

.draw-btn:hover, .preset-btn:hover, .audio-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.draw-btn.active, .audio-btn.active {
    background: #48bb78;
    color: white;
    border-color: #48bb78;
}

.fusion-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.encoder-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
}

.encoder-box {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.encoder-title {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 10px;
    text-align: center;
}

.feature-viz {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 60px;
}

.feature-bar {
    width: 8px;
    background: linear-gradient(to top, #667eea, #764ba2);
    border-radius: 2px;
    transition: height 0.3s;
}

.fusion-arrow {
    font-size: 2em;
    color: #667eea;
}

.fusion-method {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #e8f5e9 0%, #e3f2fd 100%);
    border-radius: 10px;
    border: 2px solid #48bb78;
}

.method-title {
    font-weight: 600;
    color: #2f855a;
    margin-bottom: 8px;
    text-align: center;
}

.method-content {
    text-align: center;
    color: #666;
    font-size: 0.9em;
}

.output-section {
    width: 100%;
}

.output-box {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.output-title {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 10px;
    text-align: center;
}

#fusionCanvas {
    display: block;
    width: 100%;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

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

.result-display {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    min-height: 100px;
    margin-bottom: 15px;
}

.result-placeholder {
    text-align: center;
    color: #999;
    padding: 30px;
}

.result-content {
    font-size: 1.1em;
    line-height: 1.8;
    color: #333;
}

.confidence-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.confidence-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.confidence-label {
    width: 100px;
    font-weight: 600;
    color: #333;
}

.confidence-bar {
    flex: 1;
    height: 25px;
    background: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #48bb78, #38a169);
    transition: width 0.5s;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    color: white;
    font-size: 0.85em;
    font-weight: 600;
}

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

.task-section, .method-section, .weight-section, .examples-section, .score-section {
    margin-bottom: 20px;
}

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

.task-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.task-btn:hover {
    background: #e8f5e9;
    border-color: #48bb78;
}

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

.task-icon {
    font-size: 2em;
}

.task-info {
    flex: 1;
}

.task-name {
    font-weight: 600;
    margin-bottom: 3px;
}

.task-desc {
    font-size: 0.85em;
    opacity: 0.8;
}

.select-box {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    cursor: pointer;
}

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

.weight-item {
    margin-bottom: 15px;
}

.weight-item label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

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

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

.btn-secondary {
    width: 100%;
    padding: 10px;
    background: #e0e0e0;
    color: #333;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

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

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

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

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

.quality-item {
    margin-bottom: 15px;
}

.quality-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.quality-bar {
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.quality-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.5s;
}

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

.concepts, .methods, .applications, .tips {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.concepts {
    background: #e8f5e9;
    border-left: 4px solid #48bb78;
}

.methods {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.applications {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.tips {
    background: #f3e5f5;
    border-left: 4px solid #9c27b0;
}

.concepts h4, .methods h4, .applications h4, .tips h4 {
    margin-bottom: 10px;
    font-size: 1.1em;
}

.concepts h4 {
    color: #2f855a;
}

.methods h4 {
    color: #1976d2;
}

.applications h4 {
    color: #856404;
}

.tips h4 {
    color: #7b1fa2;
}

.concepts p, .methods p, .applications p {
    margin: 5px 0;
    font-size: 0.9em;
    line-height: 1.6;
}

.tips ul {
    margin-left: 20px;
    margin-top: 10px;
}

.tips li {
    margin: 5px 0;
    font-size: 0.9em;
    line-height: 1.6;
}

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