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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f0f13;
    color: #e0e0e0;
    min-height: 100vh;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #2a2a3a;
    margin-bottom: 1.5rem;
}

header h1 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
}

#connection-status {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    background: #2a2a3a;
}

#connection-status.connected {
    background: #1a4a2a;
    color: #4ade80;
}

#connection-status.disconnected {
    background: #4a1a1a;
    color: #f87171;
}

#connection-status.connecting {
    background: #4a3a1a;
    color: #fbbf24;
}

main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

section {
    background: #1a1a24;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid #2a2a3a;
}

section h2 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-bottom: 0.8rem;
}

#video-section {
    grid-row: span 2;
}

#robot-video {
    width: 100%;
    border-radius: 8px;
    background: #000;
    aspect-ratio: 16/9;
    object-fit: contain;
}

#audio-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

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

.btn-danger.active {
    background: #16a34a;
}

.btn-danger:hover {
    opacity: 0.9;
}

#speaker-btn {
    background: #6366f1;
    color: white;
}

#speaker-btn.active {
    background: #22c55e;
}

#speaker-btn:hover {
    opacity: 0.9;
}

#vumeter {
    flex: 1;
    height: 8px;
    background: #2a2a3a;
    border-radius: 4px;
    overflow: hidden;
}

#vumeter-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #22c55e, #eab308, #ef4444);
    border-radius: 4px;
    transition: width 0.1s;
}

#telemetry-data {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.telemetry-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.4rem 0;
    border-bottom: 1px solid #2a2a3a;
}

.telemetry-row .label {
    color: #888;
    font-size: 0.85rem;
}

.telemetry-row .value {
    color: #e0e0e0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    text-align: right;
    max-width: 60%;
}

pre.value {
    white-space: pre-wrap;
    word-break: break-all;
}

#robot-audio {
    display: none;
}

/* Ses overlay */
#audio-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

#audio-overlay.visible {
    display: flex;
}

#audio-overlay-content {
    text-align: center;
    padding: 2rem;
}

.speaker-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

#audio-overlay-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

#audio-overlay-content p {
    color: #888;
    margin-bottom: 1.5rem;
}

#audio-start-btn {
    font-size: 1.1rem;
    padding: 0.8rem 2rem;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
    #video-section {
        grid-row: auto;
    }
}
