* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  background: #0f0f1b;
  color: #fff;
  font-family: system-ui, sans-serif;
  padding: 20px;
}
.app {
  max-width: 1200px;
  margin: 0 auto;
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a1a32;
  padding: 16px 20px;
  border-radius: 14px;
  margin-bottom: 20px;
}
.header h1 {
  font-size: 22px;
  background: linear-gradient(90deg, #4cc9f0, #f72585);
  -webkit-background-clip: text;
  color: transparent;
}
.btns {
  display: flex;
  gap: 10px;
}
.btns button {
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-weight: 500;
  cursor: pointer;
}
#edit { background: #7c3aed; }
#export { background: #ec4899; }

.canvas-box {
  width: 100%;
  height: 600px;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
}
#canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.tab {
  padding: 12px 20px;
  background: #1e1e3f;
  border: none;
  color: #ccc;
  border-radius: 10px;
  cursor: pointer;
}
.tab.active {
  background: #4cc9f0;
  color: #000;
}

.control {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
}
.control label, #play {
  padding: 10px 18px;
  background: #2563eb;
  color: white;
  border-radius: 10px;
  cursor: pointer;
  border: none;
}
.control label { background: #333; }

.panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  height: 100vh;
  background: #111827;
  transition: right 0.3s;
  padding: 20px;
  z-index: 99;
}
.panel.open { right: 0; }
.panel-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}
#close {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.modal.show { display: flex; }
.modal-box {
  background: #1f2937;
  padding: 30px;
  border-radius: 16px;
  width: 90%;
  max-width: 420px;
}
.opt {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 20px 0;
}
.bar {
  height: 8px;
  background: #374151;
  border-radius: 4px;
  overflow: hidden;
  margin: 16px 0;
}
#progress {
  height: 100%;
  background: #8b5cf6;
  width: 0%;
}
.act {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.act button {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}
#start { background: #2563eb; color: #fff; }
#cancel { background: #444; color: #fff; }
