/* 基本スタイル */
* {
    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;
}

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

/* ヘッダー */
.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    position: relative;
    animation: fadeInDown 0.8s ease;
}

.back-btn {
    position: absolute;
    left: 0;
    top: 10px;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.back-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateX(-5px);
}

.header h1 {
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

/* ステップコンテナ */
.step {
    display: none;
}

.step.active {
    display: block;
    animation: fadeInUp 0.6s ease;
}

/* ステップカード */
.step-card {
    background: white;
    border-radius: 30px;
    padding: 50px 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    text-align: center;
}

.step-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.step-card h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 30px;
}

/* 入力グループ */
.input-group {
    margin: 30px 0;
}

.large-input {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    font-size: 1.5rem;
    border: 3px solid #667eea;
    border-radius: 15px;
    text-align: center;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.3s ease;
}

.large-input:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 5px rgba(102, 126, 234, 0.2);
    transform: scale(1.05);
}

/* プログレスバー */
.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    margin-bottom: 40px;
    overflow: hidden;
}

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

/* 本時のねらい表示エリア */
.lesson-goal-section {
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease;
}

.lesson-goal-card {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 20px;
    padding: 25px 30px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border: 3px solid #ff9a76;
    position: relative;
    overflow: hidden;
}

.lesson-goal-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30px, -30px); }
}

.lesson-goal-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

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

.lesson-goal-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #d84315;
    margin-bottom: 12px;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.5);
}

.lesson-goal-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #5d4037;
    font-weight: 500;
    background: rgba(255,255,255,0.6);
    padding: 15px 20px;
    border-radius: 12px;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 質問カード */
.question {
    display: none;
}

.question.active {
    display: block;
    animation: slideIn 0.5s ease;
}

.question-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.question h2 {
    font-size: 1.6rem;
    color: #333;
    margin-bottom: 10px;
}

.hint {
    color: #666;
    font-size: 1rem;
    margin-bottom: 25px;
}

/* テキストエリア */
.textarea-wrapper {
    position: relative;
    margin-bottom: 25px;
}

textarea {
    width: 100%;
    padding: 20px;
    font-size: 1.2rem;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    font-family: 'Noto Sans JP', sans-serif;
    resize: vertical;
    transition: all 0.3s ease;
    line-height: 1.6;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 5px rgba(102, 126, 234, 0.1);
}

/* マイクボタン */
.mic-btn {
    position: absolute;
    right: 15px;
    bottom: 15px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.mic-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.mic-btn:active {
    transform: scale(0.95);
}

/* ボタン */
.btn {
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Noto Sans JP', sans-serif;
}

.btn-large {
    padding: 20px 50px;
    font-size: 1.3rem;
}

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

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: #e0e0e0;
    color: #666;
}

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

.btn-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
    color: white;
    box-shadow: 0 5px 20px rgba(86, 171, 47, 0.4);
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(86, 171, 47, 0.6);
}

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

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

/* 結果カード */
.result-card {
    background: white;
    border-radius: 30px;
    padding: 50px 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

/* ローディング */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading p {
    color: #666;
    font-size: 1.2rem;
}

/* 結果ヘッダー */
.result-header {
    text-align: center;
    margin-bottom: 30px;
}

.result-header h2 {
    font-size: 2rem;
    color: #333;
}

/* クラウンバッジセクション */
.crown-badge-section {
    text-align: center;
    margin: 30px 0;
    animation: fadeInScale 0.8s ease;
}

.crown-badge-animation {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.crown-badge-animation::before {
    content: '✨';
    position: absolute;
    font-size: 3rem;
    top: 10px;
    left: 20px;
    animation: twinkle 1.5s ease infinite;
}

.crown-badge-animation::after {
    content: '✨';
    position: absolute;
    font-size: 3rem;
    top: 10px;
    right: 20px;
    animation: twinkle 1.5s ease infinite 0.5s;
}

.crown-icon {
    font-size: 5rem;
    animation: bounce 1s ease infinite;
    margin-bottom: 10px;
}

.crown-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 5px;
}

.crown-subtext {
    font-size: 1.2rem;
    color: white;
    opacity: 0.95;
}

/* 総合評価 */
.total-grade {
    text-align: center;
    margin-bottom: 40px;
}

.grade-badge {
    display: inline-block;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 4rem;
    font-weight: 700;
    line-height: 120px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    animation: scaleIn 0.6s ease;
}

.grade-text {
    margin-top: 15px;
    font-size: 1.3rem;
    color: #333;
    font-weight: 600;
}

/* 3観点評価 */
.three-aspects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.aspect-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    border: 3px solid #e0e0e0;
    transition: all 0.3s ease;
}

.aspect-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.aspect-card h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 15px;
}

.score-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
}

.score-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
}

.score-label {
    font-size: 1rem;
    color: #666;
}

.grade-small {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    margin-left: 10px;
}

/* フィードバックセクション */
.feedback-section {
    margin-bottom: 30px;
}

.feedback-section h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.feedback-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    border-left: 5px solid #667eea;
}

.feedback-card h4 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 15px;
}

.feedback-card ul {
    list-style: none;
    padding-left: 0;
}

.feedback-card li {
    padding: 10px 0;
    color: #555;
    font-size: 1rem;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
}

.feedback-card li::before {
    content: '✓';
    color: #56ab2f;
    font-weight: 700;
    margin-right: 10px;
    font-size: 1.2rem;
}

.improvements li::before {
    content: '💡';
}

.feedback-card p {
    color: #555;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* 改善度セクション */
.improvement-section {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    color: white;
}

.improvement-section h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    text-align: center;
}

.improvement-display {
    display: grid;
    gap: 10px;
    margin-bottom: 15px;
}

.improvement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.2);
    padding: 10px 15px;
    border-radius: 10px;
}

.improvement-value {
    font-weight: 700;
    font-size: 1.2rem;
}

.improvement-message {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}

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

/* 完了カード */
.complete-card {
    background: white;
    border-radius: 30px;
    padding: 60px 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    text-align: center;
}

.confetti {
    font-size: 5rem;
    animation: bounce 1s infinite;
}

.complete-icon {
    font-size: 6rem;
    color: #56ab2f;
    margin: 20px 0;
    animation: scaleIn 0.6s ease;
}

.complete-card h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 20px;
}

.complete-card p {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 40px;
    line-height: 1.8;
}

/* 音声入力インジケーター */
.voice-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
    z-index: 1000;
    display: none;
}

.voice-indicator.active {
    display: block;
    animation: scaleIn 0.3s ease;
}

.voice-icon {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 20px;
    animation: pulse 1.5s ease infinite;
}

.voice-indicator p {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 20px;
}

/* アニメーション */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* レスポンシブ */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .back-btn {
        position: static;
        display: inline-block;
        margin-bottom: 15px;
    }

    .step-card, .result-card, .complete-card {
        padding: 30px 20px;
    }

    .step-icon {
        font-size: 3rem;
    }

    .step-card h2, .question h2 {
        font-size: 1.3rem;
    }

    .large-input {
        font-size: 1.2rem;
    }

    textarea {
        font-size: 1rem;
        padding: 15px;
    }

    .three-aspects {
        grid-template-columns: 1fr;
    }

    .btn {
        padding: 12px 30px;
        font-size: 1rem;
    }

    .btn-large {
        padding: 15px 35px;
        font-size: 1.1rem;
        width: 100%;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }
}
