@charset "UTF-8";

@import url('https://fonts.googleapis.com/css2?family=Kosugi+Maru&family=Noto+Sans+JP&family=Noto+Serif+JP&display=swap');

#workspace {
    width: 100%;
    height: 100%;
    border: 3px dashed #aaa;
    position: relative;
    text-align: center;
    overflow: scroll;
}

#canvasWrapper {
    position: relative;
    transform-origin: top left;
}

#baseImage {
    top: 0;
    left: 0;
    object-fit: contain; /* 画像の比率を維持 */
    z-index: -1;         /* 背景として再背面に配置 */ 
}

#baseFname {
    font-size: 12px;
}

#addTextBtn, #addDashedBoxBtn {
    font-size: 12px;
}

#addTextBtn:hover, #addDashedBoxBtn:hover {
    cursor: pointer;
    color: #333333;
}

.caseImage {
    position: absolute;
    cursor: grab;
    overflow: visible; /* ★ ハンドルがはみ出るので必須 */
}

.caseImage:active {
    cursor: grabbing;
}

.caseImage img {
    display: block; /* または inline-block */
    width: 100%;    /* 親(div)の幅に合わせる */
    height: 100%;   /* 親(div)の高さに合わせる */
    object-fit: contain; /* 画像の比率を維持しつつ div に収める */
}

.caseText {
    position: absolute;
    top: 50px;
    left: 100px;
    padding: 0;
    margin: 0;
    font-size: 18px;
    cursor: grab;
}

.caseText:active {
    cursor: grabbing;
}

#workBtnContainer{
    display: flex;           /* 横並びにする */
    gap: 10px;               /* ボタンの間隔 */
    justify-content: center; /* 中央寄せ */
    margin-bottom: 5px;     /* 作業エリアとの間隔 */ 
}

.addImageBtn {
    font-size: 12px;
    color: #333333;
}

#saveImageBtn {
    font-size: 12px;
}

.addImageBtn img {
    width: 15px;
    height: 15px;
    object-fit: contain; /* 画像の比率を維持 */
    margin-bottom: 1px;  /* 画像とテキストの間隔 */
}  

.addImageBtn:hover, #saveImageBtn:hover {
    cursor: pointer;
}

.dashedBox {
    position: absolute;
    width: 300px;
    height: 300px;
    top: 50px;
    left: 50px;
    border: 3px dashed #333333;
    cursor: grab;
}

.dashedBox:active {
    cursor: grabbing;
}

.resizeHandle {
    width: 30px;
    height: 30px;
    background: transparent; /* 透明 */
    position: absolute;
    right: -10px;
    bottom: -10px;
    cursor: nwse-resize;
    display: none; /* 非表示 */
    z-index: 10; 
    box-sizing: border-box;
}

.aspectRatioResizeHandle {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 12px;
    height: 12px;
    background-color: rgba(0, 150, 255, 0.8);
    border: 1px solid white;
    cursor: nwse-resize;
    z-index: 10;
    box-sizing: border-box;
}

.dashedBox.selected .resizeHandle {
    display: block; /* 表示 */
    width: 12px;
    height: 12px;
    background-color: rgba(0, 150, 255, 0.8);
    border: 1px solid white;
    right: -5px;
    bottom: -5px;
}

#textColorPicker, #fontPicker {
    position: absolute;
}

.decoFile label {
    display: block;
    font-size: 12px;
}

.decoFile label:hover {
    cursor: pointer;
}

.decoFile input[type="file"]{
    display: none;
}

.anyFile label {
    display: block;
    font-size: 12px;
}

.anyFile label:hover {
    cursor: pointer;
}

.anyFile input[type="file"] {
    display: none;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    cursor: pointer;
    width: 100%;

    background: #299fbd;
    height: 8px;
    border-radius: 8px;
}

/* Thumb: Chrome, Safari, Opera, Edge */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 15px;
    width: 15px;
    background-color: #bd299f;
    border-radius: 50%;
}
/* Thumb: Firefox */
input[type="range"]::-moz-range-thumb {
    border: none;
    height: 15px;
    width: 15px;
    background-color: #bd299f;
    border-radius: 50%;
}

#zoomValue, #zoomReset {
    font-size: 12px;
}

.context-menu-item {
    user-select: none;
    -webkit-user-select: none; /* Safari対応 */
    -moz-user-select: none;    /* Firefox対応 */
}
  