    /* ============================================================
       CSS Custom Properties
       ============================================================ */
    :root {
        --mm-primary: #6366f1;
        --mm-primary-dark: #4f46e5;
        --mm-primary-light: #818cf8;
        --mm-secondary: #8b5cf6;
        --mm-accent: #a855f7;
        --mm-success: #10b981;
        --mm-success-dark: #059669;
        --mm-warning: #f59e0b;
        --mm-warning-dark: #d97706;
        --mm-danger: #ef4444;
        --mm-danger-dark: #dc2626;
        --mm-gray-50: #f9fafb;
        --mm-gray-100: #f3f4f6;
        --mm-gray-200: #e5e7eb;
        --mm-gray-300: #d1d5db;
        --mm-gray-400: #9ca3af;
        --mm-gray-500: #6b7280;
        --mm-gray-600: #4b5563;
        --mm-gray-700: #374151;
        --mm-gray-800: #1f2937;
        --mm-gray-900: #111827;
        --mm-indigo-900: #1e1b4b;
        --mm-radius-sm: 8px;
        --mm-radius-md: 12px;
        --mm-radius-lg: 16px;
        --mm-radius-xl: 20px;
        --mm-radius-full: 9999px;
        --mm-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
        --mm-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
        --mm-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
        --mm-shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.2);
        --mm-transition-fast: 0.15s ease;
        --mm-transition-normal: 0.3s ease;
        --mm-transition-slow: 0.5s ease;
    }

    /* Keyframe Animations */
    @keyframes mm-fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
    @keyframes mm-fadeIn { from { opacity: 0; } to { opacity: 1; } }
    @keyframes mm-cellAppear { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: scale(1); } }
    @keyframes mm-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
    @keyframes mm-pulseGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); } 50% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); } }
    @keyframes mm-shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
    @keyframes mm-slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
    @keyframes mm-slideInLeft { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
    @keyframes mm-highlightPulse { 0% { background: linear-gradient(135deg, #c4b5fd, #a78bfa); } 50% { background: linear-gradient(135deg, #a78bfa, #7c3aed); } 100% { background: linear-gradient(135deg, #c4b5fd, #a78bfa); } }
    @keyframes mm-toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
    @keyframes mm-toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }
    @keyframes mm-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
    @keyframes mm-bounceIn { 0% { transform: scale(0.3); opacity: 0; } 50% { transform: scale(1.05); } 70% { transform: scale(0.95); } 100% { transform: scale(1); opacity: 1; } }
    @keyframes mm-wordFound { 0% { background: #d1fae5; transform: scale(1); } 50% { background: #6ee7b7; transform: scale(1.05); } 100% { background: #d1fae5; transform: scale(1); } }

    /* ============================================================
       Page Layout
       ============================================================ */
    .mm-page {
        min-height: 100vh;
        background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
        padding: 2rem 0 4rem;
        position: relative;
        overflow: hidden;
    }

    .mm-page::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
                    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
                    radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.03) 0%, transparent 40%);
        pointer-events: none;
    }

    .mm-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 1.5rem;
        position: relative;
        z-index: 1;
    }

    /* ============================================================
       Header
       ============================================================ */
    .mm-header {
        text-align: center;
        color: white;
        margin-bottom: 2.5rem;
        animation: mm-fadeInUp 0.6s ease;
    }

    .mm-header h1 {
        font-size: clamp(1.8rem, 4vw, 2.8rem);
        margin-bottom: 0.5rem;
        font-weight: 800;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
        letter-spacing: -0.02em;
    }

    .mm-header h1 .mm-header-icon {
        display: inline-block;
        margin-right: 0.3rem;
        animation: mm-pulse 2s ease infinite;
    }

    .mm-header p {
        font-size: 1.15rem;
        opacity: 0.9;
        font-weight: 400;
    }

    .mm-header-badges {
        display: flex;
        justify-content: center;
        gap: 0.75rem;
        margin-top: 1rem;
        flex-wrap: wrap;
    }

    .mm-header-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        background: rgba(255, 255, 255, 0.18);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.25);
        padding: 0.35rem 0.9rem;
        border-radius: var(--mm-radius-full);
        font-size: 0.85rem;
        color: white;
        font-weight: 500;
    }

    /* Toast Notification System */
    .mm-toast-container { position: fixed; top: 1.5rem; right: 1.5rem; z-index: 10000; display: flex; flex-direction: column; gap: 0.75rem; pointer-events: none; }
    .mm-toast { display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1.25rem; border-radius: var(--mm-radius-md); background: white; box-shadow: 0 10px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08); min-width: 300px; max-width: 420px; pointer-events: auto; animation: mm-toastIn 0.4s ease; border-left: 4px solid var(--mm-primary); }
    .mm-toast.mm-toast-removing { animation: mm-toastOut 0.3s ease forwards; }
    .mm-toast-success { border-left-color: var(--mm-success); }
    .mm-toast-error { border-left-color: var(--mm-danger); }
    .mm-toast-info { border-left-color: var(--mm-primary); }
    .mm-toast-warning { border-left-color: var(--mm-warning); }
    .mm-toast-icon { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; }
    .mm-toast-success .mm-toast-icon { background: #d1fae5; color: #065f46; }
    .mm-toast-error .mm-toast-icon { background: #fee2e2; color: #991b1b; }
    .mm-toast-info .mm-toast-icon { background: #e0e7ff; color: #3730a3; }
    .mm-toast-warning .mm-toast-icon { background: #fef3c7; color: #92400e; }
    .mm-toast-body { flex: 1; min-width: 0; }
    .mm-toast-title { font-weight: 600; font-size: 0.9rem; color: var(--mm-gray-800); margin-bottom: 0.1rem; }
    .mm-toast-message { font-size: 0.82rem; color: var(--mm-gray-500); line-height: 1.4; }
    .mm-toast-close { flex-shrink: 0; background: none; border: none; color: var(--mm-gray-400); cursor: pointer; padding: 0.25rem; font-size: 1.1rem; line-height: 1; transition: color var(--mm-transition-fast); border-radius: 4px; }
    .mm-toast-close:hover { color: var(--mm-gray-700); background: var(--mm-gray-100); }

    /* ============================================================
       Cards
       ============================================================ */
    .mm-card {
        background: white;
        border-radius: var(--mm-radius-lg);
        padding: 2rem;
        box-shadow: var(--mm-shadow-lg);
        margin-bottom: 2rem;
        animation: mm-fadeInUp 0.6s ease;
        animation-fill-mode: both;
        transition: box-shadow var(--mm-transition-normal);
    }

    .mm-card:nth-child(2) { animation-delay: 0.1s; }
    .mm-card:nth-child(3) { animation-delay: 0.2s; }

    .mm-card:hover {
        box-shadow: var(--mm-shadow-xl);
    }

    .mm-card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 1.5rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .mm-card h2 {
        font-size: 1.3rem;
        color: var(--mm-indigo-900);
        margin-bottom: 0;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .mm-card h2 .mm-section-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: linear-gradient(135deg, var(--mm-primary), var(--mm-secondary));
        border-radius: var(--mm-radius-sm);
        color: white;
        font-size: 1rem;
    }

    /* ============================================================
       Word Count Badge
       ============================================================ */
    .mm-word-count-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        padding: 0.35rem 0.85rem;
        border-radius: var(--mm-radius-full);
        background: var(--mm-gray-100);
        color: var(--mm-gray-600);
        font-size: 0.85rem;
        font-weight: 600;
        transition: all var(--mm-transition-normal);
    }

    .mm-word-count-badge.mm-has-words {
        background: #e0e7ff;
        color: #3730a3;
    }

    .mm-word-count-badge.mm-over-limit {
        background: #fee2e2;
        color: #991b1b;
        animation: mm-pulse 1s ease infinite;
    }

    /* ============================================================
       Word Tags System
       ============================================================ */
    .mm-word-input-area {
        margin-bottom: 1.5rem;
    }

    .mm-word-input-row {
        display: flex;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .mm-word-input {
        flex: 1;
        padding: 0.75rem 1rem;
        border: 2px solid var(--mm-gray-200);
        border-radius: var(--mm-radius-md);
        font-size: 1rem;
        font-family: inherit;
        transition: all var(--mm-transition-normal);
        background: white;
    }

    .mm-word-input:focus {
        outline: none;
        border-color: var(--mm-primary);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }

    .mm-word-input::placeholder {
        color: var(--mm-gray-400);
    }

    .mm-btn-add-word {
        padding: 0.75rem 1.25rem;
        background: linear-gradient(135deg, var(--mm-primary), var(--mm-secondary));
        color: white;
        border: none;
        border-radius: var(--mm-radius-md);
        font-size: 0.95rem;
        font-weight: 600;
        cursor: pointer;
        transition: all var(--mm-transition-normal);
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
    }

    .mm-btn-add-word:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    }

    .mm-btn-add-word:active {
        transform: translateY(0);
    }

    .mm-word-input-hint {
        font-size: 0.8rem;
        color: var(--mm-gray-400);
        margin-bottom: 0.75rem;
    }

    .mm-word-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        min-height: 44px;
        padding: 0.75rem;
        border: 2px dashed var(--mm-gray-200);
        border-radius: var(--mm-radius-md);
        background: var(--mm-gray-50);
        transition: all var(--mm-transition-normal);
    }

    .mm-word-tags:empty::before {
        content: 'Les mots ajoutés apparaîtront ici...';
        color: var(--mm-gray-400);
        font-size: 0.9rem;
        font-style: italic;
    }

    .mm-word-tags.mm-drag-over {
        border-color: var(--mm-primary);
        background: #eef2ff;
    }

    .mm-word-tag {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        padding: 0.4rem 0.55rem 0.4rem 0.85rem;
        background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
        color: #3730a3;
        border-radius: var(--mm-radius-full);
        font-size: 0.88rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        animation: mm-bounceIn 0.3s ease;
        transition: all var(--mm-transition-fast);
    }

    .mm-word-tag:hover {
        background: linear-gradient(135deg, #c7d2fe, #a5b4fc);
        transform: translateY(-1px);
        box-shadow: var(--mm-shadow-sm);
    }

    .mm-word-tag-delete {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: rgba(55, 48, 163, 0.15);
        color: #3730a3;
        border: none;
        cursor: pointer;
        font-size: 0.75rem;
        line-height: 1;
        padding: 0;
        transition: all var(--mm-transition-fast);
    }

    .mm-word-tag-delete:hover {
        background: #ef4444;
        color: white;
    }

    /* ============================================================
       Predefined Word Lists (Visual Cards)
       ============================================================ */
    .mm-presets-section {
        margin-bottom: 1.5rem;
    }

    .mm-presets-label {
        display: block;
        font-weight: 600;
        color: var(--mm-gray-700);
        margin-bottom: 0.75rem;
        font-size: 0.95rem;
    }

    .mm-presets-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 0.6rem;
    }

    .mm-preset-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.3rem;
        padding: 0.75rem 0.5rem;
        background: white;
        border: 2px solid var(--mm-gray-200);
        border-radius: var(--mm-radius-md);
        font-size: 0.82rem;
        font-weight: 600;
        color: var(--mm-gray-700);
        cursor: pointer;
        transition: all var(--mm-transition-normal);
    }

    .mm-preset-btn:hover {
        border-color: var(--mm-primary);
        color: var(--mm-primary);
        background: #f5f3ff;
        transform: translateY(-2px);
        box-shadow: var(--mm-shadow-md);
    }

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

    .mm-preset-btn .mm-preset-icon {
        font-size: 1.6rem;
        line-height: 1;
    }

    .mm-preset-btn .mm-preset-count {
        font-size: 0.7rem;
        color: var(--mm-gray-400);
        font-weight: 400;
    }

    /* ============================================================
       Difficulty Visual Indicator
       ============================================================ */
    .mm-difficulty-bar {
        display: flex;
        gap: 4px;
        margin-top: 0.5rem;
        align-items: center;
    }

    .mm-difficulty-bar-segment {
        height: 6px;
        flex: 1;
        border-radius: 3px;
        background: var(--mm-gray-200);
        transition: background var(--mm-transition-normal);
    }

    .mm-difficulty-bar-segment.mm-active { background: var(--mm-success); }
    .mm-difficulty-bar[data-level="medium"] .mm-active { background: var(--mm-warning); }
    .mm-difficulty-bar[data-level="hard"] .mm-active { background: var(--mm-danger); }

    .mm-difficulty-label {
        font-size: 0.75rem;
        font-weight: 700;
        margin-left: 0.5rem;
        text-transform: uppercase;
    }

    .mm-difficulty-label-easy { color: var(--mm-success); }
    .mm-difficulty-label-medium { color: var(--mm-warning); }
    .mm-difficulty-label-hard { color: var(--mm-danger); }

    /* ============================================================
       Grid Size Buttons
       ============================================================ */
    .mm-grid-size-btns {
        display: flex;
        gap: 0.4rem;
        flex-wrap: wrap;
    }

    .mm-grid-size-btn {
        padding: 0.5rem 0.85rem;
        border: 2px solid var(--mm-gray-200);
        border-radius: var(--mm-radius-sm);
        background: white;
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--mm-gray-600);
        cursor: pointer;
        transition: all var(--mm-transition-fast);
    }

    .mm-grid-size-btn:hover {
        border-color: var(--mm-primary-light);
        color: var(--mm-primary);
    }

    .mm-grid-size-btn.mm-active {
        border-color: var(--mm-primary);
        background: var(--mm-primary);
        color: white;
    }

    /* ============================================================
       Timer
       ============================================================ */
    .mm-timer-section {
        display: flex;
        align-items: center;
        gap: 1rem;
        margin-bottom: 1rem;
        flex-wrap: wrap;
    }

    .mm-timer-display {
        font-family: 'Courier New', monospace;
        font-size: 1.8rem;
        font-weight: 700;
        color: var(--mm-indigo-900);
        min-width: 90px;
        text-align: center;
    }

    .mm-timer-display.mm-timer-warning { color: var(--mm-warning); }
    .mm-timer-display.mm-timer-danger { color: var(--mm-danger); animation: mm-pulse 0.5s ease infinite; }

    .mm-best-score {
        font-size: 0.8rem;
        color: var(--mm-gray-500);
        padding: 0.3rem 0.7rem;
        background: var(--mm-gray-50);
        border-radius: var(--mm-radius-full);
        border: 1px solid var(--mm-gray-200);
    }

    .mm-interactive-stats {
        display: flex;
        gap: 0.75rem;
        flex-wrap: wrap;
        margin-bottom: 1rem;
    }

    .mm-interactive-stat {
        padding: 0.4rem 0.85rem;
        border-radius: var(--mm-radius-full);
        font-size: 0.85rem;
        font-weight: 600;
        background: var(--mm-gray-50);
        border: 1px solid var(--mm-gray-200);
        color: var(--mm-gray-700);
    }

    .mm-interactive-stat-success {
        background: #d1fae5;
        border-color: #6ee7b7;
        color: #065f46;
    }

    /* Hint highlight */
    .mm-grid td.mm-hint-cell {
        background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
        color: white !important;
        box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
        animation: mm-pulse 1s ease infinite;
    }

    /* ============================================================
       Options Row
       ============================================================ */
    .mm-options-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .mm-form-group {
        margin-bottom: 1.5rem;
    }

    .mm-form-group label {
        display: block;
        font-weight: 600;
        color: var(--mm-gray-700);
        margin-bottom: 0.5rem;
        font-size: 0.95rem;
    }

    .mm-select {
        width: 100%;
        padding: 0.75rem 1rem;
        border: 2px solid var(--mm-gray-200);
        border-radius: var(--mm-radius-md);
        font-size: 1rem;
        background: white;
        cursor: pointer;
        transition: all var(--mm-transition-normal);
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8.825L.575 3.4l1.05-1.05L6 6.725l4.375-4.375 1.05 1.05z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 1rem center;
        padding-right: 2.5rem;
    }

    .mm-select:focus {
        outline: none;
        border-color: var(--mm-primary);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }

    .mm-select:hover {
        border-color: var(--mm-gray-300);
    }

    /* ============================================================
       Difficulty Direction Indicators
       ============================================================ */
    .mm-difficulty-info {
        display: flex;
        gap: 0.5rem;
        margin-top: 0.75rem;
        flex-wrap: wrap;
    }

    .mm-dir-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.3rem;
        font-size: 0.78rem;
        padding: 0.3rem 0.65rem;
        border-radius: var(--mm-radius-full);
        font-weight: 500;
        transition: all var(--mm-transition-normal);
    }

    .mm-dir-badge-active {
        background: #d1fae5;
        color: #065f46;
    }

    .mm-dir-badge-inactive {
        background: var(--mm-gray-100);
        color: var(--mm-gray-400);
        text-decoration: line-through;
    }

    .mm-difficulty-tooltip {
        display: block;
        font-size: 0.8rem;
        color: var(--mm-gray-500);
        margin-top: 0.5rem;
        font-style: italic;
    }

    /* ============================================================
       Buttons
       ============================================================ */
    .mm-btn-row {
        display: flex;
        gap: 0.75rem;
        flex-wrap: wrap;
        margin-top: 1.5rem;
    }

    .mm-btn {
        padding: 0.85rem 1.75rem;
        border: none;
        border-radius: var(--mm-radius-md);
        font-size: 0.95rem;
        font-weight: 600;
        cursor: pointer;
        transition: all var(--mm-transition-normal);
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        position: relative;
        overflow: hidden;
    }

    .mm-btn::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        transform: translate(-50%, -50%);
        transition: width 0.5s, height 0.5s;
    }

    .mm-btn:active::after {
        width: 300px;
        height: 300px;
    }

    .mm-btn-primary {
        background: linear-gradient(135deg, var(--mm-primary), var(--mm-secondary));
        color: white;
        animation: mm-pulseGlow 2.5s ease infinite;
    }

    .mm-btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(99, 102, 241, 0.45);
        filter: brightness(1.05);
    }

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

    .mm-btn-secondary {
        background: var(--mm-gray-100);
        color: var(--mm-gray-700);
    }

    .mm-btn-secondary:hover {
        background: var(--mm-gray-200);
        transform: translateY(-1px);
        box-shadow: var(--mm-shadow-sm);
    }

    .mm-btn-success {
        background: linear-gradient(135deg, var(--mm-success), var(--mm-success-dark));
        color: white;
    }

    .mm-btn-success:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
        filter: brightness(1.05);
    }

    .mm-btn-warning {
        background: linear-gradient(135deg, var(--mm-warning), var(--mm-warning-dark));
        color: white;
    }

    .mm-btn-warning:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
        filter: brightness(1.05);
    }

    .mm-btn-danger {
        background: linear-gradient(135deg, var(--mm-danger), var(--mm-danger-dark));
        color: white;
    }

    .mm-btn-danger:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
    }

    .mm-btn-outline {
        background: white;
        color: var(--mm-gray-700);
        border: 2px solid var(--mm-gray-200);
    }

    .mm-btn-outline:hover {
        border-color: var(--mm-primary);
        color: var(--mm-primary);
        background: #f5f3ff;
        transform: translateY(-1px);
    }

    .mm-btn-sm {
        padding: 0.55rem 1rem;
        font-size: 0.85rem;
        border-radius: var(--mm-radius-sm);
    }

    .mm-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none !important;
        box-shadow: none !important;
        animation: none !important;
        filter: grayscale(0.3);
    }

    .mm-btn-icon {
        font-size: 1.1rem;
        line-height: 1;
    }

    /* Loading Spinner */
    .mm-spinner { display: inline-block; width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: mm-spin 0.7s linear infinite; }
    .mm-btn-loading .mm-btn-icon { display: none; }
    .mm-btn-loading .mm-spinner { display: inline-block; }
    .mm-btn:not(.mm-btn-loading) .mm-spinner { display: none; }

    /* Empty State */
    .mm-empty-state { text-align: center; padding: 3rem 2rem; animation: mm-fadeIn 0.5s ease; }
    .mm-empty-illustration { font-size: 4rem; margin-bottom: 1rem; opacity: 0.8; display: block; }
    .mm-empty-title { font-size: 1.2rem; font-weight: 700; color: var(--mm-gray-800); margin-bottom: 0.5rem; }
    .mm-empty-text { font-size: 0.95rem; color: var(--mm-gray-500); max-width: 400px; margin: 0 auto; line-height: 1.6; }
    .mm-empty-arrow { display: block; margin-top: 1.5rem; font-size: 1.5rem; color: var(--mm-primary-light); opacity: 0.6; animation: mm-pulse 2s ease infinite; }

    /* ============================================================
       Skeleton Loading
       ============================================================ */
    .mm-skeleton {
        display: none;
    }

    .mm-skeleton.mm-visible {
        display: block;
    }

    .mm-skeleton-grid {
        display: grid;
        gap: 3px;
        margin: 0 auto;
        max-width: fit-content;
    }

    .mm-skeleton-cell {
        width: 36px;
        height: 36px;
        border-radius: 4px;
        background: linear-gradient(90deg, var(--mm-gray-100) 25%, var(--mm-gray-200) 50%, var(--mm-gray-100) 75%);
        background-size: 200% 100%;
        animation: mm-shimmer 1.5s ease infinite;
    }

    .mm-skeleton-words {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        min-width: 180px;
    }

    .mm-skeleton-word {
        height: 28px;
        border-radius: var(--mm-radius-sm);
        background: linear-gradient(90deg, var(--mm-gray-100) 25%, var(--mm-gray-200) 50%, var(--mm-gray-100) 75%);
        background-size: 200% 100%;
        animation: mm-shimmer 1.5s ease infinite;
    }

    .mm-skeleton-word:nth-child(1) { width: 120px; animation-delay: 0.1s; }
    .mm-skeleton-word:nth-child(2) { width: 90px; animation-delay: 0.2s; }
    .mm-skeleton-word:nth-child(3) { width: 140px; animation-delay: 0.3s; }
    .mm-skeleton-word:nth-child(4) { width: 100px; animation-delay: 0.4s; }
    .mm-skeleton-word:nth-child(5) { width: 110px; animation-delay: 0.5s; }

    /* ============================================================
       Statistics Bar
       ============================================================ */
    .mm-stats-bar {
        display: flex;
        gap: 1rem;
        margin-bottom: 1.5rem;
        flex-wrap: wrap;
    }

    .mm-stat-item {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.6rem 1rem;
        background: var(--mm-gray-50);
        border-radius: var(--mm-radius-md);
        border: 1px solid var(--mm-gray-200);
        animation: mm-slideInRight 0.4s ease;
        animation-fill-mode: both;
    }

    .mm-stat-item:nth-child(1) { animation-delay: 0.1s; }
    .mm-stat-item:nth-child(2) { animation-delay: 0.2s; }
    .mm-stat-item:nth-child(3) { animation-delay: 0.3s; }
    .mm-stat-item:nth-child(4) { animation-delay: 0.4s; }

    .mm-stat-icon {
        font-size: 1.1rem;
    }

    .mm-stat-label {
        font-size: 0.78rem;
        color: var(--mm-gray-500);
        font-weight: 500;
    }

    .mm-stat-value {
        font-size: 0.95rem;
        font-weight: 700;
        color: var(--mm-gray-800);
    }

    .mm-fill-bar {
        width: 60px;
        height: 6px;
        background: var(--mm-gray-200);
        border-radius: 3px;
        overflow: hidden;
    }

    .mm-fill-bar-inner {
        height: 100%;
        background: linear-gradient(90deg, var(--mm-primary), var(--mm-secondary));
        border-radius: 3px;
        transition: width 0.8s ease;
    }

    /* ============================================================
       Result Area
       ============================================================ */
    .mm-result {
        display: none;
    }

    .mm-result.mm-visible {
        display: block;
    }

    .mm-grid-wrapper {
        display: flex;
        gap: 2.5rem;
        flex-wrap: wrap;
        justify-content: center;
        align-items: flex-start;
    }

    /* ============================================================
       Grid
       ============================================================ */
    .mm-grid-container {
        overflow-x: auto;
        padding: 0.5rem;
    }

    .mm-grid {
        border-collapse: separate;
        border-spacing: 2px;
        margin: 0 auto;
    }

    .mm-grid td {
        width: 36px;
        height: 36px;
        text-align: center;
        vertical-align: middle;
        font-family: 'Courier New', monospace;
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--mm-indigo-900);
        background: var(--mm-gray-50);
        border-radius: 4px;
        user-select: none;
        transition: all var(--mm-transition-normal);
        opacity: 0;
        animation: mm-cellAppear 0.3s ease forwards;
    }

    .mm-grid td:hover {
        background: #e0e7ff;
        transform: scale(1.1);
        z-index: 1;
        position: relative;
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
    }

    .mm-grid td.mm-highlight {
        background: linear-gradient(135deg, #c4b5fd, #a78bfa);
        color: white;
        animation: mm-highlightPulse 2s ease infinite;
        box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
    }

    .mm-grid td.mm-found {
        background: linear-gradient(135deg, #6ee7b7, #34d399);
        color: #064e3b;
        animation: mm-wordFound 0.6s ease;
    }

    /* ============================================================
       Word List (Result)
       ============================================================ */
    .mm-wordlist {
        min-width: 220px;
        max-width: 280px;
    }

    .mm-wordlist-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
        border-bottom: 2px solid var(--mm-gray-200);
    }

    .mm-wordlist-header h3 {
        font-size: 1.05rem;
        color: var(--mm-indigo-900);
        margin: 0;
        display: flex;
        align-items: center;
        gap: 0.4rem;
    }

    .mm-wordlist-count {
        font-size: 0.78rem;
        font-weight: 600;
        padding: 0.2rem 0.6rem;
        background: #e0e7ff;
        color: #3730a3;
        border-radius: var(--mm-radius-full);
    }

    .mm-wordlist ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mm-wordlist li {
        padding: 0.55rem 0.85rem;
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--mm-gray-700);
        border-radius: var(--mm-radius-sm);
        margin-bottom: 0.3rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        transition: all var(--mm-transition-normal);
        animation: mm-slideInRight 0.3s ease forwards;
        opacity: 0;
        cursor: default;
    }

    .mm-wordlist li::before {
        content: '';
        display: inline-block;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--mm-primary-light);
        flex-shrink: 0;
        transition: all var(--mm-transition-normal);
    }

    .mm-wordlist li:nth-child(odd) {
        background: var(--mm-gray-50);
    }

    .mm-wordlist li:hover {
        background: #e0e7ff;
        transform: translateX(4px);
    }

    .mm-wordlist li:hover::before {
        background: var(--mm-primary);
        transform: scale(1.3);
    }

    .mm-wordlist li.mm-word-found {
        color: var(--mm-success-dark);
        text-decoration: line-through;
        opacity: 0.7;
    }

    .mm-wordlist li.mm-word-found::before {
        background: var(--mm-success);
    }

    /* ============================================================
       Confirmation Modal
       ============================================================ */
    .mm-modal-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 9000;
        justify-content: center;
        align-items: center;
        animation: mm-fadeIn 0.2s ease;
    }

    .mm-modal-overlay.mm-visible {
        display: flex;
    }

    .mm-modal {
        background: white;
        border-radius: var(--mm-radius-lg);
        padding: 2rem;
        max-width: 480px;
        width: 90%;
        box-shadow: var(--mm-shadow-xl);
        animation: mm-bounceIn 0.4s ease;
    }

    .mm-modal-title {
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--mm-gray-800);
        margin-bottom: 0.75rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .mm-modal-text {
        font-size: 0.95rem;
        color: var(--mm-gray-600);
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }

    .mm-modal-actions {
        display: flex;
        gap: 0.75rem;
        justify-content: flex-end;
    }

    /* ============================================================
       Print Preview Modal
       ============================================================ */
    .mm-print-modal {
        max-width: 700px;
    }

    .mm-print-preview-frame {
        border: 1px solid var(--mm-gray-200);
        border-radius: var(--mm-radius-sm);
        padding: 1.5rem;
        background: white;
        margin-bottom: 1.5rem;
        max-height: 400px;
        overflow-y: auto;
    }

    .mm-print-preview-frame h3 {
        text-align: center;
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }

    .mm-print-preview-subtitle {
        text-align: center;
        color: var(--mm-gray-500);
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .mm-print-option {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem;
        border: 2px solid var(--mm-gray-200);
        border-radius: var(--mm-radius-md);
        margin-bottom: 0.5rem;
        cursor: pointer;
        transition: all var(--mm-transition-fast);
    }

    .mm-print-option:hover {
        border-color: var(--mm-primary-light);
        background: #f5f3ff;
    }

    .mm-print-option-label {
        flex: 1;
    }

    .mm-print-option-label strong {
        display: block;
        font-size: 0.9rem;
        color: var(--mm-gray-800);
    }

    .mm-print-option-label span {
        font-size: 0.8rem;
        color: var(--mm-gray-500);
    }

    .mm-print-field {
        margin-bottom: 1rem;
    }

    .mm-print-field label {
        display: block;
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--mm-gray-700);
        margin-bottom: 0.3rem;
    }

    .mm-print-field input {
        width: 100%;
        padding: 0.5rem 0.75rem;
        border: 2px solid var(--mm-gray-200);
        border-radius: var(--mm-radius-sm);
        font-size: 0.9rem;
        transition: border-color var(--mm-transition-fast);
        box-sizing: border-box;
    }

    .mm-print-field input:focus {
        outline: none;
        border-color: var(--mm-primary);
    }

    /* ============================================================
       Error Message
       ============================================================ */
    .mm-error {
        background: linear-gradient(135deg, #fef2f2, #fee2e2);
        border: 1px solid #fecaca;
        color: #991b1b;
        padding: 1rem 1.25rem;
        border-radius: var(--mm-radius-md);
        margin-bottom: 1rem;
        display: none;
        font-size: 0.95rem;
        animation: mm-fadeIn 0.3s ease;
        align-items: center;
        gap: 0.5rem;
    }

    .mm-error.mm-visible {
        display: flex;
    }

    .mm-error-icon {
        flex-shrink: 0;
        font-size: 1.1rem;
    }

    /* ============================================================
       Section Divider
       ============================================================ */
    .mm-divider {
        height: 1px;
        background: linear-gradient(90deg, transparent, var(--mm-gray-200), transparent);
        margin: 1.5rem 0;
        border: none;
    }

    /* ============================================================
       Responsive Design
       ============================================================ */
    @media (max-width: 1024px) {
        .mm-grid-wrapper {
            gap: 1.5rem;
        }

        .mm-stats-bar {
            gap: 0.5rem;
        }

        .mm-stat-item {
            flex: 1;
            min-width: 130px;
        }
    }

    @media (max-width: 768px) {
        .mm-page {
            padding: 1rem 0 3rem;
        }

        .mm-container {
            padding: 0 1rem;
        }

        .mm-card {
            padding: 1.5rem;
            border-radius: var(--mm-radius-md);
        }

        .mm-options-row {
            grid-template-columns: 1fr;
            gap: 1rem;
        }

        .mm-grid td {
            width: 30px;
            height: 30px;
            font-size: 0.9rem;
        }

        .mm-grid-wrapper {
            flex-direction: column;
            align-items: center;
        }

        .mm-wordlist {
            max-width: 100%;
            width: 100%;
        }

        .mm-btn-row {
            flex-direction: column;
        }

        .mm-btn {
            justify-content: center;
            width: 100%;
        }

        .mm-header-badges {
            gap: 0.5rem;
        }

        .mm-header-badge {
            font-size: 0.78rem;
            padding: 0.3rem 0.7rem;
        }

        .mm-stats-bar {
            flex-direction: column;
        }

        .mm-stat-item {
            width: 100%;
        }

        .mm-presets-grid {
            gap: 0.4rem;
        }

        .mm-preset-btn {
            font-size: 0.8rem;
            padding: 0.4rem 0.8rem;
        }

        .mm-toast-container {
            top: 1rem;
            right: 0.75rem;
            left: 0.75rem;
        }

        .mm-toast {
            min-width: auto;
            max-width: 100%;
        }
    }

    @media (max-width: 480px) {
        .mm-header h1 {
            font-size: 1.5rem;
        }

        .mm-grid td {
            width: 24px;
            height: 24px;
            font-size: 0.75rem;
        }

        .mm-card {
            padding: 1.25rem;
        }

        .mm-word-input-row {
            flex-direction: column;
        }

        .mm-btn-add-word {
            width: 100%;
            justify-content: center;
        }

        .mm-modal {
            width: 95%;
            padding: 1.5rem;
        }
    }

    /* ============================================================
       Print Styles
       ============================================================ */
    @media print {
        .mm-page {
            background: white !important;
            padding: 0;
        }

        .mm-header,
        .mm-card:first-of-type,
        .mm-btn-row,
        .mm-stats-bar,
        .mm-toast-container,
        .mm-modal-overlay,
        .mm-timer-section,
        .mm-interactive-stats {
            display: none !important;
        }

        .mm-card {
            box-shadow: none;
            border: none;
            padding: 0;
        }

        .mm-grid {
            border-spacing: 0;
        }

        .mm-grid td {
            border: 1px solid #999;
            border-radius: 0;
            opacity: 1;
            animation: none;
            background: white;
            print-color-adjust: exact;
            -webkit-print-color-adjust: exact;
        }

        .mm-grid td.mm-highlight {
            background: #ddd !important;
            animation: none;
        }

        .mm-grid td.mm-found {
            background: #ccc !important;
            animation: none;
        }

        .mm-wordlist li {
            opacity: 1;
            animation: none;
        }
    }

    /* ====== DARK MODE ====== */
    [data-theme="dark"] {
        --mm-gray-50: #0f172a;
        --mm-gray-100: #1e293b;
        --mm-gray-200: #334155;
        --mm-gray-300: #475569;
        --mm-gray-400: #64748b;
        --mm-gray-500: #94a3b8;
        --mm-gray-600: #cbd5e1;
        --mm-gray-700: #e2e8f0;
        --mm-gray-800: #f1f5f9;
        --mm-gray-900: #f8fafc;
        --mm-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
        --mm-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
        --mm-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
    }

    [data-theme="dark"] .mm-page {
        background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #3b0764 100%) !important;
    }

    [data-theme="dark"] .mm-card {
        background: #1e293b !important;
        box-shadow: 0 10px 40px rgba(0,0,0,0.4) !important;
    }

    [data-theme="dark"] .mm-card h2 {
        color: #e2e8f0 !important;
    }

    [data-theme="dark"] .mm-section-title {
        color: #e2e8f0 !important;
    }

    [data-theme="dark"] .mm-preset-btn {
        background: #0f172a !important;
        border-color: #334155 !important;
        color: #e2e8f0 !important;
    }

    [data-theme="dark"] .mm-preset-btn:hover {
        border-color: #818cf8 !important;
        background: #1e1b4b !important;
        color: #c4b5fd !important;
    }

    [data-theme="dark"] .mm-preset-btn .mm-preset-count {
        color: #64748b !important;
    }

    [data-theme="dark"] .mm-presets-label {
        color: #94a3b8 !important;
    }

    [data-theme="dark"] .mm-word-input {
        background: #0f172a !important;
        color: #f1f5f9 !important;
        border-color: #334155 !important;
    }

    [data-theme="dark"] .mm-word-input::placeholder {
        color: #64748b !important;
    }

    [data-theme="dark"] .mm-word-tag {
        background: #312e81 !important;
        color: #c4b5fd !important;
        border-color: #4338ca !important;
    }

    [data-theme="dark"] .mm-help-text {
        color: #64748b !important;
    }

    [data-theme="dark"] .mm-grid-size-btn {
        background: #0f172a !important;
        color: #cbd5e1 !important;
        border-color: #334155 !important;
    }

    [data-theme="dark"] .mm-grid-size-btn:hover {
        border-color: #818cf8 !important;
    }

    [data-theme="dark"] .mm-grid-size-btn.mm-active {
        background: #4338ca !important;
        color: white !important;
        border-color: #4338ca !important;
    }

    [data-theme="dark"] .mm-difficulty-bar {
        background: #334155 !important;
    }

    [data-theme="dark"] .mm-difficulty-label {
        color: #e2e8f0 !important;
    }

    [data-theme="dark"] .mm-dir-badge {
        background: #0f172a !important;
        color: #cbd5e1 !important;
        border-color: #334155 !important;
    }

    [data-theme="dark"] .mm-dir-badge-active {
        background: #312e81 !important;
        color: #c4b5fd !important;
        border-color: #6366f1 !important;
    }

    [data-theme="dark"] .mm-dir-badge-inactive {
        background: #1e293b !important;
        color: #64748b !important;
    }

    [data-theme="dark"] .mm-checkbox-section {
        background: #0f172a !important;
        border-color: #334155 !important;
    }

    [data-theme="dark"] .mm-checkbox-section label {
        color: #e2e8f0 !important;
    }

    [data-theme="dark"] .mm-checkbox-desc {
        color: #94a3b8 !important;
    }

    [data-theme="dark"] .mm-word-count-badge {
        background: #064e3b !important;
        color: #6ee7b7 !important;
    }

    [data-theme="dark"] .mm-difficulty-info {
        color: #94a3b8 !important;
    }

    [data-theme="dark"] .mm-word-tags {
        background: #0f172a !important;
        border-color: #334155 !important;
    }

    [data-theme="dark"] .mm-subtitle {
        color: rgba(255,255,255,0.8) !important;
    }

    [data-theme="dark"] .mm-badges .mm-badge {
        background: #312e81 !important;
        color: #c4b5fd !important;
    }
