@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;900&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600;700&display=swap');
        
        :root {
            --gold: #d4af37;
            --gold-bright: #fcd34d;
            --amber: #f59e0b;
            --blue: #3b82f6;
            --cyan: #06b6d4;
            --red: #ef4444;
            --purple: #a855f7;
            --emerald: #10b981;
            --font-heading: 'Cinzel', serif;
            --font-mono: 'JetBrains Mono', monospace;
            --font-body: 'Inter', sans-serif;
        }

        body {
            font-family: var(--font-body);
            background-color: #0a0d14;
            color: #e2e8f0;
            height: 100vh;
            overflow: hidden;
            margin: 0;
            user-select: none;
        }
        
        #main-container { display: flex; height: 100vh; width: 100vw; overflow: hidden; }
        
        /* Left Editor Panel */
        #editor-panel {
            width: 490px;
            flex-shrink: 0;
            overflow-y: auto;
            padding: 1rem;
            border-right: 1px solid #1e293b;
            background: #0f1422;
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            z-index: 20;
            user-select: text;
        }

        /* Right Panel */
        #visual-panel {
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            background: #07090f;
            position: relative;
            overflow: hidden;
        }

        /* Form Controls */
        .form-label {
            font-size: 0.7rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #94a3b8;
            margin-bottom: 0.25rem;
            display: block;
        }
        .form-input, .form-select, .form-textarea {
            width: 100%;
            background-color: #090e18;
            border: 1px solid #1c2a42;
            border-radius: 4px;
            padding: 0.35rem 0.5rem;
            color: #f1f5f9;
            font-size: 0.8rem;
            font-family: var(--font-mono);
            transition: all 0.15s ease;
        }
        .form-input:focus, .form-select:focus, .form-textarea:focus {
            outline: none;
            border-color: var(--cyan);
            box-shadow: 0 0 0 1px var(--cyan);
            background-color: #0d1526;
        }
        
        /* Custom Buttons */
        .btn {
            font-size: 0.75rem;
            font-weight: 600;
            padding: 0.4rem 0.75rem;
            border-radius: 4px;
            transition: all 0.12s ease;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
        }
        .btn-primary {
            background: linear-gradient(135deg, #0284c7, #0369a1);
            color: #f0f9ff;
            border: 1px solid #38bdf8;
        }
        .btn-primary:hover {
            background: linear-gradient(135deg, #0369a1, #075985);
            border-color: #7dd3fc;
        }
        .btn-gold {
            background: linear-gradient(135deg, #b45309, #78350f);
            color: #fef3c7;
            border: 1px solid #f59e0b;
        }
        .btn-gold:hover {
            background: linear-gradient(135deg, #d97706, #92400e);
            border-color: #fcd34d;
        }
        .btn-secondary {
            background: #1e293b;
            color: #cbd5e1;
            border: 1px solid #334155;
        }
        .btn-secondary:hover {
            background: #334155;
            color: #f8fafc;
        }
        .btn-danger {
            background: #7f1d1d;
            color: #fecaca;
            border: 1px solid #dc2626;
        }
        .btn-danger:hover {
            background: #991b1b;
        }

        /* Archetype Pill Buttons */
        .archetype-btn {
            background: #111a2e;
            border: 1px solid #1e2e4a;
            color: #94a3b8;
            font-size: 0.7rem;
            font-weight: 600;
            padding: 5px 8px;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.15s ease;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .archetype-btn:hover {
            background: #1a2744;
            color: #e2e8f0;
            border-color: #38bdf8;
        }
        .archetype-btn.active {
            background: rgba(6, 182, 212, 0.15);
            color: #38bdf8;
            border-color: #06b6d4;
            box-shadow: 0 0 8px rgba(6, 182, 212, 0.25);
        }

        /* Gothic Card Preview */
        .gothic-item-card {
            background: radial-gradient(circle at 50% 10%, #16243b 0%, #0a0e17 80%);
            border: 2px solid #2d4568;
            border-radius: 8px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(6, 182, 212, 0.15);
            position: relative;
            overflow: hidden;
        }
        .gothic-item-card::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0; height: 3px;
            background: linear-gradient(90deg, transparent, var(--cyan), transparent);
        }

        .stat-pill {
            font-size: 0.7rem;
            font-family: var(--font-mono);
            font-weight: 700;
            padding: 3px 8px;
            border-radius: 4px;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        /* Toast */
        #toast-notification {
            position: fixed;
            bottom: 2rem;
            left: 50%;
            transform: translateX(-50%);
            background-color: #0f1c30;
            color: #f0f9ff;
            border: 1px solid var(--cyan);
            padding: 8px 18px;
            border-radius: 6px;
            font-size: 0.78rem;
            font-weight: 700;
            box-shadow: 0 10px 25px rgba(0,0,0,0.8), 0 0 12px rgba(6, 182, 212, 0.3);
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.2s ease-in-out;
            z-index: 150;
        }

        .brand-title {
            font-family: var(--font-heading);
            color: var(--cyan);
            letter-spacing: 0.05em;
        }

        /* Paperdoll grid */
        .paperdoll-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 6px;
            max-width: 440px;
            margin: 0 auto;
        }
        .paperdoll-slot-box {
            background: #090e18;
            border: 1px solid #1c2a42;
            border-radius: 4px;
            padding: 6px;
            text-align: center;
            font-size: 0.68rem;
            color: #64748b;
            transition: all 0.15s;
        }
        .paperdoll-slot-box.active {
            background: rgba(6, 182, 212, 0.18);
            border-color: #06b6d4;
            color: #38bdf8;
            font-weight: 700;
            box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
        }
