/* Layout container */
.huv-uploader {
  display: grid;
  grid-template-columns: 1fr; /* mobile-first: single column */
  gap: 16px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Left: compact cropper panel */
.huv-left {
  max-width: 360px; /* compact */
}

.huv-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
}

.huv-file {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.huv-ratios {
  margin: 10px 0;
}

.huv-ratio {
  background: #fdfbf6;
  color: #7a693f;
  border: 1px solid #222;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}
.huv-ratio.active { background: #222; color: #fff; border-color: #222; }

.huv-ratio:hover {
  background: #eaeaea;
  border-color: #999;
  color: #000;
}

.huv-cropbox {
  border: 1px solid #eee;
  border-radius: 6px;
  background: #fdfdfd;
  padding: 8px;
  max-width: 320px;        /* smaller cropper UI */
  overflow: hidden;
}

/* Buttons */
.huv-actions { margin-top: 10px; display: flex; gap: 8px; }
.huv-btn { padding: 9px 14px; border-radius: 6px; border: none; background: #222; color: #fff; }
.huv-btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* Right panel wraps board canvases */
.huv-right { display: grid; gap: 12px; }

/* Row with main + skew side-by-side */
.huv-boards-row {
  display: grid;
  grid-template-columns: 1fr 0.8fr; /* skew approx 80% of main width */
  gap: 12px;
  align-items: start;
}

/* Main board visual wrapper (do NOT set width/height on canvas!) */
.huv-main-wrap {
  position: relative;
  border: 1px solid #e6e6e6;
  background-size: cover;
  background-position: center;
  overflow: auto;     /* allow scroll on small screens, canvas stays fixed px */
}

/* Keep canvas pixels fixed (important for drag math) */
.huv-main-canvas,
.huv-preview-canvas {
  display: block;       /* no CSS width/height here */
}


.huv-skew-canvas,.huv-skew-wrap{
    display: none;
}

.huv-coords {
  position: absolute;
  left: 8px; top: 8px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  pointer-events: none;
}

/* Skew wrap */
.huv-skew-wrap {
  border: 1px solid #e6e6e6;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
}

/* Cropped-only preview */
.huv-preview-wrap {
  border: 1px solid #e6e6e6;
  background: #fff;
  border-radius: 6px;
  padding: 4px;
  overflow: hidden;
}

/* Desktop/tablet layout: left (cropper) + right (boards) side-by-side */
@media (min-width: 900px) {
  .huv-uploader {
    grid-template-columns: 360px 1fr;
    align-items: start;
  }
}


/* --- Custom Upload Field --- */
.huv-upload-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0 15px;
}

.huv-file {
  display: none; /* hide native input */
}

.huv-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #222, #444);
  color: #fff;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.huv-upload-btn:hover {
  background: linear-gradient(135deg, #000, #333);
  transform: translateY(-1px);
  box-shadow: 0 5px 10px rgba(0,0,0,0.25);
}

.huv-upload-icon {
  font-size: 1.2em;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(255,255,255,0.3));
}

.huv-upload-text {
  letter-spacing: 0.4px;
}

/* mobile friendliness */
@media (max-width: 860px){
  .huv-upload-btn {
    width: 100%;
    justify-content: center;
  }
}