:root{
  --bg:#0f1112;
  --panel:#131517;
  --accent:#e6e6e6;
  --muted:#9aa0a6;
  --gap:12px;
}

*{box-sizing:border-box}
html,body{height:100%;margin:0;background:var(--bg);color:var(--accent);font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif}
#app{
  height:100vh;
  display:flex;
  flex-direction:column;
  gap:var(--gap);
  padding:16px;
  align-items:stretch;
  justify-content:center;
}

/* Canvas area fills most of the view (mobile-first single screen) */
#canvasWrap{
  background:linear-gradient(180deg,#0b0c0d 0%, #111214 100%);
  border-radius:12px;
  padding:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  min-height:48vh;
  max-height:64vh;
  overflow:hidden;
}

canvas{
  width:100%;
  height:100%;
  display:block;
  border-radius:8px;
  background:#000;
  object-fit:contain;
}

/* Placeholder & file input */
#placeholder{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events:none;
}
#dropArea{
  pointer-events:auto;
  text-align:center;
  padding:14px 18px;
  border-radius:10px;
  background:rgba(255,255,255,0.02);
  color:var(--muted);
  font-size:14px;
  line-height:1.2;
  max-width:90%;
}
#fileInput{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:0;
  cursor:pointer;
}

/* Controls */
#controls{
  display:flex;
  gap:12px;
  padding:8px;
  align-items:center;
  justify-content:space-between;
}
.row{
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
}
.row span{font-size:14px;color:var(--muted)}
input[type=range]{
  -webkit-appearance:none;
  appearance:none;
  height:36px;
  flex:1;
  background:transparent;
}
input[type=range]::-webkit-slider-runnable-track{height:6px;background:#222;border-radius:6px}
input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;height:18px;width:18px;border-radius:50%;background:#e6e6e6;margin-top:-6px;box-shadow:0 1px 2px rgba(0,0,0,0.6)}
.buttons{justify-content:flex-end}
button{
  background:var(--panel);
  color:var(--accent);
  border:1px solid rgba(255,255,255,0.04);
  padding:10px 12px;
  border-radius:10px;
  min-height:44px;
  min-width:64px;
  font-size:14px;
  touch-action:manipulation;
}
button:active{transform:translateY(1px)}
@media(min-width:720px){
  #app{padding:20px}
  #canvasWrap{min-height:56vh;max-height:72vh}
}