@charset "UTF-8";

.quiz-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    padding-bottom: 100px;
}

.quiz-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: #e8f5e9;
    border-radius: 16px;
    color: #2e7d32;
}

.quiz-header h1 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 700;
}

.quiz-header .subtitle {
    margin: 8px 0 0;
    opacity: 0.8;
    font-size: 1em;
}

/* Screen */
.screen {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(46, 125, 50, 0.1);
}

.screen.hidden {
    display: none;
}

/* Question Box */
.question-box {
    text-align: center;
    padding: 32px 24px;
    background: #e8f5e9;
    border-radius: 12px;
    margin-bottom: 24px;
}

.question-text {
    font-size: 1.6em;
    font-weight: 700;
    color: #2e7d32;
    word-break: keep-all;
}

/* Options Grid */
.options-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    padding: 16px 20px;
    border: 2px solid #a5d6a7;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 1em;
    color: #2e7d32;
    transition: all 0.2s ease;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
}

.option-btn:hover:not(.disabled) {
    border-color: #66bb6a;
    background: #e8f5e9;
}

.option-btn.correct {
    border-color: #4caf50;
    background: #c8e6c9;
    color: #1b5e20;
}

.option-btn.incorrect {
    border-color: #81c784;
    background: #e8f5e9;
    color: #2e7d32;
}

.option-btn.disabled {
    cursor: default;
    opacity: 0.7;
}

.option-btn.confusing {
    border-color: #ef4444;
    background: #fef2f2;
    color: #dc2626;
}

.option-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-confusing-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.add-confusing-btn:hover {
    border-color: #ef4444;
    background: #fef2f2;
    color: #dc2626;
}

/* Feedback */
.feedback {
    margin-top: 20px;
    padding: 16px;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
}

.feedback.correct {
    background: #fde047;
    color: #422006;
}

.feedback.incorrect {
    background: #facc15;
    color: #713f12;
}

.feedback.hidden {
    display: none;
}

/* Review Screen */
#review-screen h2 {
    text-align: center;
    color: #854d0e;
    margin-bottom: 16px;
    font-size: 1.3em;
}

.review-progress {
    text-align: center;
    color: #a16207;
    font-size: 0.9em;
    margin-bottom: 16px;
}

/* Next Button */
.next-btn {
    width: 100%;
    padding: 16px;
    margin-top: 20px;
    border: none;
    border-radius: 10px;
    background: #facc15;
    color: #713f12;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 52px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.next-btn:hover {
    background: #eab308;
}

.next-btn.hidden {
    display: none;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(133, 77, 14, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    padding-bottom: env(safe-area-inset-bottom, 20px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    touch-action: manipulation;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3em;
    color: #854d0e;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    color: #a16207;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.modal-close:hover {
    color: #854d0e;
    background: rgba(161, 98, 7, 0.1);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fef9c3;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-size: 1.8em;
    font-weight: 700;
    color: #ca8a04;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85em;
    color: #a16207;
}

.stats-actions {
    text-align: center;
}

.reset-btn {
    padding: 12px 24px;
    border: 2px solid #eab308;
    border-radius: 8px;
    background: #fff;
    color: #ca8a04;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s ease;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.reset-btn:hover {
    background: #fef08a;
}

/* FAB Group */
.fab-group {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.fab {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    border-radius: 50%;
    background: #facc15;
    color: #713f12;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(250, 204, 21, 0.4);
    transition: all 0.3s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.fab:hover {
    background: #eab308;
    transform: scale(1.05);
}

/* Badge */
.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    background: #dc2626;
    color: white;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 2px solid white;
}

.badge.hidden {
    display: none;
}

.badge.confusing-badge {
    background: #8b5cf6;
}

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9em;
    z-index: 2000;
    animation: toast-in 0.3s ease;
}

.toast.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Wrong List Screen */
#wrong-list-screen h2 {
    text-align: center;
    color: #854d0e;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.wrong-list {
    max-height: 60vh;
    overflow-y: auto;
}

.wrong-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #fef9c3;
    border-radius: 10px;
    margin-bottom: 10px;
}

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

.wrong-en {
    font-size: 1.1em;
    font-weight: 600;
    color: #854d0e;
}

.wrong-ko {
    font-size: 1em;
    color: #ca8a04;
    font-weight: 500;
}

.wrong-empty {
    text-align: center;
    padding: 40px 20px;
    color: #a16207;
}

.wrong-empty small {
    display: block;
    margin-top: 8px;
    opacity: 0.7;
}

.wrong-item-content {
    flex: 1;
    margin-right: 12px;
}

.remove-confusing-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 8px;
    border: none;
    background: #fee2e2;
    color: #dc2626;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-confusing-btn:hover {
    background: #fecaca;
}

#confusing-list-screen h2 {
    text-align: center;
    color: #7c3aed;
    margin-bottom: 20px;
    font-size: 1.3em;
}

@media (max-width: 480px) {
    .quiz-container {
        padding: 12px;
        padding-bottom: 120px;
    }

    .quiz-header {
        padding: 16px;
    }

    .quiz-header h1 {
        font-size: 1.4em;
    }

    .screen {
        padding: 16px;
    }

    .question-box {
        padding: 24px 16px;
    }

    .question-text {
        font-size: 1.3em;
    }

    .fab-group {
        bottom: 16px;
        right: 16px;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .fab {
        width: 52px;
        height: 52px;
        min-width: 52px;
        min-height: 52px;
    }

    .fab svg {
        width: 22px;
        height: 22px;
    }

    .stats-grid {
        gap: 12px;
    }

    .stat-card {
        padding: 12px;
    }

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

    .wrong-item {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 14px;
    }

    .option-btn {
        padding: 14px 16px;
        font-size: 0.95em;
        min-height: 52px;
    }

    .add-confusing-btn {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
    }

    .modal {
        padding: 12px;
        align-items: flex-end;
    }

    .modal-content {
        border-radius: 16px 16px 0 0;
        max-height: 85vh;
    }

    .next-btn {
        padding: 14px;
        font-size: 1em;
    }

    .question-box {
        margin-bottom: 16px;
    }

    .feedback {
        padding: 12px;
        font-size: 0.95em;
    }

    .quiz-header .subtitle {
        font-size: 0.9em;
    }

    .modal-header h2 {
        font-size: 1.2em;
    }
}

@media (max-width: 360px) {
    .quiz-container {
        padding: 10px;
        padding-bottom: 100px;
    }

    .quiz-header {
        padding: 14px;
    }

    .quiz-header h1 {
        font-size: 1.2em;
    }

    .screen {
        padding: 12px;
    }

    .question-text {
        font-size: 1.15em;
    }

    .option-btn {
        padding: 12px 14px;
        font-size: 0.9em;
        min-height: 48px;
    }

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

    .stat-label {
        font-size: 0.8em;
    }

    .fab {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .quiz-container {
        padding: 10px;
        padding-bottom: 60px;
    }

    .quiz-header {
        padding: 12px;
        margin-bottom: 12px;
    }

    .quiz-header h1 {
        font-size: 1.2em;
    }

    .screen {
        padding: 12px;
    }

    .question-box {
        padding: 16px 12px;
        margin-bottom: 12px;
    }

    .question-text {
        font-size: 1.1em;
    }

    .options-grid {
        gap: 8px;
    }

    .option-btn {
        padding: 10px 12px;
        min-height: 44px;
    }

    .fab-group {
        bottom: 12px;
        right: 12px;
    }

    .fab {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    .fab svg {
        width: 18px;
        height: 18px;
    }
}
