:root{--color-trap: #fff0f0;--color-base: #e0f0ff;--color-member: #f0fff0;--color-flag: #333333;--color-etc2: #e8e8e8;--color-etc1: #bcbcbc;--grid-size: 38px;--sidebar-width: 280px}.map-editor-root{font-family:sans-serif;margin:0;display:flex;height:100vh;background:#f0f0f0;overflow:hidden;position:fixed;top:0;left:0;width:100%;z-index:100}.map-editor-root.spawn-mode #map-container{cursor:crosshair}.map-editor-root #menu-toggle{position:fixed;top:10px;left:10px;z-index:2000;background:#333;color:#fff;border:none;padding:10px 15px;border-radius:4px;font-size:14px;cursor:pointer;display:none;box-shadow:0 2px 8px #0003}.map-editor-root #sidebar{width:var(--sidebar-width);height:100vh;background:#fff;border-right:2px solid #ccc;display:flex;flex-direction:column;padding:15px;box-sizing:border-box;z-index:1000;box-shadow:2px 0 10px #0000000d;transition:transform .3s ease;overflow-y:auto}.map-editor-root .section-title{font-size:13px;font-weight:700;color:#555;margin:15px 0 8px;padding-bottom:4px;border-bottom:1px solid #eee}.map-editor-root .section-title:first-of-type{margin-top:0}.map-editor-root .parts-container{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;align-content:start}.map-editor-root .part-item{aspect-ratio:1 / 1;border:2px dashed #999;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;font-weight:700;font-size:12px;border-radius:6px;-webkit-user-select:none;user-select:none;transition:transform .1s,box-shadow .1s;background:#fff;box-shadow:0 2px 4px #0000000d;touch-action:manipulation;color:#333}.map-editor-root .part-item:hover{box-shadow:0 4px 8px #0000001a}.map-editor-root .part-item:active{transform:scale(.95)}.map-editor-root .part-selected{border:3px solid #ff0044!important;box-shadow:0 4px 12px #f046!important;transform:scale(1.05);z-index:10}.map-editor-root .p-base{background:var(--color-base);border-color:#b3d9ff}.map-editor-root .p-trap{background:var(--color-trap);border-color:#ffb3b3}.map-editor-root .p-member{background:var(--color-member);border-color:#b3ffb3}.map-editor-root .p-flag{background:var(--color-flag);color:#fff;border-color:#000}.map-editor-root .p-etc2{background:var(--color-etc2);border-color:#ccc}.map-editor-root .p-etc1{background:var(--color-etc1);color:#fff;border-color:#999}.map-editor-root .part-size{font-size:10px;margin-top:4px;opacity:.7;font-weight:400}.map-editor-root .sidebar-scrollable{display:flex;flex-direction:column}.map-editor-root .zoom-controller{display:flex;align-items:center;justify-content:space-between;background:#f8f9fa;border:1px solid #e2e8f0;border-radius:6px;padding:6px 10px}.map-editor-root .zoom-btn{width:36px;height:36px;padding:0;font-size:18px;color:#333}.map-editor-root #main{flex:1;display:flex;flex-direction:column;position:relative;width:100%;height:100vh}.map-editor-root #counter-display-area{position:fixed;top:70px;right:20px;z-index:3000;display:flex;flex-direction:column;gap:8px;pointer-events:none;transform:scale(.7);transform-origin:top right}.map-editor-root .counter-badge{background:#fffffff2;color:#333;padding:8px 14px;border-radius:8px;font-weight:700;font-size:14px;box-shadow:0 4px 12px #00000026;border:2px solid #ccc;display:flex;align-items:center;gap:8px;justify-content:space-between;pointer-events:auto}.map-editor-root #castle-counter{border-color:#b3ffb3}.map-editor-root #flag-counter{border-color:#999;flex-direction:column;align-items:flex-start;gap:4px;min-width:140px}.map-editor-root .flag-count-row{display:flex;align-items:center;gap:6px;font-size:12px;width:100%}.map-editor-root .flag-color-dot{width:12px;height:12px;border-radius:50%;border:1px solid #888;display:inline-block}.map-editor-root .flag-name-input{width:70px;font-size:12px;border:1px solid #ccc;border-radius:3px;padding:2px 4px;background:#fff;color:#333;transition:all .2s}.map-editor-root .flag-name-input:focus{outline:none;border-color:#08f;box-shadow:0 0 3px #0088ff80}.map-editor-root .count-num{font-size:18px;color:#333;margin-left:auto;font-family:monospace}.map-editor-root #castle-counter .count-num{font-size:20px;color:#28a745}.map-editor-root #map-viewport{flex:1;overflow:auto;display:block;background:#ddd;-webkit-overflow-scrolling:touch;position:relative}.map-editor-root #map-scroll-content{width:8000px;height:8000px;position:relative;display:flex;align-items:center;justify-content:center}.map-editor-root #map-container{display:grid;gap:1px;background:#ccc;width:max-content;border:1px solid #999;transform-origin:center center;position:relative;transform:rotate(45deg);-webkit-user-select:none;user-select:none}.map-editor-root .cell{width:var(--grid-size);height:var(--grid-size);background:#fff;box-sizing:border-box;position:relative;transition:background-color .1s}.map-editor-root .axis-h,.map-editor-root .axis-v{background:#fee2e8!important}.map-editor-root .axis-center{background:#ffb3c6!important}.map-editor-root .placed-block{position:absolute;z-index:100;display:flex;align-items:center;justify-content:center;font-weight:700;border:1.5px solid #444;box-sizing:border-box;cursor:move;text-align:center;font-size:14px;box-shadow:3px 3px 6px #00000026;border-radius:4px;white-space:pre-wrap;line-height:1.2;word-break:break-all;padding:2px;touch-action:none;-webkit-user-select:none;user-select:none;overflow:hidden}.map-editor-root .placed-block.selected-group{border:3px dashed #ff0044!important;box-shadow:0 0 12px #f049;z-index:105}.map-editor-root .block-content,.map-editor-root .preview-content{transform:rotate(-45deg);transform-origin:center center;display:flex;align-items:center;justify-content:center;width:140%;height:140%;flex-shrink:0;box-sizing:border-box}.map-editor-root #drop-preview{position:absolute;z-index:90;border:3px dashed #111;background:#00000026;box-sizing:border-box;pointer-events:none;display:none;border-radius:4px}.map-editor-root #selection-marquee{position:absolute;border:2px solid #0088ff;background:#08f3;pointer-events:none;z-index:200;display:none}.map-editor-root button{padding:10px 12px;cursor:pointer;border:1px solid #ccc;background:#fff;border-radius:4px;font-weight:700;display:flex;align-items:center;justify-content:center;gap:5px;transition:background .1s}.map-editor-root .sidebar-footer{margin-top:20px;padding-top:10px;border-top:1px solid #eee;display:flex;flex-direction:column;gap:8px}.map-editor-root .sidebar-footer button{white-space:nowrap;color:#333}.map-editor-root .btn-group-row{display:flex;gap:4px;width:100%}.map-editor-root .btn-group-row button{flex:1;padding:10px 2px;font-size:11px;text-align:center;justify-content:center}.map-editor-root .btn-save{background:#28a745;color:#fff!important;border:none;padding:12px;font-size:14px}.map-editor-root .btn-save:hover{background:#218838}.map-editor-root .btn-img{background:#08f;color:#fff!important;border:none;padding:12px;font-size:13px}.map-editor-root .btn-local-save{background:#6c757d;color:#fff!important;border:none}.map-editor-root .btn-local-load{background:#17a2b8;color:#fff!important;border:none}.map-editor-root .btn-delete-group{background:#dc3545;color:#fff!important;border:none;width:100%;padding:10px;font-size:13px;margin-bottom:10px;display:none}.map-editor-root .btn-delete-group:hover{background:#bd2130}.map-editor-root #loading-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:#fffc;display:flex;align-items:center;justify-content:center;z-index:9999;font-weight:700;color:#333;font-size:18px}.map-editor-root #search-modal{position:fixed;top:0;left:0;width:100%;height:100%;background:#00000080;display:none;align-items:center;justify-content:center;z-index:10000}.map-editor-root .modal-content{background:#fff;padding:20px;border-radius:8px;width:340px;max-height:85vh;display:flex;flex-direction:column;gap:12px;box-shadow:0 4px 20px #0003;box-sizing:border-box;color:#333}.map-editor-root .modal-input{width:100%;padding:12px;box-sizing:border-box;border:1px solid #ccc;border-radius:4px;font-size:16px;color:#333}.map-editor-root .color-picker-container{display:flex;gap:8px;justify-content:space-between;margin:4px 0}.map-editor-root .color-dot{width:34px;height:34px;border-radius:50%;border:2px solid #ccc;cursor:pointer;box-sizing:border-box;transition:transform .1s,border-color .1s;position:relative}.map-editor-root .color-dot:hover{transform:scale(1.1)}.map-editor-root .color-dot.selected{border-color:#000;transform:scale(1.1);box-shadow:0 0 6px #0000004d}.map-editor-root .color-dot.selected:after{content:"✓";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:inherit;font-size:14px;font-weight:700}.map-editor-root .user-list-area{flex:1;overflow-y:auto;border:1px solid #eee;border-radius:4px;min-height:120px}.map-editor-root .user-item{padding:12px 10px;cursor:pointer;border-bottom:1px solid #f5f5f5;font-size:14px;display:flex;justify-content:space-between;align-items:center}.map-editor-root .user-item:hover{background:#f0f7ff}.map-editor-root .user-item .user-info{font-size:11px;color:#888;background:#eee;padding:2px 6px;border-radius:3px}.map-editor-root .modal-actions{display:flex;gap:8px;justify-content:flex-end}@media (max-width: 768px){.map-editor-root #menu-toggle{display:block}.map-editor-root #sidebar{position:fixed;top:0;left:0;transform:translate(-100%);transition:transform .3s ease;box-shadow:5px 0 15px #0003;padding-top:50px}.map-editor-root.menu-open #sidebar{transform:translate(0)}.map-editor-root .modal-content{width:92%;max-height:90vh;height:auto}}.map-editor-root #map-container .cell{background-color:#fff}.map-editor-root .close-header{position:absolute;top:15px;right:15px;z-index:5000;display:flex;gap:10px}.map-editor-root .close-header button{background:#333;color:#fff;border:none;padding:8px 16px;border-radius:6px;cursor:pointer;box-shadow:0 4px 6px #0000004d}
