*{margin:0;padding:0;box-sizing:border-box}body,html{height:100%;overflow:hidden}#canvas{display:block;width:100vw;height:100vh;background-color:#1a1a1a;will-change:transform;contain:layout style paint}#hoverCanvas{will-change:contents;contain:strict;pointer-events:none}.settings-btn{position:fixed;bottom:20px;right:20px;background:#ffffff1a;border:1px solid rgba(255,255,255,.2);border-radius:50%;width:50px;height:50px;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#fff;font-size:18px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);transition:transform .3s ease,background .3s ease;will-change:transform;transform:translateZ(0);contain:layout style paint}.settings-btn:hover{background:#fff3;transform:rotate(90deg) translateZ(0)}.replay-btn{position:fixed;bottom:20px;right:80px;background:#ffffff1a;border:1px solid rgba(255,255,255,.2);border-radius:50%;width:50px;height:50px;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#fff;font-size:18px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);transition:transform .3s ease,background .3s ease;will-change:transform;transform:translateZ(0);contain:layout style paint}.replay-btn:hover{background:#fff3;transform:rotate(360deg) translateZ(0)}.layers-btn{position:fixed;bottom:20px;right:140px;background:#ffffff1a;border:1px solid rgba(255,255,255,.2);border-radius:50%;width:50px;height:50px;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#fff;font-size:18px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);transition:transform .3s ease,background .3s ease;will-change:transform;transform:translateZ(0);contain:layout style paint}.layers-btn:hover{background:#fff3;transform:scale(1.1) translateZ(0)}.settings-panel{position:fixed;bottom:80px;right:20px;background:#000c;border:1px solid rgba(255,255,255,.2);border-radius:10px;padding:20px;color:#fff;min-width:200px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);transform:translateY(20px) translateZ(0);opacity:0;visibility:hidden;transition:transform .3s ease,opacity .3s ease,visibility .3s ease;will-change:transform,opacity;contain:layout style paint}.settings-panel.show{transform:translateY(0) translateZ(0);opacity:1;visibility:visible}.setting-item{margin-bottom:15px}.setting-item:last-child{margin-bottom:0}.setting-label{display:block;margin-bottom:5px;font-size:14px;color:#ccc}.toggle-switch{position:relative;display:inline-block;width:50px;height:24px}.toggle-switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#333;transition:.3s;border-radius:24px}.slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background-color:#fff;transition:.3s;border-radius:50%}input:checked+.slider{background-color:#2196f3}input:checked+.slider:before{transform:translate(26px)}.easing-dropdown{background:#ffffff1a;border:1px solid rgba(255,255,255,.2);border-radius:5px;color:#fff;padding:5px 10px;font-size:14px;min-width:120px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.easing-dropdown option{background:#333;color:#fff}.duration-container{display:flex;align-items:center;gap:10px}.duration-slider{flex:1;height:6px;border-radius:3px;background:#fff3;outline:none;-webkit-appearance:none}.duration-slider::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:18px;height:18px;border-radius:50%;background:#2196f3;cursor:pointer;border:2px solid white}.duration-slider::-moz-range-thumb{width:18px;height:18px;border-radius:50%;background:#2196f3;cursor:pointer;border:2px solid white}.duration-label{font-size:12px;color:#ccc;min-width:30px;text-align:right}.layers-panel{position:fixed;bottom:80px;right:140px;background:#000c;border:1px solid rgba(255,255,255,.2);border-radius:10px;padding:15px;color:#fff;width:250px;max-height:400px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);transform:translateY(20px) translateZ(0);opacity:0;visibility:hidden;transition:transform .3s ease,opacity .3s ease,visibility .3s ease;will-change:transform,opacity;contain:layout style paint;overflow-y:auto;-webkit-overflow-scrolling:touch}.layers-panel.show{transform:translateY(0) translateZ(0);opacity:1;visibility:visible}.layers-header{margin-bottom:15px;border-bottom:1px solid rgba(255,255,255,.2);padding-bottom:10px}.layers-header h3{margin:0;font-size:16px;font-weight:500}.layers-list{max-height:320px;overflow-y:auto}.layer-item{display:flex;align-items:center;padding:8px;margin-bottom:5px;background:#ffffff1a;border-radius:6px;cursor:move;transition:all .2s ease}.layer-item:hover{background:#ffffff26}.layer-item.dragging{opacity:.5;transform:rotate(5deg)}.layer-drag-handle{font-size:12px;color:#999;margin-right:8px;cursor:grab}.layer-drag-handle:active{cursor:grabbing}.layer-info{flex:1;display:flex;flex-direction:column}.layer-name{font-size:14px;font-weight:500;margin-bottom:2px}.layer-type{font-size:11px;color:#aaa}.layer-controls{display:flex;align-items:center;gap:5px}.layer-visibility-btn,.layer-delete-btn{background:none;border:none;color:#fff;font-size:16px;cursor:pointer;padding:4px;border-radius:4px;transition:all .2s ease}.layer-visibility-btn:hover,.layer-delete-btn:hover{background:#fff3}.layer-visibility-btn.hidden{opacity:.4}.layer-delete-btn:hover{color:#f44}.accordion-section{margin-bottom:10px}.accordion-header{display:flex;align-items:center;justify-content:space-between;padding:12px 15px;background:#ffffff1a;border:1px solid rgba(255,255,255,.2);border-radius:6px;cursor:pointer;transition:all .3s ease;-webkit-user-select:none;user-select:none}.accordion-header:hover{background:#ffffff26}.accordion-header.active{background:#fff3;border-bottom-left-radius:0;border-bottom-right-radius:0}.accordion-title{font-size:14px;font-weight:500;color:#fff}.accordion-icon{font-size:12px;color:#ccc;transition:transform .3s ease}.accordion-header.active .accordion-icon{transform:rotate(180deg)}.accordion-content{max-height:0;overflow:hidden;background:#0000004d;border:1px solid rgba(255,255,255,.2);border-top:none;border-radius:0 0 6px 6px;transition:max-height .3s ease}.accordion-content.active{max-height:500px;padding:15px}.accordion-content .setting-item{margin-bottom:15px}.accordion-content .setting-item:last-child{margin-bottom:0}.pattern-editor-overlay{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#000000b3;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);display:flex;align-items:center;justify-content:center;z-index:1000;opacity:0;visibility:hidden;transition:opacity .3s ease,visibility .3s ease;will-change:opacity;contain:layout style paint}.pattern-editor-overlay.show{opacity:1;visibility:visible}.pattern-editor-modal{background:#1a1a1af2;border:1px solid rgba(255,255,255,.2);border-radius:12px;width:90%;max-width:800px;height:85vh;max-height:85vh;overflow:hidden;display:flex;flex-direction:column;transform:scale(.9) translateY(20px) translateZ(0);transition:transform .3s ease;will-change:transform;contain:layout style paint}.pattern-editor-overlay.show .pattern-editor-modal{transform:scale(1) translateY(0) translateZ(0)}.pattern-editor-header{display:flex;align-items:center;justify-content:space-between;padding:20px;border-bottom:1px solid rgba(255,255,255,.2)}.pattern-editor-header h3{margin:0;color:#fff;font-size:20px;font-weight:500}.close-btn{background:none;border:none;color:#fff;font-size:28px;cursor:pointer;padding:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:6px;transition:all .2s ease}.close-btn:hover{background:#ffffff1a;transform:rotate(90deg)}.editor-tabs{display:flex;border-bottom:1px solid rgba(255,255,255,.2);background:#0000004d}.editor-tab{flex:1;padding:12px 20px;background:transparent;border:none;color:#fff9;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s ease;border-bottom:2px solid transparent}.editor-tab:hover{color:#fffc;background:#ffffff0d}.editor-tab.active{color:#fff;border-bottom-color:#2196f3;background:#2196f31a}.editor-tab-content{display:none;flex:1;overflow:hidden}.editor-tab-content.active{display:flex;flex-direction:column}.visual-editor-container{display:flex;flex-direction:column;height:100%;overflow:hidden}.visual-editor-toolbar{padding:12px 20px;background:#0000004d;border-bottom:1px solid rgba(255,255,255,.1)}.toolbar-info{color:#aaa;font-size:12px}#visualEditorCanvas{flex:1;background:#1a1a1a;cursor:default;will-change:contents;contain:strict}.pattern-editor-content{padding:20px;overflow-y:auto;flex:1}.editor-field{margin-bottom:20px}.editor-field:last-child{margin-bottom:0}.editor-field label{display:block;color:#ccc;font-size:14px;margin-bottom:8px;font-weight:500}.editor-field input[type=text],.editor-field input[type=number],.editor-field textarea{width:100%;padding:10px 12px;background:#ffffff1a;border:1px solid rgba(255,255,255,.2);border-radius:6px;color:#fff;font-size:14px;font-family:Courier New,monospace;transition:all .2s ease}.editor-field input[type=text]:focus,.editor-field input[type=number]:focus,.editor-field textarea:focus{outline:none;background:#ffffff26;border-color:#2196f3}.editor-field input[readonly]{background:#ffffff0d;cursor:not-allowed}.editor-field textarea{resize:vertical;min-height:150px;line-height:1.4}.editor-actions{margin-top:15px}.copy-btn{width:100%;padding:10px 20px;background:#2196f333;border:1px solid #2196F3;border-radius:6px;color:#fff;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s ease}.copy-btn:hover{background:#2196f34d;transform:translateY(-2px)}.copy-btn:active{transform:translateY(0)}.pattern-editor-footer{display:flex;gap:10px;padding:20px;border-top:1px solid rgba(255,255,255,.2)}.cancel-btn,.save-btn{flex:1;padding:12px 20px;border-radius:6px;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s ease;border:1px solid transparent}.cancel-btn{background:#ffffff1a;border-color:#fff3;color:#fff}.cancel-btn:hover{background:#ffffff26}.save-btn{background:#2196f3;color:#fff}.save-btn:hover{background:#1976d2;transform:translateY(-2px)}.save-btn:active{transform:translateY(0)}@media screen and (max-width: 991px){.settings-btn,.replay-btn,.layers-btn{width:44px;height:44px;font-size:16px;bottom:15px}.settings-btn{right:15px}.replay-btn{right:70px}.layers-btn{right:125px}.settings-panel{min-width:260px;max-width:calc(100vw - 40px);right:15px;bottom:70px;padding:15px}.layers-panel{width:280px;max-width:calc(100vw - 40px);right:15px;bottom:70px;max-height:60vh}.setting-label,.accordion-title{font-size:13px}.duration-label{font-size:11px}.toggle-switch{width:54px;height:28px}.slider:before{height:22px;width:22px}input:checked+.slider:before{transform:translate(26px)}.layer-item{padding:10px 8px;margin-bottom:8px}.layer-name{font-size:13px}.layer-type{font-size:10px}.pattern-editor-modal{width:95%;height:90vh;max-height:90vh}.pattern-editor-header h3{font-size:18px}.editor-field label{font-size:13px}.editor-field input[type=text],.editor-field input[type=number],.editor-field textarea{font-size:13px;padding:8px 10px}}@media screen and (max-width: 548px){.settings-btn,.replay-btn,.layers-btn{width:40px;height:40px;font-size:14px;bottom:12px}.settings-btn{right:12px}.replay-btn{right:60px}.layers-btn{right:108px}.settings-panel,.layers-panel{right:12px;bottom:60px;min-width:240px;max-width:calc(100vw - 30px)}.layers-panel{width:240px;max-height:55vh}.accordion-header{padding:10px 12px}.accordion-title{font-size:12px}.accordion-content.active{padding:12px}.layer-visibility-btn,.layer-delete-btn{font-size:14px;padding:3px}.pattern-editor-modal{width:100%;height:100vh;max-height:100vh;border-radius:0}.pattern-editor-header{padding:15px}.pattern-editor-header h3{font-size:16px}.pattern-editor-footer{padding:15px}.editor-field{margin-bottom:15px}.editor-field label{font-size:12px;margin-bottom:6px}.editor-field input[type=text],.editor-field input[type=number],.editor-field textarea{font-size:12px;padding:8px}.editor-tab{padding:10px 15px;font-size:13px}}@media screen and (max-height: 500px) and (orientation: landscape){.settings-panel,.layers-panel{max-height:70vh;bottom:65px}.layers-list{max-height:40vh}.settings-btn,.replay-btn,.layers-btn{bottom:10px}}@media (hover: none) and (pointer: coarse){body{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-touch-callout:none}input,textarea{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}}
