/* css/style.css - ASMR 시뮬레이터 스타일링 */
:root {
  --bg-dark: #0f1115;
  --panel-bg: rgba(20, 24, 33, 0.65);
  --panel-border: rgba(255, 255, 255, 0.12);
  --accent-color: #ffd89b;
  --accent-glow: rgba(255, 216, 155, 0.4);
  --text-main: #f0f4f8;
  --text-sub: #9ba3af;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  color: var(--text-main);
}

/* 씬 컨테이너: 16:9 비율 유지하면서 화면에 꽉 차게 중앙 정렬 */
.scene-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050608;
}

.scene-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  aspect-ratio: 1376 / 768;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

/* 레이어 1: 맨 뒤 원본 배경 */
.layer-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* 레이어 2: 창밖 사선 빗줄기 캔버스 */
.layer-rain-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  -webkit-mask-image: url('../window_mask.png');
  mask-image: url('../window_mask.png');
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* 레이어 3: 창문 표면 물방울 캔버스 */
.layer-glass-drops {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  -webkit-mask-image: url('../window_mask.png');
  mask-image: url('../window_mask.png');
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* 레이어 4: 창문만 뚫린 실내 전경 (오버레이) */
.layer-foreground {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 4;
  pointer-events: none; /* 클릭 및 터치가 하위 캔버스로 통과되도록 */
}

/* 창문 유리 김서림 필터 (창문 마스크 적용) */
.layer-steam-mist {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  backdrop-filter: blur(2px) contrast(1.05);
  -webkit-mask-image: url('../window_mask.png');
  mask-image: url('../window_mask.png');
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  pointer-events: none;
  opacity: 0.8;
  transition: opacity 0.5s ease;
}

/* 컨트롤 패널: 모던 글래스모피즘 */
.controls-panel {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 28px;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.controls-panel.auto-hide {
  opacity: 0.25;
}

.controls-panel:hover, .controls-panel.active {
  opacity: 1;
}

/* 버튼 */
.btn-icon {
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
  box-shadow: 0 0 12px var(--accent-glow);
}

.btn-icon.active {
  background: var(--accent-color);
  color: #111;
}

.btn-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* 컨트롤 슬라이더 아이템 */
.control-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-item label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
  letter-spacing: 0.5px;
}

.control-item input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  cursor: pointer;
}

.control-item input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-color);
  box-shadow: 0 0 6px var(--accent-glow);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.control-item input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* 상태 인디케이터 배지 */
.status-badge {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 10;
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 12px;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}
