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

.task-panel, .prompt-editor, .response-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;
}

.task-card {
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e8f5e9 100%);
    border-radius: 10px;
    border-left: 4px solid #48bb78;
}

.task-title {
    font-size: 1.3em;
    font-weight: bold;
    color: #2f855a;
    margin-bottom: 10px;
}

.task-desc {
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
}

.task-goal {
    color: #2f855a;
    font-weight: 600;
    padding: 10px;
    background: white;
    border-radius: 6px;
    margin-top: 10px;
}

.editor-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.tool-btn {
    padding: 8px 12px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s;
}

.tool-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

#promptInput {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    font-family: 'Courier New', monospace;
    resize: vertical;
    line-height: 1.6;
}

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

.prompt-stats {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    font-size: 0.9em;
    color: #666;
}

.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);
}

.response-box {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    min-height: 150px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 15px;
    white-space: pre-wrap;
}

.evaluation {
    padding: 15px;
    background: #fff3cd;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    display: none;
}

.evaluation.show {
    display: block;
}

.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;
}

.level-section, .template-section, .tips-section, .score-section {
    margin-bottom: 20px;
}

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

.level-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;
}

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

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

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

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

.level-info {
    flex: 1;
}

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

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

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

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

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

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

.tip-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.tip-icon {
    font-size: 1.2em;
}

.tip-text {
    font-size: 0.9em;
    color: #333;
}

.score-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
}

.score-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

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

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

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #48bb78, #38a169);
    transition: width 0.5s;
}

.total-score {
    padding: 15px;
    background: #667eea;
    color: white;
    border-radius: 8px;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
}

.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;
}

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

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

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

.concepts h4, .examples h4 {
    margin-bottom: 10px;
}

.concepts h4 {
    color: #2f855a;
}

.examples h4 {
    color: #856404;
}

.concepts p, .example-box {
    margin: 5px 0;
    font-size: 0.9em;
}

.concepts p {
    color: #2f855a;
}

.example-box {
    color: #856404;
    line-height: 1.8;
}

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