:root {
            --primary: #6366f1;
            --primary-dark: #4338ca;
            --bg-body: #f8fafc;
            --bg-card: #ffffff;
            --text: #0f172a;
            --border: #e2e8f0;
            --radius: 12px;
        }

        /* --- LAYOUT CHÍNH --- */
        .main-grid {
            display: grid;
            grid-template-columns: 400px 1fr;
            gap: 24px;
            max-width: 1200px;
            margin: 0 auto;
            align-items: start;
        }

        /* --- PHẦN SPINNER BORDER --- */
        .spinner-border-box { position: relative; border-radius: 16px; padding: 3px; overflow: hidden; box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1); }
        .gradient-spinner {
            position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
            background: conic-gradient(transparent, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, transparent);
            animation: spin-border 3s linear infinite; z-index: 1;
        }
        .spinner-border-box-inner { position: relative; z-index: 2; background: var(--bg-card); border-radius: 14px; padding: 24px; }
        @keyframes spin-border { 100% { transform: rotate(360deg); } }

        /* --- FORM STYLES --- */
        .input-group { margin-bottom: 16px; }
        .input-group label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 0.9rem; }
        .input-group input, .input-group select {
            width: 100%; padding: 12px; border: 1px solid var(--border);
            border-radius: 8px; font-size: 1rem; outline: none; transition: 0.2s;
        }
        .input-group input:focus, .input-group select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px #6366f133; }
        
        .generate-btn {
            width: 100%; padding: 14px; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
            color: white; border: none; border-radius: 8px; font-weight: 700; cursor: pointer;
            display: flex; align-items: center; justify-content: center; gap: 8px; transition: 0.2s;
        }
        .generate-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px #6366f166; }
        .generate-btn:disabled { opacity: 0.7; cursor: wait; }

        /* --- RESULTS SECTION --- */
        .results-section { display: none; }
        .results-section.visible { display: block; animation: fadeIn 0.3s ease; }
        .nickname-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
        
        .nickname-item {
            background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 12px;
            text-align: center; cursor: pointer; transition: 0.2s; position: relative;
        }
        .nickname-item:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1); }
        .nickname-text { font-weight: 600; margin-bottom: 4px; word-break: break-word; }
        .nickname-label { font-size: 0.75rem; color: #64748b; background: #f1f5f9; padding: 2px 8px; border-radius: 4px; display: inline-block; }
        
        /* --- LOADING & ERROR --- */
        .loading-state { display: none; text-align: center; margin-top: 15px; color: #64748b; }
        .spinner { width: 24px; height: 24px; border: 2px solid #e2e8f0; border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 8px; }
        @keyframes spin { to { transform: rotate(360deg); } }
        
        /* ========================================= */
        /* QUAN TRỌNG: PHẦN CSS BỊ THIẾU TRƯỚC ĐÓ  */
        /* Khi control-panel có class .loading (do JS thêm vào) */
        /* ========================================= */
        .control-panel.loading .loading-state {
            display: block !important; /* Hiện loading */
        }
        .control-panel.loading .generate-btn {
            display: none; /* Ẩn nút bấm đi cho gọn */
        }
        /* ========================================= */

        .error-message { color: #ef4444; background: #fef2f2; padding: 10px; border-radius: 8px; margin-top: 10px; display: none; font-size: 0.9rem; }
        
        .suggestions-section { margin-top: 24px; text-align: center; }
        .suggestions-btn { display: inline-block; padding: 10px 20px; border: 2px solid var(--primary); color: var(--primary); text-decoration: none; border-radius: 8px; font-weight: 600; }
        
        .toast { position: fixed; bottom: 20px; right: 20px; background: #10b981; color: white; padding: 12px 20px; border-radius: 8px; display: flex; gap: 8px; transform: translateY(100px); transition: 0.3s; opacity: 0; z-index: 999; }
        .toast.show { transform: translateY(0); opacity: 1; }

        @media (max-width: 900px) { .main-grid { grid-template-columns: 1fr; } }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }