/* リセットとベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    overflow-x: hidden;
}

/* コンテナ */
.container {
    width: 100%;
    max-width: 500px;
    margin: 20px;
    position: relative;
}

/* 画面共通スタイル */
.screen {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px 30px;
    min-height: 600px;
    display: none;
    animation: fadeIn 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.screen.active {
    display: block;
}

.screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #FF6B6B, #4ECDC4, #45B7D1);
    animation: gradientShift 3s ease-in-out infinite;
}

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

@keyframes gradientShift {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

/* スタート画面 */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.2;
}

.header h1 i {
    color: #FF6B6B;
    margin-right: 10px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 16px;
    font-weight: 400;
}

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

.intro-text p {
    font-size: 16px;
    color: #555;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* 性格診断プレビュー */
.personality-preview {
    margin: 30px 0;
}

.personality-flow {
    display: grid;
    gap: 15px;
}

.personality-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.personality-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.personality-card i {
    font-size: 28px;
    margin-bottom: 10px;
    display: block;
}

.personality-card:nth-child(1) i { color: #FF6B6B; }
.personality-card:nth-child(2) i { color: #4ECDC4; }
.personality-card:nth-child(3) i { color: #45B7D1; }

.personality-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

.personality-card p {
    font-size: 20px;
    color: #666;
    margin: 8px 0;
    font-weight: bold;
}

.restaurant-result {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* ボタンスタイル */
.primary-btn, .secondary-btn {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.primary-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.secondary-btn {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    margin-bottom: 15px;
}

.secondary-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* 質問画面 */
.progress-bar {
    background: #f0f0f0;
    border-radius: 20px;
    height: 8px;
    margin-bottom: 30px;
    overflow: hidden;
    position: relative;
}

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

.progress-text {
    position: absolute;
    top: -30px;
    right: 0;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.question-content h2 {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
    line-height: 1.3;
}

.options-grid {
    display: grid;
    gap: 15px;
}

.option-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    opacity: 0;
    transform: translateY(20px);
}

.option-item:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f8f9ff, #ffffff);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.option-text {
    font-size: 16px;
    color: #333;
    line-height: 1.4;
    flex: 1;
}

.option-item i {
    color: #667eea;
    font-size: 14px;
    opacity: 0.7;
}

/* 結果画面 */
.result-content {
    text-align: center;
}

.result-animation {
    margin-bottom: 30px;
    position: relative;
}

.result-icon {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    transition: all 0.5s ease;
    border: 4px solid transparent;
}

.result-animation.animate .result-icon {
    animation: bounce 0.8s ease-out, pulse 2s ease-in-out infinite 1s;
    border-color: currentColor;
}

.result-icon i {
    font-size: 48px;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: scale(1); }
    40%, 43% { transform: scale(1.1); }
}

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

#result-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.result-description {
    margin-bottom: 30px;
}

.result-description p {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 25px;
}

/* 性格診断結果表示 */
.personality-result {
    margin-bottom: 25px;
}

.personality-badge {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 3px solid currentColor;
}

.personality-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.personality-name {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: inherit;
}

.personality-description {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 25px;
    text-align: left;
}

/* スコア表示 */
.score-breakdown {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.score-breakdown h4 {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
}

.score-item span:first-child {
    min-width: 100px;
    text-align: left;
    font-weight: 500;
}

.score-item span:last-child {
    min-width: 40px;
    text-align: right;
    font-weight: 600;
    color: #333;
}

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

.score-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

.result-actions {
    margin-top: 30px;
}

/* レスポンシブデザイン */
@media (max-width: 600px) {
    .container {
        margin: 10px;
    }
    
    .screen {
        padding: 30px 20px;
        margin: 0;
        border-radius: 15px;
        min-height: auto;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .question-content h2 {
        font-size: 20px;
    }
    
    .option-item {
        padding: 16px;
    }
    
    .option-text {
        font-size: 15px;
    }
    
    .result-icon {
        width: 100px;
        height: 100px;
    }
    
    .result-icon i {
        font-size: 40px;
    }
    
    #result-title {
        font-size: 24px;
    }
    
    .personality-preview {
        margin: 20px 0;
    }
    
    .personality-card {
        padding: 16px;
    }
    
    .personality-card h3 {
        font-size: 15px;
    }
    
    .restaurant-result {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .score-item {
        font-size: 13px;
    }
    
    .score-item span:first-child {
        min-width: 80px;
    }
}

@media (max-width: 400px) {
    .screen {
        padding: 25px 15px;
    }
    
    .header h1 {
        font-size: 22px;
    }
    
    .subtitle {
        font-size: 15px;
    }
    
    .question-content h2 {
        font-size: 18px;
    }
    
    .primary-btn, .secondary-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
}