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

body {
    font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%);
    min-height: 100vh;
    color: #475569;
    line-height: 1.6;
    font-size: 15px;
    /* padding-top: 70px; */
}

@media (max-width: 640px) {
    body {
        font-size: 16px;
        line-height: 1.8;
    }
}

.app-container {
    max-width: 90%;
    margin: 0 auto;
    padding: 20px 0;
}

@media (min-width: 768px) {
    .app-container {
        max-width: 700px;
    }
}

@media (min-width: 1024px) {
    .app-container {
        max-width: 800px;
    }
}

/* Content Card */
.content-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 32px 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
    margin: 20px 0;
    border: 1px solid #e2e8f0;
    animation: fadeIn 0.6s ease-out;
}

@media (min-width: 768px) {
    .content-card {
        padding: 40px 32px;
    }
}

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

/* Header Section */
.header-section {
    margin-bottom: 30px;
}

/* Colorful Overlapping Circles */
.circles-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 32px;
    height: 100px;
}

.circle-group {
    position: relative;
    width: 200px;
    height: 80px;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(0.5px);
    mix-blend-mode: multiply;
    animation: float-circle 4s ease-in-out infinite;
}

.circle-1 {
    width: 60px;
    height: 60px;
    background: rgba(79, 70, 229, 0.6);
    top: 10px;
    left: 20px;
    animation-delay: 0s;
}

.circle-2 {
    width: 50px;
    height: 50px;
    background: rgba(236, 72, 153, 0.6);
    top: 0px;
    left: 60px;
    animation-delay: 0.5s;
}

.circle-3 {
    width: 55px;
    height: 55px;
    background: rgba(251, 146, 60, 0.6);
    top: 25px;
    left: 85px;
    animation-delay: 1s;
}

.circle-4 {
    width: 45px;
    height: 45px;
    background: rgba(34, 197, 94, 0.6);
    top: 5px;
    left: 110px;
    animation-delay: 1.5s;
}

.circle-5 {
    width: 50px;
    height: 50px;
    background: rgba(59, 130, 246, 0.6);
    top: 20px;
    left: 130px;
    animation-delay: 2s;
}

@keyframes float-circle {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    25% {
        transform: translateY(-10px) scale(1.1);
    }
    50% {
        transform: translateY(5px) scale(0.95);
    }
    75% {
        transform: translateY(-5px) scale(1.05);
    }
}

/* Hover effect - circles spread out */
.circles-container:hover .circle {
    filter: blur(0);
    mix-blend-mode: normal;
}

.circles-container:hover .circle-1 {
    transform: translateX(-10px);
}

.circles-container:hover .circle-2 {
    transform: translateY(-10px);
}

.circles-container:hover .circle-3 {
    transform: translate(5px, -5px);
}

.circles-container:hover .circle-4 {
    transform: translateY(10px);
}

.circles-container:hover .circle-5 {
    transform: translateX(10px);
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .circles-container {
        height: 80px;
        margin-bottom: 24px;
    }
    
    .circle-group {
        width: 160px;
        height: 60px;
    }
    
    .circle {
        filter: blur(0.3px);
    }
    
    .circle-1 {
        width: 45px;
        height: 45px;
        top: 8px;
        left: 15px;
    }
    
    .circle-2 {
        width: 38px;
        height: 38px;
        top: 0px;
        left: 45px;
    }
    
    .circle-3 {
        width: 42px;
        height: 42px;
        top: 18px;
        left: 65px;
    }
    
    .circle-4 {
        width: 35px;
        height: 35px;
        top: 5px;
        left: 85px;
    }
    
    .circle-5 {
        width: 38px;
        height: 38px;
        top: 15px;
        left: 105px;
    }
}

.main-title {
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    color: #334155;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.05em;
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    text-shadow: 2px 2px 10px rgba(79, 70, 229, 0.2);
}

@media (min-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }
}

.subtitle {
    text-align: center;
    color: #475569;
    font-size: 1.1rem;
    margin-bottom: 32px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.05em;
    margin-top: -8px;
    font-style: italic;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 16px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 640px) {
    .subtitle {
        font-size: 1.05rem;
        line-height: 1.6;
        padding: 0 20px 16px;
        margin-top: -6px;
    }
}

.intro-message {
    text-align: left;
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 32px;
    line-height: 1.7;
    font-weight: 500;
}

@media (max-width: 640px) {
    .intro-message {
        font-size: 1.1rem;
        line-height: 1.8;
        margin-bottom: 24px;
    }
}

.test-info {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.info-icon {
    font-size: 1.2rem;
}

.info-text {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

@media (max-width: 640px) {
    .info-text {
        font-size: 1rem;
    }
}

/* Love Types Section */
.love-types {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 100%);
    border-radius: 16px;
    border: 1px solid #f59e0b;
    text-align: center;
}

.love-types-title {
    font-size: 1rem;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 12px;
}

@media (max-width: 640px) {
    .love-types-title {
        font-size: 1.1rem;
    }
}

.love-types-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.love-type {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    font-size: 0.85rem;
    color: #92400e;
    font-weight: 500;
    border: 1px solid rgba(146, 64, 14, 0.2);
}

@media (max-width: 640px) {
    .love-types {
        padding: 20px;
    }
    
    .love-types-list {
        gap: 8px;
    }
    
    .love-type {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
}

/* Section Title */
.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 640px) {
    .section-title {
        font-size: 1.4rem;
        margin-bottom: 16px;
    }
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    color: #475569;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Diagnosis Explanation Section */
.diagnosis-explanation-section {
    margin: 32px 0;
    padding: 32px;
    background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
    border-radius: 20px;
    border: 1px solid #fde047;
}

@media (max-width: 640px) {
    .diagnosis-explanation-section {
        padding: 24px 20px;
        margin: 24px 0;
    }
}

.explanation-content {
    max-width: 600px;
    margin: 0 auto;
}

.explanation-text {
    text-align: left;
    color: #78350f;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 24px;
    line-height: 1.8;
}

@media (max-width: 640px) {
    .explanation-text {
        font-size: 1.2rem;
        line-height: 2;
        margin-bottom: 20px;
        text-align: left;
    }
}

.love-type-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin: 32px 0;
}

@media (max-width: 640px) {
    .love-type-cards {
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin: 12px 0;
    }
    
    .love-type-card {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
    
    .type-icon {
        font-size: 1.3rem;
        margin-bottom: 0;
    }
    
    .type-name {
        font-size: 0.9rem;
        font-weight: 600;
        margin-bottom: 0;
    }
}

.love-type-card {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    border: 1px solid rgba(251, 191, 36, 0.3);
    transition: all 0.3s ease;
}

@media (max-width: 640px) {
    .love-type-card {
        padding: 4px 12px;
    }
}

.love-type-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(251, 191, 36, 0.2);
    background: rgba(255, 255, 255, 0.95);
}

.type-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.type-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 4px;
}

.type-desc {
    font-size: 0.85rem;
    color: #b45309;
    line-height: 1.4;
}

@media (max-width: 640px) {
    .type-desc {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

.explanation-conclusion {
    text-align: left;
    color: #78350f;
    font-size: 1rem;
    line-height: 1.8;
    margin-top: 24px;
}

@media (max-width: 640px) {
    .explanation-conclusion {
        font-size: 1.1rem;
        line-height: 2;
        margin-top: 20px;
        text-align: left;
    }
}

/* Instruction Section */
.instruction-section {
    margin: 32px 0;
    padding: 24px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 16px;
    border: 1px solid #bae6fd;
}

@media (max-width: 640px) {
    .instruction-section {
        padding: 20px;
        margin: 24px 0;
    }
}

.instruction-text {
    color: #0c4a6e;
    text-align: left;
    line-height: 1.8;
}

@media (max-width: 640px) {
    .instruction-text {
        font-size: 1.1rem;
        line-height: 2;
        padding: 0 10px;
        text-align: left;
    }
}

.highlight {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

@media (max-width: 640px) {
    .highlight {
        font-weight: 700;
    }
}

/* Progress Section - Fixed Header */
.progress-section {
    position: fixed;
    top: -80px;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.3);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin: 0;
    transition: top 0.5s ease;
    opacity: 0;
}

.progress-section.visible {
    top: 0;
    opacity: 1;
}

.progress-bar {
    max-width: 400px;
    margin: 0 auto;
    height: 8px;
    background: rgba(226, 232, 240, 0.7);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    text-align: center;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 500;
}

#answeredCount {
    font-weight: 600;
    color: #4f46e5;
}

/* Questions Section */
.questions-container {
    display: grid;
    gap: 24px;
    position: relative;
}

.question-pair {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    transition: all 0.5s ease;
    opacity: 0.3;
    transform: scale(0.95);
    filter: blur(1px);
    cursor: not-allowed;
    pointer-events: none;
}

.question-pair.active {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.15);
    border-color: #cbd5e1;
    cursor: default;
    pointer-events: auto;
}

.question-pair.answered {
    opacity: 0.5;
    transform: scale(0.98);
    pointer-events: auto;
    cursor: pointer;
}

.question-pair.answered:hover {
    opacity: 0.7;
    transform: scale(0.99);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
}

/* 一度アクティブになった質問は通常の表示 */
.question-pair.activated {
    opacity: 0.8;
    transform: scale(1);
    pointer-events: auto;
    cursor: pointer;
    filter: blur(0);
}

.question-pair.activated:hover {
    opacity: 0.9;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
}

.question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.question-pair.active .question-number {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.5);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
    }
}

.options {
    display: grid;
    gap: 12px;
}

.option-label {
    display: block;
    cursor: pointer;
    position: relative;
}


.option-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.question-pair.active .option-label:hover .option-content {
    border-color: #cbd5e1;
    transform: translateX(4px);
}

.option-label input[type="radio"]:checked + .option-content {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #4f46e5;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

.option-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.3s ease;
}

.option-label input[type="radio"]:checked + .option-content .option-radio {
    border-color: #4f46e5;
}

.option-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 10px;
    height: 10px;
    background: #4f46e5;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.option-label input[type="radio"]:checked + .option-content .option-radio::after {
    transform: translate(-50%, -50%) scale(1);
}

.option-text {
    flex: 1;
    color: #475569;
    line-height: 1.5;
}

.option-category {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    color: #64748b;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.option-label input[type="radio"]:checked + .option-content .option-category {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
}

/* Submit Section */
.submit-section {
    text-align: center;
    margin-top: 40px;
}

.submit-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.submit-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3);
}

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

.button-icon {
    font-size: 1.3rem;
}

/* Responsive */
@media (max-width: 640px) {
    .progress-section {
        padding: 10px 16px;
    }
    
    .progress-bar {
        max-width: 100%;
    }
    
    .progress-text {
        font-size: 0.75rem;
    }
    
    .content-card {
        padding: 28px 20px;
    }
    
    .question-pair {
        padding: 20px 16px;
    }
    
    .option-content {
        padding: 12px;
    }
}

/* Loading State */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Smooth focus indicator */
.question-pair.focusing {
    animation: focusIn 0.5s ease-out;
}

@keyframes focusIn {
    from {
        opacity: 0.3;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Radio Group Styles */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.radio-label:hover {
    border-color: #4f46e5;
    background: rgba(79, 70, 229, 0.05);
}

.radio-label input[type="radio"] {
    margin-right: 8px;
}

.radio-label input[type="radio"]:checked + .radio-text {
    color: #4f46e5;
    font-weight: 600;
}

.radio-text {
    font-size: 14px;
    color: #475569;
}

/* Required Text */
.required-text {
    color: #dc2626;
    font-size: 0.8rem;
    font-weight: 400;
    margin-left: 8px;
}

/* Error Message */
.error-message {
    margin-top: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #dc2626;
    font-size: 0.9rem;
    font-weight: 500;
    animation: fadeInError 0.3s ease-out;
}

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

/* 性別選択スタイル */
.gender-selection {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

@media (max-width: 640px) {
    .gender-selection {
        flex-direction: column;
        gap: 12px;
    }
}

.gender-selection .radio-label {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin: 0;
}

.gender-selection .radio-label:hover {
    border-color: #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
    background: rgba(102, 126, 234, 0.05);
}

.gender-selection .radio-input {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    accent-color: #667eea;
    cursor: pointer;
}

.gender-selection .radio-input:checked + .radio-text {
    color: #667eea;
    font-weight: 600;
}

.gender-selection .radio-label:has(.radio-input:checked) {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.gender-selection .radio-label:has(.radio-input:checked) .radio-text {
    color: white;
}

.gender-selection .radio-text {
    font-size: 16px;
    font-weight: 500;
    color: #475569;
    transition: color 0.3s ease;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    background: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

