/* MyMemoryBack Public Styles */

.mmb-game-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Game Setup */
.mmb-game-setup {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mmb-game-setup h2 {
    margin-top: 0;
    color: #333;
    text-align: center;
    font-size: 28px;
}

.mmb-setup-form {
    max-width: 400px;
    margin: 0 auto;
}

.mmb-form-group {
    margin-bottom: 20px;
}

.mmb-difficulty-message {
    margin-bottom: 20px;
    font-size: 14px;
    color: #555;
}

.mmb-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.mmb-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.mmb-button {
    padding: 16px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mmb-button-primary {
    background-color: #003D8B;
    color: #fff;
    width: auto;
    min-width: 200px;
}

.mmb-button-primary:hover {
    background-color: #002d6e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 61, 139, 0.4);
}

.mmb-button-loading {
    opacity: 0.8;
    cursor: not-allowed !important;
}

.mmb-button-loading:hover {
    transform: none !important;
}

.mmb-button-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mmb-button-spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes mmb-button-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Game Play */
.mmb-game-play {
    background: #f8f9fa;
    border: 2px solid #c0c0c0;
    border-radius: 24px;
    padding: 40px 50px;
    box-shadow: none;
    position: relative;
}

/* Loading Spinner */
.mmb-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    min-height: 300px;
}

.mmb-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: mmb-spin 1s linear infinite;
}

@keyframes mmb-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mmb-loading-text {
    margin-top: 20px;
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

.mmb-game-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0;
    background: transparent;
    border-radius: 0;
    margin-bottom: 50px;
    flex-wrap: wrap;
    gap: 20px;
}

/* Left column: player name + category — all on one horizontal row */
.mmb-player-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.mmb-player-name-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.mmb-category-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.mmb-category-label {
    font-size: 10px;
    color: #999;
    font-style: italic;
}

/* Middle column: score + level — side by side on one row */
.mmb-score-level-stack {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.mmb-score-info,
.mmb-level-info {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Right column: buttons */
.mmb-game-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mmb-header-btn {
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
    line-height: 1.6;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f0f0f0;
    color: #333;
    transition: background 0.2s, border-color 0.2s;
}

.mmb-header-btn:hover {
    background: #e0e0e0;
    border-color: #aaa;
}

.mmb-label {
    font-weight: 700;
    color: #000;
    font-size: 10px;
    text-transform: uppercase;
}

.mmb-value {
    font-weight: 400;
    color: #7b8a9e;
    font-size: 10px;
}

.mmb-question-area {
    margin-bottom: 30px;
}

.mmb-question-text {
    font-size: 26px;
    font-weight: 500;
    color: #000;
    margin-bottom: 40px;
    line-height: 1.6;
}

.mmb-question-image {
    margin-bottom: 20px;
}

.mmb-question-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.mmb-answers-area {
    margin-bottom: 30px;
}

.mmb-answer-option {
    background: #f0f0f0;
    border: 2px solid #e6e6e6;
    border-radius: 12px;
    padding: 8px 24px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mmb-answer-option:hover {
    background: #0d6efd;
    border-color: #0b5ed7;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.35);
}

.mmb-answer-option:hover .mmb-answer-text {
    color: #fff;
}

.mmb-answer-option.selected {
    background: #0b5ed7;
    border-color: #0a58ca;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
    transition: none; /* Instant selection - no delay */
    cursor: pointer;
}

.mmb-answer-option.selected .mmb-answer-text {
    color: #fff;
}

.mmb-answer-option.correct {
    background: #d4edda;
    border-color: #28a745;
    cursor: pointer;
}

.mmb-answer-option.correct .mmb-answer-text {
    color: #000;
}

.mmb-answer-option.incorrect {
    background: #f8d7da;
    border-color: #dc3545;
    cursor: pointer;
}

.mmb-answer-option.incorrect .mmb-answer-text {
    color: #000;
}

.mmb-answer-icon {
    font-size: 24px;
    font-weight: bold;
    min-width: 24px;
    display: none;
}

.mmb-answer-option.correct .mmb-answer-icon {
    display: block;
    color: #28a745;
}

.mmb-answer-option.incorrect .mmb-answer-icon {
    display: block;
    color: #dc3545;
}

.mmb-answer-text {
    font-size: 18px;
    color: #000;
    flex: 1;
    font-weight: 500;
}

.mmb-feedback-area {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.mmb-feedback-area.correct {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mmb-feedback-area.incorrect {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.mmb-answer-description {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
    font-size: 15px;
    font-weight: normal;
    line-height: 1.6;
    text-align: left;
    color: #333;
    background: rgba(255, 255, 255, 0.5);
    padding: 15px;
    border-radius: 4px;
}

.mmb-feedback-area.correct .mmb-answer-description {
    background: rgba(255, 255, 255, 0.6);
    color: #0d4b1a;
}

.mmb-feedback-area.incorrect .mmb-answer-description {
    background: rgba(255, 255, 255, 0.6);
    color: #664d03;
}

.mmb-action-area {
    text-align: left;
    margin-top: 30px;
}

/* Game Completed */
.mmb-game-completed {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mmb-game-completed h2 {
    color: #28a745;
    font-size: 32px;
    margin-bottom: 20px;
}

.mmb-final-score {
    font-size: 24px;
    margin-bottom: 30px;
}

.mmb-final-score .mmb-value {
    font-size: 48px;
    color: #2271b1;
}

/* Modal */
.mmb-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.mmb-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.mmb-modal-content h3 {
    margin-top: 0;
    color: #333;
}

.mmb-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.mmb-modal-actions .mmb-button {
    flex: 1;
}

/* Login Required */
.mmb-login-required {
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
}

.mmb-login-box {
    background: #fff;
    border: 2px solid #2271b1;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.mmb-login-box h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2271b1;
    font-size: 28px;
}

.mmb-login-box p {
    font-size: 18px;
    color: #555;
    margin-bottom: 25px;
    line-height: 1.6;
}

.mmb-login-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mmb-login-actions .mmb-button {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    border-radius: 6px;
    transition: all 0.3s ease;
    min-width: 150px;
}

.mmb-login-actions .mmb-button-primary {
    background-color: #2271b1;
    color: #fff;
    width: auto;
}

.mmb-login-actions .mmb-button-primary:hover {
    background-color: #135e96;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(34, 113, 177, 0.3);
}

.mmb-login-actions .mmb-button-secondary {
    background-color: #fff;
    color: #2271b1;
    border: 2px solid #2271b1;
}

.mmb-login-actions .mmb-button-secondary:hover {
    background-color: #f0f6fc;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(34, 113, 177, 0.2);
}

.mmb-login-note {
    font-size: 14px;
    color: #666;
    font-style: italic;
    margin-top: 15px;
    margin-bottom: 0;
}

/* No Questions Message */
.mmb-no-questions {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    margin: 20px 0;
}

.mmb-no-questions h3 {
    color: #856404;
    margin-top: 0;
    margin-bottom: 15px;
}

.mmb-no-questions p {
    color: #856404;
    font-size: 16px;
    margin-bottom: 0;
}

/* ── Decode the Sentence Game ── */
.mmb-decode-sentence-area {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 4px;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.mmb-decode-word {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: flex-start;
}

.mmb-decode-cell {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    width: 28px;
    margin: 0 7px;
}

.mmb-decode-number {
    font-size: 14px;
    color: #d8abdb;
    margin-top: 5px;
    font-weight: 400;
    height: 22px;
    line-height: 16px;
}

#mmb-decode-sentence-area .mmb-decode-box {
    width: 28px;
    height: 40px;
    border-top: 0 none;
    border-left: 0 none;
    border-right: 0 none;
    border-bottom: 2px solid #ededed;
    border-radius: 0;
    padding: 0 3px;
    box-sizing: border-box;
    text-align: center;
    line-height: 40px;
    font-weight: 700;
    font-size: 18px;
    text-transform: uppercase;
    background: transparent;
    color: #333;
    transition: border-color 0.2s;
    box-shadow: none;
}

#mmb-decode-sentence-area .mmb-decode-box:focus {
    outline: none;
    border-bottom-color: #0d6efd;
    box-shadow: none;
}

#mmb-decode-sentence-area .mmb-decode-box.mmb-revealed {
    background: transparent;
    color: #333;
    cursor: default;
}

#mmb-decode-sentence-area .mmb-decode-box.mmb-correct {
    border-bottom-color: #28a745;
    color: #155724;
}

#mmb-decode-sentence-area .mmb-decode-box.mmb-incorrect {
    border-bottom-color: #dc3545;
    color: #721c24;
}

.mmb-decode-space {
    width: 20px;
    flex-shrink: 0;
}

.mmb-decode-punctuation {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    width: 20px;
}

.mmb-decode-punctuation-char {
    width: 20px;
    height: 36px;
    text-align: center;
    line-height: 36px;
    font-weight: 700;
    font-size: 18px;
    color: #333;
}

.mmb-decode-attempts {
    text-align: center;
    margin: 15px 0;
    font-size: 14px;
    color: #666;
}

.mmb-decode-attempts .mmb-attempt-dots {
    display: inline-flex;
    gap: 6px;
    margin-left: 8px;
}

.mmb-decode-attempts .mmb-attempt-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e0e0e0;
    display: inline-block;
}

.mmb-decode-attempts .mmb-attempt-dot.used {
    background: #dc3545;
}

.mmb-decode-description {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.15);
    font-size: 15px;
    font-weight: normal;
    line-height: 1.6;
    text-align: left;
}

.mmb-decode-word-break {
    width: 100%;
    height: 0;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .mmb-game-container {
        padding: 10px;
    }

    .mmb-game-play {
        padding: 30px 20px;
        border-radius: 16px;
    }

    .mmb-game-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 30px;
        gap: 12px;
    }

    .mmb-question-text {
        font-size: 20px;
        margin-bottom: 30px;
    }

    .mmb-answer-option {
        padding: 16px 20px;
        margin-bottom: 12px;
    }

    .mmb-answer-text {
        font-size: 16px;
    }

    .mmb-button-primary {
        width: 100%;
        min-width: auto;
    }

    .mmb-modal-actions {
        flex-direction: column;
    }

    .mmb-login-required {
        padding: 10px;
        margin: 20px auto;
    }

    .mmb-login-box {
        padding: 25px 20px;
    }

    .mmb-login-box h3 {
        font-size: 24px;
    }

    .mmb-login-box p {
        font-size: 16px;
    }

    .mmb-login-actions {
        flex-direction: column;
        gap: 10px;
    }

    .mmb-login-actions .mmb-button {
        width: 100%;
        min-width: auto;
    }

    .mmb-decode-cell {
        width: 24px;
        margin: 0 5px;
    }

    .mmb-decode-box {
        width: 24px;
        height: 34px;
        line-height: 34px;
        font-size: 15px;
    }

    .mmb-decode-space {
        width: 14px;
    }
}

