/* Kylie Minogue - 〈Come Into My World〉 Minimalist Interactive Experience */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #ffffff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #111111;
}

#appContainer {
  position: relative;
  width: 100vw;
  height: 100vh;
  background-color: #ffffff;
  cursor: none;
}

/* 작업 영역 */
#workspace {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 고정된 원형 거리 이미지 래퍼 */
#streetWrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
}

#streetImage {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  opacity: 0; /* 마우스가 들어올 때 마스크와 함께 표시 */
  transition: opacity 0.25s ease-out;
  pointer-events: none;
  /* 마스크 기본값 */
  -webkit-mask-image: radial-gradient(circle 0px at -9999px -9999px, transparent 0%, transparent 100%);
  mask-image: radial-gradient(circle 0px at -9999px -9999px, transparent 0%, transparent 100%);
}

/* 도장 렌더링 캔버스 */
#stampCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 20;
}

/* 우측 상단 'next kylie' 버튼 (스케치 스타일 반영) */
#nextKylieBtn {
  position: fixed;
  top: 36px;
  right: 42px;
  width: 88px;
  height: 88px;
  border: none;
  outline: none;
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  border-radius: 2px;
  background-color: #f26422;
  color: #111111;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.15s ease, background-color 0.3s ease;
}

#nextKylieBtn:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
}

#nextKylieBtn:active {
  transform: scale(0.96);
}

/* 회차 인디케이터 (미니멀) */
#turnIndicator {
  position: fixed;
  top: 42px;
  left: 42px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #888888;
  opacity: 0.65;
  z-index: 90;
  pointer-events: none;
  transition: color 0.3s ease;
}

/* 토스트 메시지 안내 */
#statusToast {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 20, 20, 0.88);
  color: #ffffff;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 200;
  backdrop-filter: blur(8px);
}

#statusToast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Shake Animation (빈 회차 클릭 시) */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.shake {
  animation: shake 0.35s ease-in-out;
}

/* Tweak Setting 패널 & 토글 버튼 */
#tweakToggleBtn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  opacity: 0.45;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#tweakToggleBtn:hover {
  opacity: 1;
  transform: scale(1.1);
}

#controlPanel {
  position: fixed;
  bottom: 70px;
  left: 24px;
  width: 330px;
  max-height: 80vh;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
  padding: 18px;
  z-index: 160;
  font-size: 12px;
  color: #333333;
}

#controlPanel .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

#controlPanel .panel-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: #111111;
}

#controlPanel .close-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #888888;
}

#controlPanel .control-group {
  margin-bottom: 14px;
}

#controlPanel .control-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #444444;
}

#controlPanel .control-group span {
  font-weight: 700;
  color: #111111;
}

#controlPanel input[type="range"] {
  width: 100%;
  accent-color: #f26422;
  cursor: pointer;
}

/* 12색 팔레트 그리드 */
.color-palette-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 6px;
}

.color-chip {
  aspect-ratio: 1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
  transition: transform 0.15s ease;
}

.color-chip.active {
  transform: scale(1.15);
  box-shadow: 0 0 0 2px #111111, 0 3px 8px rgba(0,0,0,0.25);
}

.panel-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.action-btn {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 6px;
  background: #f7f7f7;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn:hover {
  background: #ebebeb;
}

.action-btn.danger {
  color: #d81159;
  border-color: rgba(216, 17, 89, 0.2);
}

.action-btn.danger:hover {
  background: rgba(216, 17, 89, 0.08);
}
