* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
    background: #16213e;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

h1 {
    text-align: center;
    color: #f39c12;
    margin-bottom: 30px;
    font-size: 2em;
}

.phase-info {
    background: #0f3460;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.phase-name {
    font-size: 1.5em;
    color: #3498db;
    margin-bottom: 10px;
}

.phase-progress {
    width: 100%;
    height: 10px;
    background: #2c3e50;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 15px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    transition: width 0.5s ease;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.status-card {
    background: #0f3460;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.status-label {
    font-size: 0.9em;
    color: #95a5a6;
    margin-bottom: 5px;
}

.status-value {
    font-size: 1.3em;
    font-weight: bold;
    color: #2ecc71;
}

.sound-display {
    background: #000;
    border: 2px solid #0f3460;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 300px;
    position: relative;
    overflow: hidden;
}

#waveform {
    width: 100%;
    height: 200px;
    margin-bottom: 20px;
}

.interaction-log {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
}

.log-entry {
    padding: 8px;
    margin: 5px 0;
    border-radius: 8px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.child-sound { background: rgba(46, 204, 113, 0.2); border-left: 4px solid #2ecc71; }
.teacher-sound { background: rgba(52, 152, 219, 0.2); border-left: 4px solid #3498db; }
.system-msg { background: rgba(241, 196, 15, 0.2); border-left: 4px solid #f1c40f; text-align: center; font-style: italic; }

.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #3498db;
    color: white;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.primary-btn { background: #2ecc71; }
.danger-btn { background: #e74c3c; }
#microphoneBtn { background: #9b59b6; }

.recording { animation: pulse 1s infinite; }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(155, 89, 182, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(155, 89, 182, 0); }
    100% { box-shadow: 0 0 0 0 rgba(155, 89, 182, 0); }
}

.hidden { display: none; }

@media (max-width: 600px) {
    .controls { flex-direction: column; }
    button { width: 100%; }
}
