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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

.service-name {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #2c3e50;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    color: #7f8c8d;
}

main {
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto 30px;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    /* アスペクト比を維持 */
    aspect-ratio: 4 / 3;
}

#video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* モバイルでの描画を確実にする */
    z-index: 10;
}

.controls {
    text-align: center;
    margin-bottom: 30px;
}

.gender-selection {
    margin-bottom: 15px;
    font-size: 16px;
}

.gender-selection label {
    margin: 0 10px;
}

.gender-selection input[type="radio"] {
    margin: 0 5px;
}

.btn {
    padding: 12px 30px;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 10px;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #e74c3c;
    color: white;
}

.btn-secondary:hover {
    background-color: #c0392b;
}

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

.results-container {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    display: none;
}

.results-container.active {
    display: block;
}

.results-container h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.result-item {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.result-item label {
    min-width: 150px;
    font-weight: bold;
}

.progress-bar {
    flex: 1;
    height: 25px;
    background-color: #ecf0f1;
    border-radius: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 12px;
}

.sympathetic {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.parasympathetic {
    background: linear-gradient(90deg, #3498db, #2980b9);
}

.diagnosis-text {
    margin-top: 30px;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.diagnosis-text h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

#diagnosis-content {
    line-height: 1.8;
    color: #555;
}

.analysis-summary {
    margin-top: 30px;
    padding: 20px;
    background-color: #f0f4f8;
    border-radius: 8px;
    border: 1px solid #d0d8e0;
}

.analysis-summary h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.summary-content {
    color: #555;
    line-height: 1.8;
}

.summary-text {
    margin-top: 10px;
    padding: 15px;
    background-color: white;
    border-radius: 5px;
    white-space: pre-line;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .service-name {
        font-size: 2.5rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    header p {
        font-size: 0.95rem;
    }
    
    main {
        padding: 20px;
    }
    
    .video-container {
        /* モバイルでは正方形に近いアスペクト比 */
        aspect-ratio: 1 / 1;
        max-width: 100%;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        margin: 5px;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .result-item label {
        min-width: auto;
        font-size: 0.9rem;
    }
    
    .progress-bar {
        width: 100%;
        height: 20px;
    }
    
    .diagnosis-text {
        padding: 15px;
    }
    
    #diagnosis-content {
        font-size: 0.9rem;
    }
}