@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

:root {
  --primary-color: #f6f7fb;
  --white-color: #fff;
  --black-color: #18191a;
  --red-color: #e74c3c;
}

body {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
}

body.dark {
  --primary-color: #242526;
  --white-color: #18191a;
  --black-color: #fff;
  --red-color: #e74c3c;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 60px;
  width: 100%;
  max-width: 1200px;
}

.clocks {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  gap: 50px;
  flex-wrap: wrap;
}

.clock-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 33%;
  min-width: 250px;
}

.container .clock {
  display: flex;
  position: relative;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1/1;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--white-color);
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.1), 0 25px 45px rgba(0, 0, 0, 0.1);
}

/* ✅ 숫자 크기 조정 */
.clock label {
  position: absolute;
  inset: 5%;
  text-align: center;
  transform: rotate(calc(var(--i) * (360deg / 12)));
}

.clock label span {
  display: inline-block;
  font-size: calc(1.5vw + 10px);
  font-weight: 600;
  color: var(--black-color);
  transform: rotate(calc(var(--i) * (-360deg / 12)));
}

/* ✅ 시계 중심 원 크기 유지 */
.container .indicator {
  position: absolute;
  height: 20px;
  width: 20px;
  background: var(--black-color);
  border-radius: 50%;
  z-index: 100;
}

/* ✅ 시계 바늘 크기 12.5배 확대 (기존 5배 + 2.5배 추가) */
.hand {
  position: absolute;
  bottom: 50%;
  transform-origin: bottom;
  z-index: 99;
  border-radius: 10px;
}

/* ✅ 시계 크기에 맞게 바늘 크기 자동 조정 */
.hand.hour {
  height: calc(40% * 12.5); /* 기존보다 12.5배 확대 */
  width: 15px;
  background: var(--black-color);
}

.hand.minute {
  height: calc(50% * 12.5); /* 기존보다 12.5배 확대 */
  width: 12px;
  background: var(--black-color);
}

.hand.second {
  height: calc(55% * 12.5); /* 기존보다 12.5배 확대 */
  width: 8px;
  background: var(--red-color);
}

/* ✅ 국가명 크기 조정 */
.timezone-label {
  font-size: calc(1vw + 8px);
  font-weight: 500;
  color: var(--black-color);
  text-align: center;
  margin-top: 10px;
}

/* ✅ 다크 모드 버튼 크기 조정 */
.mode-switch {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: calc(1vw + 10px);
  font-weight: 400;
  display: inline-block;
  color: var(--white-color);
  background: var(--black-color);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  margin-top: 20px;
}

.mode-switch:active {
  transform: scale(0.98);
}

/* ✅ 반응형 미디어 쿼리 */
@media (max-width: 1024px) {
  .clocks {
    flex-wrap: wrap;
    gap: 30px;
  }

  .clock-container {
    width: 45%;
  }

  .timezone-label {
    font-size: calc(1.2vw + 6px);
  }

  .mode-switch {
    font-size: calc(1.2vw + 8px);
  }

  /* ✅ 작은 화면에서는 바늘 크기도 자동 조정 */
  .hand.hour {
    height: calc(35% * 12.5);
  }

  .hand.minute {
    height: calc(45% * 12.5);
  }

  .hand.second {
    height: calc(50% * 12.5);
  }
}

@media (max-width: 768px) {
  .clock-container {
    width: 100%;
  }

  .timezone-label {
    font-size: calc(1.5vw + 6px);
  }

  .mode-switch {
    font-size: calc(1.5vw + 8px);
  }

  /* ✅ 모바일에서는 바늘 길이 조정 */
  .hand.hour {
    height: calc(30% * 12.5);
  }

  .hand.minute {
    height: calc(40% * 12.5);
  }

  .hand.second {
    height: calc(45% * 12.5);
  }
}
