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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #000;
    color: #fff;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

#container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
}

#mirror {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* 左右反転で鏡のように */
    background-color: #000;
}

.message,
.error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    padding: 2rem;
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.message p,
.error p {
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    line-height: 1.6;
}

.error {
    background-color: rgba(40, 40, 40, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.error p {
    color: #e0e0e0;
}

.hidden {
    display: none;
}

/* ローディングアニメーション */
.message::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: 8px;
    border-radius: 50%;
    background-color: #fff;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .message p,
    .error p {
        font-size: 1rem;
    }
    
    .message,
    .error {
        padding: 1.5rem;
        max-width: 80%;
    }
}

/* コントロールパネル */
.controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 2rem;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    z-index: 100;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.controls.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.control-group label {
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: #e0e0e0;
    white-space: nowrap;
}

.control-group select {
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-group select:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.control-group select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
}

.control-group input[type="range"] {
    width: 120px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.control-group input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.control-group span {
    font-size: 0.85rem;
    color: #b0b0b0;
    min-width: 50px;
    text-align: right;
}

.control-btn {
    padding: 0.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.control-btn:active {
    transform: scale(0.95);
}

@media (max-width: 1024px) {
    .controls {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 1rem;
    }
    
    .control-group input[type="range"] {
        width: 80px;
    }
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .control-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .control-group input[type="range"] {
        width: 100px;
    }
}
