body {
    background-color: #f5f5f5;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    text-align: center;
    padding: 20px;
}

h1 {
    color: #333;
    margin-bottom: 8px;
    font-size: 28px;
}

.description {
    color: #666;
    margin-bottom: 24px;
    font-size: 14px;
}

/* ===== デバイス選択 ===== */
.device-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.device-selector label {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.mic-select {
    padding: 8px 12px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #333;
    min-width: 200px;
    max-width: 300px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s;
}

.mic-select:focus {
    border-color: #4CAF50;
}

.mic-select:disabled {
    background: #f0f0f0;
    color: #999;
    cursor: not-allowed;
}

.refresh-btn {
    background: white;
    border: 2px solid #ddd;
    padding: 8px 10px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.refresh-btn:hover {
    border-color: #4CAF50;
    background: #f0f8f0;
}

.refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== マイクボタン ===== */
.start-button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 16px;
    transition: background 0.3s;
}

.start-button:hover {
    background: #45a049;
}

.start-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.status {
    color: #666;
    font-size: 14px;
    margin-bottom: 24px;
    min-height: 20px;
}

/* ===== アバター ===== */
.avatar-wrapper {
    position: relative;
    display: inline-block;
    width: 400px;
    max-width: 100%;
    margin: 20px 0;
}

.avatar-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* ===== 口のオーバーレイ ===== */
.mouth-overlay {
    position: absolute;
    top: 53.5%;
    left: 49.5%;
    transform: translateX(-50%);
width: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

.mouth-textarea {
    resize: vertical;
    scrollbar-width: none;
    text-align: center;
    z-index: 3;
    background: #ce2323;  /* 口の中の色 */
    border: none;
    outline: none;
    width: 100%;
    height: 1px;
    min-height: 0px;
    max-height: 80px;
    margin: 0;
    padding: 0;
    font-size: 0;
    overflow: hidden;
    transition: height 0.05s ease-out;
    cursor: ns-resize;
    opacity: 0.9;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.mouth-textarea::-webkit-scrollbar {
    display: none;
}

.mouth-img {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    top: -1px;
    z-index: 2;
}

/* ===== 音量バー ===== */
.volume-bar-container {
    margin-top: 30px;
    width: 400px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.volume-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.volume-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.volume-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4CAF50, #FFC107, #FF5722);
    border-radius: 4px;
    transition: width 0.05s ease-out;
}

/* ===== レスポンシブ ===== */
@media (max-width: 480px) {
    .avatar-wrapper {
        width: 300px;
    }
    
    .mouth-overlay {
        width: 40px;
    }
}
