:root {
  --bg-dark: #0f1115;
  --panel: #16213e;
  --border: #2a2a4e;
  --accent: #e94560;
  --text: #eaeaea;
}

body { margin: 0; font-family: system-ui, sans-serif; background: var(--bg-dark); color: var(--text); display: flex; height: 100vh; overflow: hidden; }

/* Sidebar & UI */
.sidebar { width: 380px; background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 100; box-shadow: 5px 0 15px rgba(0,0,0,0.5); }
.sidebar-header { padding: 15px; font-weight: 800; border-bottom: 1px solid var(--border); }
.sidebar-tabs { display: flex; background: #000; cursor: pointer; }
.sidebar-tab { flex: 1; padding: 10px; text-align: center; font-size: 11px; opacity: 0.5; font-weight: bold; }
.sidebar-tab.active { opacity: 1; border-bottom: 2px solid var(--accent); color: var(--accent); }
.sidebar-content { padding: 20px; flex: 1; overflow-y: auto; }

/* Buttons & Controls */
.group { margin-bottom: 25px; }
.group h3 { font-size: 10px; color: #888; letter-spacing: 1px; margin-bottom: 12px; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
button { padding: 10px; cursor: pointer; border-radius: 6px; border: 1px solid rgba(255,255,255,0.1); background: #2a2a4e; color: white; font-weight: bold; font-size: 12px; }
button:hover { background: #3e3e6e; }
button.primary { background: var(--accent); border: none; }
button.special { background: linear-gradient(135deg, #00c6ff, #0072ff); border: none; }
button.success { background: #28a745; border: none; }
button.danger { background: #5a1a1a; border-color: #7a2a2a; color: #ffcccc; }
button.full-width { width: 100%; }
button.sm { padding: 4px 8px; font-size: 10px; min-width: 30px; }

/* Inspector */
.inspector-box { background: rgba(0,0,0,0.2); padding: 15px; border-radius: 8px; border: 1px solid var(--accent); }
label { display: block; font-size: 11px; color: #aaa; margin-top: 10px; margin-bottom: 4px; }
textarea { width: 100%; height: 70px; background: #000; border: 1px solid #333; color: #fff; padding: 8px; border-radius: 4px; font-family: inherit; font-size: 13px; }
.text-tools { display: flex; gap: 4px; margin-top: 5px; }
.slider-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
input[type="range"] { flex: 1; accent-color: var(--accent); }
.val-input { width: 55px; background: #000; border: 1px solid #333; color: var(--accent); text-align: center; padding: 4px; border-radius: 4px; }

/* Canvas Area */
.main-area { flex: 1; display: flex; flex-direction: column; background: #000; position: relative; }
.toolbar { height: 50px; background: #1a1a2e; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 20px; }
.canvas-wrapper { flex: 1; display: flex; align-items: center; justify-content: center; overflow: auto; padding: 50px; background-image: radial-gradient(#222 1px, transparent 1px); background-size: 20px 20px; }
#canvas { background: white; width: 1200px; height: 500px; position: relative; box-shadow: 0 0 40px rgba(0,0,0,0.7); overflow: hidden; }
#canvas.mobile-view { width: 380px !important; }

/* Elements Styles */
.el { position: absolute; cursor: move; user-select: none; }
.el.selected { outline: 2px solid var(--accent); z-index: 100; }
.el * { pointer-events: none; margin: 0; }

/* Full Screen Button Fix */
#exit-fs-btn { position: fixed; top: 15px; right: 15px; z-index: 1000; display: none; }
body.is-fullscreen #exit-fs-btn { display: block; }

/* Modal */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.9); align-items: center; justify-content: center; z-index: 2000; }
.modal.open { display: flex; }
.modal-box { background: var(--panel); padding: 25px; border-radius: 12px; width: 600px; }
.modal textarea { height: 300px; margin-bottom: 15px; }