﻿.editor-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 12;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(10, 12, 18, 0.65);
  color: #ffffff;
  font-family: var(--mono);
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.35);
}

.editor-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.editor-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.editor-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(420px, 94vw);
  background: rgba(12, 14, 20, 0.9);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateX(105%);
  transition: transform 0.25s ease;
  z-index: 11;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(16px);
}

.editor-panel.is-open {
  transform: translateX(0);
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.editor-title {
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: 0.5px;
}

.editor-close {
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
}

.editor-body {
  padding: 16px 18px 28px;
  overflow-y: auto;
  display: grid;
  gap: 18px;
}

.editor-section {
  display: grid;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.editor-section h3 {
  margin: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.editor-field {
  display: grid;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.editor-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}


.editor-field input,
.editor-field textarea,
.editor-field select,
.editor-auth input,
#editor-windows-json {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
  padding: 8px 10px;
  font-family: var(--mono);
}

.editor-field input[type="range"] {
  padding: 6px 0;
}

.editor-field textarea,
#editor-windows-json {
  resize: vertical;
}

.editor-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.editor-subtitle {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 6px;
}

.editor-subgroup {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.editor-subgroup-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}

.editor-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 10px;
  font-family: var(--mono);
  cursor: pointer;
}

.editor-btn.ghost {
  background: transparent;
}

.editor-actions {
  display: flex;
  gap: 10px;
}

.editor-windows-list {
  display: grid;
  gap: 8px;
}

.editor-window-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 0.72rem;
}

.editor-window-row button {
  border: none;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.72rem;
}

.editor-auth {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
}

.editor-auth.is-open {
  opacity: 1;
  pointer-events: auto;
}

.editor-auth-card {
  width: min(360px, 90vw);
  background: rgba(12, 14, 20, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  gap: 12px;
}

.editor-muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.editor-error {
  color: #ff6b6b;
  font-size: 0.75rem;
  min-height: 16px;
}

.editor-auth-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.editor-positioner {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 30;
}

.editor-positioner.is-open {
  opacity: 1;
  pointer-events: auto;
}

.editor-positioner-card {
  width: min(520px, 92vw);
  background: rgba(12, 14, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  display: grid;
  gap: 12px;
  padding: 14px;
  backdrop-filter: blur(12px);
}

.editor-positioner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.editor-positioner-body {
  display: grid;
  gap: 10px;
}

.positioner-preview {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background-color: rgba(255, 255, 255, 0.04);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.positioner-preview:active {
  cursor: grabbing;
}

.positioner-banner {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.positioner-avatar {
  width: 160px;
  height: 160px;
  border-radius: 18px;
  justify-self: center;
}

.positioner-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  transform: scale(var(--pos-scale, 1));
  transform-origin: center;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.positioner-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
}

.positioner-scale {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--neon) 0%,
    var(--neon) var(--pos-fill, 0%),
    rgba(255, 255, 255, 0.12) calc(var(--pos-fill, 0%) + 1px),
    rgba(255, 255, 255, 0.12) 100%
  );
  outline: none;
}

.positioner-scale::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: transparent;
}

.positioner-scale::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 12px var(--text-glow);
  margin-top: -2px;
}

.positioner-scale::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.positioner-scale::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--neon);
  box-shadow: 0 0 10px var(--text-glow);
}

.positioner-scale::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 12px var(--text-glow);
  border: none;
}

.positioner-value {
  min-width: 44px;
  text-align: right;
  color: var(--muted);
}

.positioner-frame {
  position: absolute;
  inset: 0;
  margin: auto;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.banner-frame {
  width: 96%;
  aspect-ratio: 8 / 1;
  border-radius: 12px;
}

.avatar-frame {
  width: 70%;
  aspect-ratio: 1;
  border-radius: 18px;
}

@media (max-width: 720px) {
  .editor-toggle {
    right: 12px;
    bottom: 12px;
  }
}
