/* リセットと基本設定 */
* {
    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;
    line-height: 1.6;
}

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

/* スクリーン管理 */
.screen {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

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

/* スタート画面 */
.start-content {
    background: white;
    border-radius: 20px;
    padding: 50px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.icon-wrapper {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    animation: pulse 2s infinite;
}

.icon-wrapper i {
    font-size: 60px;
    color: white;
}

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

.title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 40px;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.info-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.info-card i {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 15px;
}

.info-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #333;
}

.info-card p {
    color: #666;
    font-size: 0.95rem;
}

/* ボタンスタイル */
.btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

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

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-safe {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
    color: white;
}

.btn-safe:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(86, 171, 47, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(231, 76, 60, 0.4);
}

/* クイズ画面 */
.quiz-header {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s ease;
    border-radius: 10px;
}

.quiz-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
}

.question-number {
    color: #667eea;
    font-weight: 600;
}

.score {
    color: #333;
    font-weight: 500;
}

/* メールコンテナ */
.email-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.email-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 2px solid #dee2e6;
}

.email-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #495057;
    font-weight: 500;
}

.email-toolbar i {
    color: #667eea;
}

.email-content {
    padding: 30px;
    min-height: 400px;
    background: white;
}

.email-meta {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.email-field {
    display: flex;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.email-label {
    font-weight: 600;
    color: #495057;
    min-width: 80px;
}

.email-value {
    color: #212529;
    flex: 1;
}

.email-subject {
    font-size: 1.4rem;
    font-weight: 600;
    color: #212529;
    margin: 20px 0;
}

.email-body {
    color: #333;
    line-height: 1.8;
    font-size: 1rem;
    white-space: pre-wrap;
}

.email-body a {
    color: #0066cc;
    text-decoration: underline;
}

.email-attachment {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #dee2e6;
    color: #495057;
}

.email-attachment i {
    color: #dc3545;
}

/* 回答セクション */
.answer-section {
    background: #f8f9fa;
    padding: 30px;
    border-top: 2px solid #dee2e6;
}

.answer-prompt {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 25px;
    color: #333;
}

.answer-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.4s ease;
}

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

.modal-header {
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
}

.modal-header.correct {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
    color: white;
}

.modal-header.incorrect {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

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

.result-text {
    font-size: 1.8rem;
    font-weight: 600;
}

.modal-body {
    padding: 30px;
}

.explanation-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.explanation-content {
    color: #666;
    line-height: 1.8;
    margin-bottom: 20px;
}

.danger-points {
    background: #fff5f5;
    border-left: 4px solid #e74c3c;
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
}

.danger-points h4 {
    color: #e74c3c;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.danger-points ul {
    list-style: none;
    padding: 0;
}

.danger-points li {
    padding: 5px 0;
    color: #666;
}

.danger-points li:before {
    content: "⚠️ ";
    margin-right: 5px;
}

/* リザルト画面 */
.result-content {
    background: white;
    border-radius: 20px;
    padding: 50px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    margin: 0 auto;
}

.result-header {
    text-align: center;
    margin-bottom: 40px;
}

.result-header h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 30px;
}

.score-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    animation: scaleIn 0.6s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.score-text {
    text-align: center;
    color: white;
}

.score-number {
    display: block;
    font-size: 4rem;
    font-weight: 700;
}

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

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.stat-card {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.stat-card i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.stat-card i.correct {
    color: #56ab2f;
}

.stat-card i.incorrect {
    color: #e74c3c;
}

.stat-card p {
    color: #666;
    margin-bottom: 10px;
}

.stat-card span {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
}

.result-message {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 15px;
    margin: 30px 0;
}

.result-message h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.result-message p {
    color: #666;
    line-height: 1.8;
}

.result-review {
    margin: 40px 0;
}

.result-review h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #333;
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.review-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.review-item.correct {
    border-left-color: #56ab2f;
}

.review-item.incorrect {
    border-left-color: #e74c3c;
}

.review-icon {
    font-size: 1.5rem;
}

.review-text {
    flex: 1;
}

.review-question {
    font-weight: 500;
    color: #333;
}

.review-answer {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.result-tips {
    background: #fff9e6;
    padding: 30px;
    border-radius: 15px;
    margin: 30px 0;
}

.result-tips h3 {
    color: #f39c12;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.tips-list {
    list-style: none;
    padding: 0;
}

.tips-list li {
    padding: 10px 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #666;
}

.tips-list i {
    color: #f39c12;
    margin-top: 3px;
}

.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
    flex-wrap: wrap;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .start-content,
    .result-content {
        padding: 30px 20px;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .info-cards {
        grid-template-columns: 1fr;
    }
    
    .btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
    
    .answer-buttons {
        flex-direction: column;
    }
    
    .answer-buttons .btn {
        width: 100%;
    }
    
    .email-content {
        padding: 20px;
    }
    
    .score-circle {
        width: 150px;
        height: 150px;
    }
    
    .score-number {
        font-size: 3rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
}