/* =========================================
   Mastermind — Word Order Game Styles
   ========================================= */

.mm-hint {
    font-size: 0.85rem;
    color: var(--depths);
    line-height: 1.5;
    opacity: 0.85;
    padding: 0 4px;
}

/* ---- Board ---- */
#mm-board {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

/* ---- Word Block ---- */
.mm-block {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    border: 2px solid var(--drift);
    border-radius: 12px;
    padding: 13px 14px;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease,
                box-shadow 0.18s ease, transform 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.mm-block:active {
    transform: scale(0.97);
}

/* Position number badge */
.mm-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--breeze);
    color: var(--horizon);
    font-size: 0.78rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.18s ease, color 0.18s ease;
}

/* Word text */
.mm-label {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--navy);
    transition: color 0.18s ease;
}

/* ✓ / ✗ indicator on right */
.mm-indicator {
    font-size: 1.05rem;
    font-weight: 900;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* ---- Selected state (tap 1) ---- */
.mm-block.selected {
    background: var(--depths);
    border-color: var(--depths);
    box-shadow: 0 4px 14px rgba(64, 83, 128, 0.35);
    transform: scale(1.02);
}

.mm-block.selected .mm-num {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.mm-block.selected .mm-label {
    color: var(--white);
}

/* ---- Correct state (green) ---- */
.mm-block.correct {
    background: var(--success);
    border-color: var(--success);
    cursor: default;
    animation: mm-pop 0.3s ease;
}

.mm-block.correct .mm-num {
    background: rgba(255, 255, 255, 0.25);
    color: var(--white);
}

.mm-block.correct .mm-label {
    color: var(--white);
}

.mm-block.correct .mm-indicator {
    color: var(--white);
    opacity: 1;
}

/* ---- Wrong state (red) ---- */
.mm-block.wrong {
    background: #d9534f;
    border-color: #d9534f;
    cursor: default;
    animation: mm-pop 0.3s ease;
}

.mm-block.wrong .mm-num {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.mm-block.wrong .mm-label {
    color: var(--white);
}

.mm-block.wrong .mm-indicator {
    color: var(--white);
    opacity: 1;
}

@keyframes mm-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.03); }
    100% { transform: scale(1); }
}

/* ---- Submit Button ---- */
#mm-submit {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--horizon);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    margin-bottom: 10px;
}

#mm-submit:active {
    background: var(--depths);
}

#mm-submit:disabled {
    background: var(--mist);
    cursor: not-allowed;
}

/* ---- Attempts Counter ---- */
#mm-attempts {
    display: block;
    text-align: center;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--horizon);
    margin-bottom: 18px;
    transition: color 0.3s ease;
}

#mm-attempts.low {
    color: #d9534f;
}

/* ---- History ---- */
#mm-history {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.mm-history-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--white);
    border: 1.5px solid var(--breeze);
    border-radius: 10px;
    padding: 10px 14px;
    animation: mm-history-in 0.3s ease;
}

@keyframes mm-history-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mm-history-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--horizon);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 44px;
}

.mm-history-dots {
    display: flex;
    gap: 4px;
    flex: 1;
}

.mm-dot {
    width: 17px;
    height: 17px;
    border-radius: 4px;
    flex-shrink: 0;
}

.mm-dot.correct { background: var(--success); }
.mm-dot.wrong   { background: #d9534f; }

.mm-history-score {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--depths);
    flex-shrink: 0;
    min-width: 28px;
    text-align: right;
}

/* ---- Toast ---- */
#toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--navy);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 1;
    transition: opacity 0.4s ease;
    max-width: 320px;
    white-space: normal;
    text-align: center;
}

.toast.fade-out {
    opacity: 0;
}
