html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ffd23f;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.scene {
  position: relative;
  width: 320px;
  height: 180px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  background: linear-gradient(160deg, #fff3c4, #ffd23f 85%);
}

.frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 110px;
  height: 72px;
  margin-top: -36px;
  margin-left: -55px;
}
.frame:focus-visible {
  outline: 2px solid #6ec8ff;
  outline-offset: 6px;
}

.subjectShape {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(135deg, #4cd4a6, #6ec8ff);
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  will-change: transform;
}

.handle {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px;
  border-radius: 4px;
  background: #17141a;
  border: 2px solid #fff7e6;
  cursor: nwse-resize;
  touch-action: none;
}
.handle--tl {
  top: 0;
  left: 0;
}
.handle--tr {
  top: 0;
  left: 100%;
  cursor: nesw-resize;
}
.handle--bl {
  top: 100%;
  left: 0;
  cursor: nesw-resize;
}
.handle--br {
  top: 100%;
  left: 100%;
}
.handle.isActive, .handle:focus-visible {
  background: #6ec8ff;
}

.readout {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.78);
  color: #fff7e6;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 340px) {
  .scene {
    width: 220px;
    height: 124px;
  }
  .frame {
    width: 78px;
    height: 52px;
    margin-top: -26px;
    margin-left: -39px;
  }
  .handle {
    width: 12px;
    height: 12px;
    margin: -6px;
  }
  .readout {
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .handle {
    transition: none;
  }
}
