* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: #f4f5f7;
  color: #222;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

header {
  text-align: center;
  margin-bottom: 32px;
}

header h1 {
  font-size: 28px;
  margin: 0 0 8px;
  white-space: nowrap;
}

.subtitle {
  color: #666;
  margin: 0;
}

/* 광고 영역: 실제 애드센스 코드가 들어오기 전까지 자리를 예약해 레이아웃이 밀리지 않게 한다 */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  margin-bottom: 24px;
  border: 1px dashed #c7cad2;
  border-radius: 8px;
  background: #fafafc;
}

.ad-slot-bottom {
  margin-top: 32px;
  margin-bottom: 0;
}

.ad-label {
  font-size: 12px;
  letter-spacing: 0.05em;
  color: #aaa;
}

/* 업로드 영역: 클릭/드래그로 이미지 선택 */
.upload-area {
  border: 2px dashed #b5b9c2;
  border-radius: 12px;
  padding: 60px 20px;
  text-align: center;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.upload-area:hover {
  border-color: #6c7cff;
  background: #f8f9ff;
}

.upload-area.dragover {
  border-color: #6c7cff;
  background: #eef0ff;
  transform: scale(1.01);
}

.upload-area p {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
}

.upload-hint {
  color: #999;
  font-size: 13px;
  white-space: nowrap;
}

/* 변환 작업 영역 */
.workspace {
  margin-top: 32px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.preview-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 640px) {
  .preview-panel {
    grid-template-columns: 1fr;
  }
}

.preview-box {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.preview-box h2 {
  margin: 0 0 12px;
  font-size: 14px;
  color: #666;
  font-weight: 600;
  white-space: nowrap;
}

.grid-info {
  margin: 10px 0 0;
  font-size: 13px;
  color: #888;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.preview-box canvas {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 16px 16px;
  image-rendering: pixelated;
}

/* 조절 컨트롤 */
.controls {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow-x: auto;
}

.control-row {
  display: grid;
  grid-template-columns: 260px 1fr 50px;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.control-row label {
  font-size: 14px;
  color: #444;
  white-space: nowrap;
}

.control-row input[type="range"] {
  width: 100%;
  min-width: 120px;
  accent-color: #6c7cff;
}

.control-value {
  text-align: right;
  font-size: 13px;
  color: #666;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}


.button-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.1s ease, opacity 0.2s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #6c7cff;
  color: #fff;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: #eceef2;
  color: #444;
}

.btn-secondary:hover {
  background: #dee1e8;
}
