:root {
  color-scheme: dark;
}
body {
  margin: 0;
  font-family: "M PLUS 1", "Roboto", sans-serif;
  background: radial-gradient(circle at top, #1b2433 0%, #0b1118 70%);
  color: #e8f0f7;
  min-height: 100vh;
}
.tool {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
  min-height: 100vh;
}
@media (max-width: 960px) {
  .tool {
    grid-template-columns: 1fr;
  }
}
.panel {
  background: rgba(10, 14, 20, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.panel.is-collapsed {
  max-height: none;
  overflow: visible;
  padding: 12px;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-toggle {
  padding: 6px 10px;
  font-size: 11px;
}
.panel.is-collapsed .panel-advanced {
  display: none;
}
.panel h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.04em;
}
.preset-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.preset-item {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
}
.field {
  margin-bottom: 12px;
}
.field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 6px;
}
.field input[type="range"] {
  width: 100%;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.row input[type="color"] {
  width: 36px;
  height: 28px;
  border: none;
  padding: 0;
  background: transparent;
}
select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(18, 24, 32, 0.8);
  color: #fff;
}
button {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(30, 36, 48, 0.9);
  color: #fff;
  cursor: pointer;
}
button.secondary {
  background: rgba(20, 24, 32, 0.9);
}
textarea {
  width: 100%;
  min-height: 150px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 18, 0.85);
  color: #e8f0f7;
  padding: 10px;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
}
.stage {
  position: relative;
  background: var(--stage-bg, radial-gradient(circle at 30% 20%, rgba(30, 40, 60, 0.9), rgba(8, 12, 18, 0.9)));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  min-height: calc(100vh - 40px);
  overflow: hidden;
}
.card-preview {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 2;
}
#fx-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
}
.hint {
  font-size: 11px;
  opacity: 0.7;
  margin-bottom: 10px;
}
