/* 愛と友情の哲学診断テスト - スタイルシート */

/* ===========================
   CSS変数・リセット
   =========================== */
:root {
    --primary-color: #6B4E71;
    --secondary-color: #9B59B6;
    --accent-color: #E67E22;
    --text-color: #2C3E50;
    --text-light: #7F8C8D;
    --bg-color: #F8F6F3;
    --card-bg: #FFFFFF;
    --border-radius: 16px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.8;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(155, 89, 182, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(230, 126, 34, 0.05) 0%, transparent 50%);
}

/* ===========================
   コンテナ・レイアウト
   =========================== */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

.screen {
    display: none;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

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

/* ===========================
   スタート画面
   =========================== */
.hero {
    text-align: center;
    padding: 60px 20px;
}

.decorative-icon {
    font-size: 3rem;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.decorative-icon i {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
}

.decorative-icon i:nth-child(2) {
    animation-delay: 0.5s;
}

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

.hero h1 {
    font-family: 'Noto Serif JP', serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 40px;
}

.philosophers-preview {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
}

.philosopher-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    padding: 10px 16px;
    border-radius: 30px;
    box-shadow: var(--shadow);
    font-size: 0.9rem;
    transition: var(--transition);
}

.philosopher-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(155, 89, 182, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(155, 89, 182, 0.4);
}

.btn-primary i {
    transition: transform 0.3s ease;
}

.btn-primary:hover i {
    transform: translateX(5px);
}

.question-count {
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ===========================
   質問画面
   =========================== */
.progress-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #E8E4E1;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    min-width: 60px;
    text-align: right;
}

.question-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 40px 30px;
    box-shadow: var(--shadow);
}

.question-number {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 16px;
    font-weight: 700;
}

.question-text {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.8;
    margin-bottom: 30px;
    color: var(--text-color);
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: var(--bg-color);
    border: 2px solid transparent;
    padding: 18px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    animation: slideIn 0.4s ease forwards;
    opacity: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.option-btn:hover {
    border-color: var(--secondary-color);
    background: white;
    transform: translateX(5px);
}

.option-btn.selected {
    border-color: var(--secondary-color);
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.1), rgba(107, 78, 113, 0.1));
}

.option-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--secondary-color);
    color: white;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 600;
    flex-shrink: 0;
}

.option-text {
    font-size: 1rem;
    line-height: 1.7;
    padding-top: 4px;
}

/* ===========================
   結果画面
   =========================== */
.result-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 40px 30px;
    box-shadow: var(--shadow);
    text-align: center;
}

.result-title {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.result-type {
    display: inline-block;
    padding: 8px 24px;
    border-radius: 20px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 30px;
}

.result-icon {
    font-size: 4rem;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    border-radius: 50%;
    color: white;
    animation: bounceIn 0.6s ease;
}

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

.result-name {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-color);
}

.result-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.result-description {
    text-align: left;
    background: var(--bg-color);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.result-description p {
    margin-bottom: 16px;
}

.result-description p:last-child {
    margin-bottom: 0;
}

.result-description strong {
    color: var(--secondary-color);
}

/* スコアチャート */
.score-breakdown {
    margin-bottom: 30px;
}

.score-breakdown h4 {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.score-chart {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.score-item {
    text-align: left;
}

.score-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.score-desc {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 8px;
    padding-left: 28px;
}

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

.score-name {
    flex: 1;
    font-weight: 500;
}

.score-value {
    font-weight: 700;
    color: var(--text-color);
}

.score-bar-container {
    height: 12px;
    background: #E8E4E1;
    border-radius: 6px;
    overflow: hidden;
}

.score-bar {
    height: 100%;
    border-radius: 6px;
    width: 0;
    transition: width 0.8s ease-out;
}

/* アドバイス */
.result-advice {
    text-align: left;
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.08), rgba(230, 126, 34, 0.08));
    padding: 24px;
    border-radius: 12px;
    border-left: 4px solid var(--secondary-color);
    margin-bottom: 30px;
}

.result-advice p {
    margin-bottom: 12px;
}

.result-advice p:first-child {
    font-weight: 700;
    color: var(--secondary-color);
}

.result-advice p:last-child {
    margin-bottom: 0;
}

/* 結果アクション */
.result-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-color);
    color: var(--text-color);
    border: 2px solid #E8E4E1;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    transform: translateY(-2px);
}

/* ===========================
   レスポンシブデザイン
   =========================== */
@media (max-width: 600px) {
    .container {
        padding: 16px;
    }

    .hero {
        padding: 40px 10px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .philosophers-preview {
        gap: 8px;
    }

    .philosopher-badge {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .btn-primary {
        padding: 16px 32px;
        font-size: 1rem;
    }

    .question-container {
        padding: 24px 20px;
    }

    .question-text {
        font-size: 1.1rem;
    }

    .option-btn {
        padding: 14px 16px;
    }

    .option-marker {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }

    .option-text {
        font-size: 0.95rem;
    }

    .result-container {
        padding: 30px 20px;
    }

    .result-name {
        font-size: 1.5rem;
    }

    .result-description,
    .result-advice {
        padding: 20px;
    }

    .result-icon {
        width: 100px;
        height: 100px;
        font-size: 3rem;
    }
}

@media (max-width: 400px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    .philosophers-preview {
        flex-direction: column;
        align-items: center;
    }

    .philosopher-badge {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
}

/* ===========================
   アクセシビリティ
   =========================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* フォーカススタイル */
button:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 3px;
}

.option-btn:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}
