* {
    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;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 25px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    text-align: center;
}

header h1 {
    color: #667eea;
    font-size: 28px;
    font-weight: 700;
}

header h1 i {
    margin-right: 10px;
}

.main-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
    min-height: 500px;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

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

/* スタート画面 */
.welcome-box {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.welcome-box h2 {
    font-size: 32px;
    color: #667eea;
    margin-bottom: 20px;
}

.welcome-box > p {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

.test-flow {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: left;
}

.test-flow h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 20px;
}

.test-flow ol {
    padding-left: 25px;
}

.test-flow li {
    margin-bottom: 12px;
    line-height: 1.6;
    font-size: 16px;
}

.test-flow strong {
    color: #667eea;
}

.permission-note {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.permission-note i {
    color: #ff9800;
    font-size: 24px;
}

.permission-note p {
    margin: 0;
    color: #856404;
    font-weight: 500;
}

/* ボタン */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Noto Sans JP', sans-serif;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

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

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-large {
    padding: 15px 40px;
    font-size: 18px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 進捗インジケーター */
.progress-indicator {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.step {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s ease;
}

.step.active {
    background: #667eea;
    color: white;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
    transform: scale(1.1);
}

.step.completed {
    background: #28a745;
    color: white;
}

/* 質問ボックス */
.question-box {
    max-width: 800px;
    margin: 0 auto;
}

.question-box h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 24px;
}

.instruction {
    background: #e7f3ff;
    padding: 15px;
    border-left: 4px solid #2196f3;
    border-radius: 5px;
    margin-bottom: 20px;
    color: #0d47a1;
}

/* パッセージボックス */
.passage-box {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border: 2px solid #dee2e6;
    margin-bottom: 20px;
    line-height: 1.8;
    font-size: 16px;
}

.passage-box h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 20px;
}

.passage-box p {
    margin-bottom: 10px;
    color: #333;
}

/* タイマー */
.timer-box {
    background: #fff3cd;
    border: 2px solid #ffc107;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
    color: #856404;
}

.timer-box i {
    margin-right: 10px;
}

.wait-message {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    margin-top: 15px;
}

/* 録音コントロール */
.recording-controls {
    text-align: center;
    margin: 25px 0;
}

.recording-controls button {
    margin: 0 10px;
}

.status-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    font-weight: 500;
    min-height: 40px;
}

/* 録音のヒント */
.recording-tip {
    background: #fff3cd;
    color: #856404;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 2px solid #ffc107;
    font-size: 14px;
    line-height: 1.5;
}

.recording-tip i {
    margin-right: 8px;
    color: #ff9800;
}

.recording-tip strong {
    color: #e65100;
}

.status-message.recording {
    background: #ffe5e5;
    color: #d32f2f;
    border: 2px solid #ffcdd2;
}

.status-message.processing {
    background: #e3f2fd;
    color: #1976d2;
    border: 2px solid #bbdefb;
}

.status-message.success {
    background: #e8f5e9;
    color: #388e3c;
    border: 2px solid #c8e6c9;
}

/* 結果ボックス */
.result-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #667eea;
}

.result-box h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 18px;
}

.result-box p {
    margin-bottom: 8px;
    line-height: 1.6;
}

.result-box strong {
    color: #333;
}

.transcription {
    background: white;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
    margin: 10px 0;
    font-style: italic;
    color: #495057;
}

.score-display {
    font-size: 24px;
    font-weight: 700;
    color: #28a745;
    margin: 15px 0;
}

.feedback {
    background: #fff3cd;
    padding: 12px;
    border-radius: 5px;
    margin-top: 10px;
    color: #856404;
}

/* 質問セクション */
.question-section {
    margin-top: 20px;
}

.question-text {
    background: #e7f3ff;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #2196f3;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 500;
    color: #0d47a1;
}

/* イラストボックス */
.illustration-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
    border: 2px solid #dee2e6;
}

.illustration-box img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* 結果サマリー */
.result-summary {
    text-align: center;
}

.result-summary h2 {
    color: #667eea;
    margin-bottom: 30px;
    font-size: 28px;
}

.total-score {
    margin-bottom: 40px;
}

.score-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.score-circle #total-score {
    font-size: 48px;
    font-weight: 700;
}

.score-circle .score-max {
    font-size: 24px;
    margin-top: 5px;
}

.score-label {
    font-size: 18px;
    color: #6c757d;
    font-weight: 500;
}

/* 詳細結果 */
.detailed-results {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: left;
}

.detailed-results h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    font-size: 20px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    margin-bottom: 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.score-item .score-label {
    color: #333;
    font-weight: 500;
    font-size: 16px;
}

.score-item .score-value {
    color: #667eea;
    font-weight: 700;
    font-size: 16px;
}

/* フィードバックセクション */
.feedback-section {
    background: #fff3cd;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: left;
}

.feedback-section h3 {
    color: #856404;
    margin-bottom: 15px;
}

.feedback-section ul {
    padding-left: 20px;
}

.feedback-section li {
    margin-bottom: 10px;
    color: #856404;
    line-height: 1.6;
}

/* アクションボタン */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* フッター */
footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: white;
}

footer p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

/* Day選択画面 */
.day-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.day-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 25px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    text-align: center;
}

.day-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.day-btn:active {
    transform: translateY(-2px);
}

.day-number {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.day-topic {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.day-desc {
    font-size: 14px;
    opacity: 0.9;
}

.random-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.random-btn:hover {
    box-shadow: 0 8px 25px rgba(245, 87, 108, 0.4);
}

.random-btn .day-number {
    font-size: 40px;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .main-content {
        padding: 20px;
    }

    header h1 {
        font-size: 22px;
    }

    .welcome-box h2 {
        font-size: 26px;
    }

    .test-flow li {
        font-size: 14px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .btn-large {
        padding: 12px 30px;
        font-size: 16px;
    }

    .progress-indicator {
        gap: 8px;
    }

    .step {
        width: 40px;
        height: 40px;
        font-size: 12px;
    }

    .question-box h2 {
        font-size: 20px;
    }

    .passage-box {
        padding: 15px;
        font-size: 14px;
    }

    .score-circle {
        width: 150px;
        height: 150px;
    }

    .score-circle #total-score {
        font-size: 40px;
    }

    .score-circle .score-max {
        font-size: 20px;
    }

    .recording-controls button {
        margin: 5px;
    }
}

hr {
    border: none;
    border-top: 2px solid #e9ecef;
    margin: 25px 0;
}

/* フィードバックセクション */
.feedback-section {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 5px;
    text-align: left;
    line-height: 1.8;
}

.feedback-section strong {
    color: #495057;
}

.model-answer {
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
}

.model-answer strong {
    color: #667eea;
    font-size: 16px;
}

.answer-text {
    display: block;
    margin-top: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #28a745;
    font-style: italic;
}

.feedback-section ul {
    margin: 10px 0;
    padding-left: 25px;
}

.feedback-section li {
    margin: 5px 0;
    color: #495057;
}

/* 音読のハイライト表示 */
.original-text-display {
    background: white;
    border: 2px solid #6c757d;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    line-height: 2;
    font-size: 16px;
}

.missed-word {
    background-color: #ffebee;
    color: #dc3545;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 3px;
    border-bottom: 2px solid #dc3545;
}

.matched-word {
    color: #28a745;
    font-weight: 500;
}

.question-text-display {
    display: none;
    background: #f8f9fa;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #495057;
}

/* AI採点の注意書き */
.ai-scoring-notice {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 20px 0;
    text-align: center;
    color: #856404;
    font-size: 15px;
    line-height: 1.8;
}

.ai-scoring-notice i {
    color: #ffc107;
    font-size: 20px;
    margin-right: 8px;
}

.ai-scoring-notice strong {
    color: #856404;
}

/* イラスト説明とエラー表示 */
.image-error-message {
    background: #fff3cd;
    border: 2px dashed #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    text-align: center;
    color: #856404;
    font-size: 14px;
}

.image-error-message i {
    color: #ffc107;
    font-size: 20px;
    margin-right: 8px;
}

.illustration-description {
    background: #e3f2fd;
    border: 2px solid #2196F3;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    line-height: 1.8;
}

.illustration-description h4 {
    color: #1976D2;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.illustration-description p {
    margin: 10px 0;
    color: #424242;
}

.illustration-description strong {
    color: #1565C0;
}

.illustration-description ul {
    margin: 10px 0;
    padding-left: 25px;
}

.illustration-description li {
    margin: 8px 0;
    color: #424242;
}

.btn-small {
    padding: 8px 15px;
    font-size: 13px;
}
