/* ============================================
   Mindful Vocabulary 専用スタイル
   ============================================ */

/* 統計エリア */
.stats {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #faf8f6;
    border-radius: 8px;
    border: 1px solid #e8e3dd;
}

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

.stat-label {
    font-size: 0.75em;
    color: #9a8a7a;
    margin-bottom: 5px;
    font-weight: 300;
}

.stat-value {
    font-size: 1.8em;
    font-weight: 400;
    color: #5a4a3a;
}

/* レベル選択 */
.level-selector {
    margin-bottom: 30px;
    text-align: center;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.level-btn {
    padding: 10px 20px;
    border: 1px solid #c9b8a8;
    background: white;
    color: #5a4a3a;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.level-btn:hover {
    background: #faf8f6;
    border-color: #8b7355;
}

.level-btn.active {
    background: #8b7355;
    color: white;
    border-color: #8b7355;
}

/* 画像エリア */
.image-area {
    margin-bottom: 30px;
}

.image-container {
    position: relative;
    /*max-width: 640px;*/
    max-width: 512px;
    margin: 0 auto;
    background: #faf8f6;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e8e3dd;
    aspect-ratio: 1 / 1; /* 正方形を維持 */
}

#wordImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(250, 248, 246, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e8e3dd;
    border-top-color: #8b7355;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 選択肢エリア */
.choices-area {
    margin-bottom: 30px;
}

.instruction {
    text-align: center;
    color: #8b7355;
    margin-bottom: 20px;
    font-size: 1em;
    font-weight: 400;
}

.choices-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.choice-btn {
    padding: 18px 24px;
    background: white;
    border: 2px solid #c9b8a8;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1em;
    color: #5a4a3a;
    transition: all 0.2s ease;
    font-weight: 400;
    text-align: center;
}

.choice-btn:hover {
    background: #faf8f6;
    border-color: #8b7355;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

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

.choice-btn.selected {
    background: #8b7355;
    color: white;
    border-color: #8b7355;
}

.choice-btn.correct {
    background: #d4c5b3;
    border-color: #c9b8a8;
    color: #5a4a3a;
}

.choice-btn.incorrect {
    background: #faf8f6;
    border-color: #c9b8a8;
    color: #9a8a7a;
}

.choice-btn.disabled {
    pointer-events: none;
    opacity: 0.6;
}

/* フィードバック（シンプル版 - 正解/不正解の表示なし） */
.feedback {
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #e8e3dd;
    background: #faf8f6;
}

.feedback.correct {
    background: #faf8f6;
    border-color: #e8e3dd;
}

.feedback.incorrect {
    background: #faf8f6;
    border-color: #e8e3dd;
}

.feedback-content {
    margin-bottom: 20px;
}

.feedback-text {
    display: none; /* 正解/不正解のテキストを非表示 */
}

.correct-word {
    font-size: 1.4em;
    font-weight: 500;
    color: #5a4a3a;
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.word-info {
    font-size: 0.9em;
    color: #8b7355;
    margin-top: 8px;
}

.phonetic {
    color: #9a8a7a;
    margin-right: 8px;
}

.katakana {
    color: #9a8a7a;
}

/* ボタン */
.btn {
    padding: 12px 32px;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s ease;
    font-weight: 400;
}

.btn-next {
    background: #8b7355;
    color: white;
}

.btn-next:hover {
    background: #7a6448;
}

/* 音声コントロール */
.audio-controls {
    text-align: center;
    margin-top: 15px;
}

.btn-speak-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(139, 115, 85, 0.1);
    cursor: pointer;
    font-size: 24px;
    transition: all 0.2s ease;
}

.btn-speak-inline:hover {
    background: rgba(139, 115, 85, 0.2);
    transform: scale(1.1);
}

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

.btn-speak-inline.playing {
    animation: pulse 1s infinite;
}

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

/* ローディングとエラー */
.loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.1em;
    color: #8b7355;
}

.error {
    text-align: center;
    padding: 40px;
    color: #6a4a4a;
    background: #faf5f5;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #d4c5c5;
}

.hidden {
    display: none !important;
}

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

    h1 {
        font-size: 1.5em;
    }

    .level-selector {
        gap: 6px;
    }

    .level-btn {
        padding: 8px 14px;
        font-size: 0.75em;
    }

    .image-container {
        max-width: 100%;
    }

    .choices-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .choice-btn {
        padding: 16px 20px;
        font-size: 1em;
    }

    .correct-word {
        font-size: 1.2em;
        flex-direction: column;
        gap: 8px;
    }

    .btn {
        padding: 10px 24px;
        font-size: 0.95em;
    }

    .stats {
        padding: 15px;
    }

    .stat-value {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .level-btn {
        padding: 6px 10px;
        font-size: 0.7em;
    }

    .choice-btn {
        padding: 14px 18px;
        font-size: 0.95em;
    }

    .feedback {
        padding: 20px;
    }

    .btn-speak-inline {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

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

.feedback {
    animation: fadeIn 0.3s ease-out;
}

.choice-btn {
    animation: fadeIn 0.3s ease-out;
}

.image-container img {
    animation: fadeIn 0.4s ease-out;
}
