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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    height: 100vh;
}

.container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 40px 20px;
}

/* Background gradient (matching iOS app) */
.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.3), rgba(175, 82, 222, 0.3));
    z-index: -1;
}

/* Header */
.header {
    text-align: center;
    color: white;
    margin-bottom: 20px;
}

.icon {
    font-size: 60px;
    margin-bottom: 10px;
}

.header h1 {
    font-size: 34px;
    font-weight: 700;
}

/* Content */
.content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 400px;
}

.view {
    width: 100%;
    text-align: center;
    animation: fadeIn 0.3s ease-in;
}

.view.hidden {
    display: none;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 300px;
    padding: 16px 24px;
    font-size: 18px;
    font-weight: 600;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: #007AFF;
}

.btn-primary:hover {
    background: #0051D5;
}

.btn-success {
    background: #34C759;
}

.btn-success:hover {
    background: #28A745;
}

.btn-danger {
    background: #FF3B30;
}

.btn-danger:hover {
    background: #D62828;
}

.btn-icon {
    font-size: 20px;
}

/* Divider */
.divider {
    margin: 20px 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
}

/* Join section */
.join-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

#roomCodeInput {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 4px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    font-weight: 600;
}

#roomCodeInput::placeholder {
    color: rgba(0, 0, 0, 0.4);
    letter-spacing: normal;
}

#roomCodeInput:focus {
    outline: none;
    border-color: #007AFF;
    background: white;
}

/* Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Room code display */
.label {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.room-code {
    font-size: 48px;
    font-weight: 700;
    color: white;
    font-family: 'Courier New', monospace;
    letter-spacing: 8px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    margin: 20px 0;
}

.sublabel {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-bottom: 30px;
}

/* Connected view */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(52, 199, 89, 0.2);
    border-radius: 20px;
    color: white;
    font-weight: 600;
    margin-bottom: 40px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #34C759;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.waveform {
    font-size: 80px;
    margin: 40px 0;
    animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Controls */
.controls {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-top: 40px;
}

.control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.control-btn:hover {
    transform: translateY(-2px);
}

.control-btn:active {
    transform: translateY(0);
}

.control-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    font-size: 30px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    transition: background 0.2s ease;
}

.control-btn:hover .control-icon {
    background: rgba(255, 255, 255, 0.4);
}

.control-btn-danger .control-icon {
    background: #FF3B30;
}

.control-btn-danger:hover .control-icon {
    background: #D62828;
}

.control-btn.muted .control-icon {
    background: #FF9500;
}

.control-label {
    color: white;
    font-size: 12px;
    font-weight: 500;
}

/* Error view */
.error-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.error-message {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    margin: 20px 0 30px;
    padding: 0 20px;
}

/* Footer */
.footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

.footer p {
    margin: 5px 0;
}

.download-prompt {
    margin-top: 10px;
}

.download-prompt a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: inline-block;
    transition: background 0.2s ease;
}

.download-prompt a:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 20px 15px;
    }

    .header h1 {
        font-size: 28px;
    }

    .icon {
        font-size: 50px;
    }

    .room-code {
        font-size: 36px;
        letter-spacing: 4px;
    }

    .controls {
        gap: 20px;
    }

    .control-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
}
