/* リセット & ベース設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

/* ヘッダー */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.title i {
    color: #4c51bf;
    margin-right: 0.5rem;
}

.subtitle {
    font-size: 1.8rem;
    color: #4c51bf;
    font-weight: 600;
}

.description {
    font-size: 1.1rem;
    color: #718096;
    margin-top: 1rem;
}

/* スクリーン管理 */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* カード共通スタイル */
.card, .quiz-card, .result-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    margin-bottom: 2rem;
}

.card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.card-header i {
    font-size: 2rem;
    color: #4c51bf;
    margin-bottom: 0.5rem;
    display: block;
}

.card-header h2 {
    font-size: 1.8rem;
    color: #2d3748;
    font-weight: 600;
}

/* マスコットキャラクター */
.mascot-container {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mascot-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4c51bf, #667eea);
    padding: 10px;
    box-shadow: 0 8px 25px rgba(76, 81, 191, 0.3);
    transition: transform 0.3s ease;
    object-fit: contain;
}

.mascot-image:hover {
    transform: scale(1.05) rotate(5deg);
}

/* ヘッダーマスコット */
.header-mascot {
    position: absolute;
    top: 10px;
    right: 20px;
    z-index: 10;
}

.header-mascot-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 5px;
    box-shadow: 0 4px 15px rgba(76, 81, 191, 0.2);
    transition: transform 0.3s ease;
    object-fit: contain;
    opacity: 0.9;
}

.header-mascot-image:hover {
    transform: scale(1.1) rotate(-10deg);
    opacity: 1;
}

/* 結果画面マスコット */
.result-mascot {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}

.result-mascot-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4c51bf, #667eea);
    padding: 8px;
    box-shadow: 0 6px 20px rgba(76, 81, 191, 0.3);
    transition: transform 0.3s ease;
    object-fit: contain;
    animation: celebration 2s ease-in-out infinite alternate;
}

@keyframes celebration {
    0% {
        transform: rotate(-5deg) scale(1);
    }
    100% {
        transform: rotate(5deg) scale(1.05);
    }
}

/* クイズ情報 */
.quiz-info {
    background: #f7fafc;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item i {
    color: #4c51bf;
    margin-right: 0.75rem;
    width: 20px;
}

/* カテゴリー */
.categories {
    margin-bottom: 2rem;
}

.categories h3 {
    font-size: 1.3rem;
    color: #2d3748;
    margin-bottom: 1rem;
}

.categories h3 i {
    color: #4c51bf;
    margin-right: 0.5rem;
}

.category-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.5rem;
}

.category-list li {
    background: #edf2f7;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    color: #4a5568;
}

/* ボタン */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    gap: 0.5rem;
    min-height: 50px;
}

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

.btn-primary {
    background: linear-gradient(135deg, #4c51bf, #667eea);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 81, 191, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 81, 191, 0.6);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover:not(:disabled) {
    background: #cbd5e0;
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #38a169, #48bb78);
    color: white;
    box-shadow: 0 4px 15px rgba(56, 161, 105, 0.4);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 161, 105, 0.6);
}

.btn-outline {
    background: transparent;
    color: #4c51bf;
    border: 2px solid #4c51bf;
}

.btn-outline:hover {
    background: #4c51bf;
    color: white;
}

/* プログレスバー */
.progress-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.progress-info {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
}

.progress-bar {
    background: #e2e8f0;
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(135deg, #4c51bf, #667eea);
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 2.5%;
}

/* クイズカード */
.quiz-card {
    position: relative;
}

.question-number {
    position: absolute;
    top: -10px;
    left: 2rem;
    background: linear-gradient(135deg, #4c51bf, #667eea);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(76, 81, 191, 0.4);
}

.category-tag {
    display: inline-block;
    background: #edf2f7;
    color: #4a5568;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 1rem 0;
}

.question-text {
    font-size: 1.4rem;
    color: #2d3748;
    margin-bottom: 2rem;
    line-height: 1.7;
}

/* 選択肢 */
.options-container {
    margin-bottom: 2rem;
}

.option {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
}

.option:hover {
    border-color: #4c51bf;
    background: #edf2f7;
    transform: translateX(5px);
}

.option.selected {
    border-color: #4c51bf;
    background: #e6fffa;
    color: #2d3748;
}

.option.correct {
    border-color: #38a169;
    background: #f0fff4;
    color: #22543d;
}

.option.incorrect {
    border-color: #e53e3e;
    background: #fed7d7;
    color: #742a2a;
}

.option-label {
    background: #4c51bf;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-weight: 600;
    flex-shrink: 0;
}

.option.selected .option-label {
    background: #38a169;
}

.option.correct .option-label {
    background: #38a169;
}

.option.incorrect .option-label {
    background: #e53e3e;
}

/* クイズコントロール */
.quiz-controls {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* 結果画面 */
.result-card {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.result-header {
    margin-bottom: 2rem;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.result-icon.pass i {
    color: #38a169;
}

.result-icon.fail i {
    color: #e53e3e;
}

.result-title {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 1rem;
}

.pass-fail {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    display: inline-block;
}

.pass-fail.pass {
    background: #c6f6d5;
    color: #22543d;
}

.pass-fail.fail {
    background: #fed7d7;
    color: #742a2a;
}

/* スコア表示 */
.score-summary {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

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

.score-label {
    display: block;
    font-size: 1rem;
    color: #718096;
    margin-bottom: 0.5rem;
}

.score-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
}

.score-total, .score-unit {
    font-size: 1.5rem;
    color: #718096;
}

/* 結果メッセージ */
.result-message {
    background: #f7fafc;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* 解答確認画面 */
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.review-header h2 {
    font-size: 1.8rem;
    color: #2d3748;
    margin: 0;
}

.review-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 5px solid #e2e8f0;
}

.review-item.correct {
    border-left-color: #38a169;
    background: rgba(240, 255, 244, 0.9);
}

.review-item.incorrect {
    border-left-color: #e53e3e;
    background: rgba(254, 215, 215, 0.9);
}

.review-question {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2d3748;
}

.review-answer {
    margin-bottom: 0.5rem;
}

.review-explanation {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    font-size: 0.95rem;
    color: #4a5568;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.4rem;
    }
    
    .card, .quiz-card, .result-card {
        padding: 1.5rem;
    }
    
    .mascot-image {
        width: 100px;
        height: 100px;
        padding: 8px;
    }
    
    .header-mascot {
        top: 8px;
        right: 15px;
    }
    
    .header-mascot-image {
        width: 50px;
        height: 50px;
        padding: 4px;
    }
    
    .category-list {
        grid-template-columns: 1fr;
    }
    
    .quiz-controls {
        flex-direction: column;
    }
    
    .quiz-controls .btn {
        width: 100%;
    }
    
    .score-summary {
        gap: 2rem;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .result-actions .btn {
        width: 100%;
    }
    
    .review-header {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.6rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .mascot-image {
        width: 80px;
        height: 80px;
        padding: 6px;
    }
    
    .header-mascot {
        top: 5px;
        right: 10px;
    }
    
    .header-mascot-image {
        width: 40px;
        height: 40px;
        padding: 3px;
    }
    
    .result-mascot-image {
        width: 60px;
        height: 60px;
        padding: 6px;
    }
    
    .question-text {
        font-size: 1.2rem;
    }
    
    .option {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .score-value {
        font-size: 2rem;
    }
}