:root {
  --pink: #ff00f3;
  --house-size: 25vw; /* automatically adjust the size based on the screen size, the ratio is always the same */
}

@font-face {
  font-family: "Print Sans";
  src: url("./font/FAIRE-PrintSans-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Pretendard";
  src: url("./font/Pretendard-Medium.woff") format("woff2");
}

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

body {
  background-color: #ffffff;
  font-family: "Print Sans", sans-serif;
  color: #000000;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  text-align: left;
}

/* indicator: 항상 좌측 상단, 독립적 위치 */
.indicator {
  position: fixed;
  width: 15vw;
  top: 8px;
  left: 16px;
  z-index: 10;
}

.footer {
  position: fixed;
  bottom: 16px;
  left: 16px;
  width: 15vw;
}

.line {
  width: 100%;
  height: 1px;
  background-color: #000;
  margin-top: 8px;
  margin-bottom: 8px;
}

.location,
.livestream,
.language {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.language p {
  margin: 0;
  cursor: pointer;
  transition: color 0.3s ease;
}

.language p.active {
  color: var(--pink);
}

/* 언어별 콘텐츠 표시/숨김 */
[data-lang] {
  display: block;
  width: 100%;
}

[data-lang].hidden {
  display: none;
}

.location-outside,
.location-inside {
  margin: 0;
  padding: 0;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.location-outside.active,
.location-inside.active {
  color: var(--pink);
}

.about {
  display: flex;
  align-items: center;
}

.about p:last-child {
  margin-left: auto;
}

.livestream {
  display: flex;
  align-items: center;

  img {
    width: 15px;
    height: 15px;
  }

  .livestream-text {
    margin-right: 5px;
  }
}

.livestream-status {
  margin-left: auto;
  color: var(--pink);
}

.about {
  display: flex;
  text-align: left;
  align-items: center;

  img {
    width: 15px;
    height: 15px;
  }
}

.about-text {
  margin-right: 5px;
  text-align: left;
}

/* scene: always centered, not overlapping with indicator */
.scene {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

/* flex to center the house, translate to visually center the house (avoid tilting to the right/bottom) */
.house-3d {
  position: relative;
  width: var(--house-size);
  height: var(--house-size);
  transform-style: preserve-3d;
  transform-origin: center center;
  cursor: grab;
  /* this is important!! it makes the house centered */
  transform: translate(-10%, -50%);
}

.house-3d:active {
  cursor: grabbing;
}

.face {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: var(--pink);
  border: 2px solid var(--pink);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  backface-visibility: visible;
  /* left: 50%;
    top: 50%; */
  /* margin-left: calc(-25vw * 0.85);
    margin-top: calc(-25vw * 0.25); */
}

.text-content {
  padding: 20px;
  font-size: 1vw;
  line-height: 1.6;
  color: #fff;
  text-align: left;
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  pointer-events: auto;
}

.text-content::-webkit-scrollbar {
  width: 8px;
}

.text-content::-webkit-scrollbar-track {
  background: transparent;
}

.text-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 4px;
}

.text-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.8);
}

.lang-content {
  width: 100%;
  display: block;
}

.lang-content p {
  margin-bottom: 15px;
  margin-top: 0;
}

.lang-content p.paragraph-break {
  margin-top: 30px !important;
  margin-bottom: 15px;
}

.front {
  transform: rotateY(0deg) translateZ(calc(var(--house-size) * 0.5));
  width: var(--house-size);
}

.back {
  transform: rotateY(180deg) translateZ(calc(var(--house-size) * 0.5));
  width: var(--house-size);
}

.right {
  transform: rotateY(90deg) translateZ(calc(var(--house-size) * 0.5));
  width: var(--house-size);
}

.left {
  transform: rotateY(-90deg) translateZ(calc(var(--house-size) * 0.5));
  width: var(--house-size);
}

.bottom {
  transform: rotateX(-90deg) translateZ(calc(var(--house-size) * 0.5));
  width: var(--house-size);
  height: var(--house-size);
}

.bottom .text-content {
  transform: rotate(90deg);
}

.top-right {
  transform-origin: center bottom;
  transform: translateY(calc(var(--house-size) * -0.7))
    translateZ(calc(var(--house-size) * 0.5)) rotateX(45deg);
  height: calc(var(--house-size) * 0.707);
  width: var(--house-size);

  .text-content {
    margin-left: 10px;
    margin-top: 10px;
    margin-right: auto;
    padding: 0px;
    width: calc(var(--house-size) * 0.6);
    text-align: left;
  }
}

.top-left {
  transform-origin: center bottom;
  transform: translateY(calc(var(--house-size) * -0.7))
    translateZ(calc(var(--house-size) * -0.5)) rotateX(-45deg) rotateY(180deg);
  height: calc(var(--house-size) * 0.707);
  width: var(--house-size);
}

.gable-front {
  transform: rotateY(90deg) translateZ(calc(var(--house-size) * 0.5))
    translateY(calc(var(--house-size) * -0.5));
  width: var(--house-size);
  height: calc(var(--house-size) * 0.5);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.gable-front img {
  max-width: calc(var(--house-size) * 0.7);
  max-height: calc(var(--house-size) * 0.7);
  min-width: calc(var(--house-size) * 0.2);
  min-height: calc(var(--house-size) * 0.2);
}

.gable-back {
  transform: rotateY(-90deg) translateZ(calc(var(--house-size) * 0.5))
    translateY(calc(var(--house-size) * -0.5));
  width: var(--house-size);
  height: calc(var(--house-size) * 0.5);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.gable-back img {
  max-width: calc(var(--house-size) * 0.7);
  max-height: calc(var(--house-size) * 0.7);
  min-width: calc(var(--house-size) * 0.2);
  min-height: calc(var(--house-size) * 0.2);
}

/* clock indicator */

.hour {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateY(-50%);
  transform-origin: left center;
}

.minute {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateY(-50%);
  transform-origin: left center;
}

.second {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateY(-50%);
  transform-origin: left center;
}

.hrs-indicator {
  font-size: 2vw;
}

/* appear text when arrow is clicked */
.arrow-text {
  margin-top: 8px;
  text-align: left;
  max-height: 200px;
  transition: opacity 0.3s ease;
}

.arrow-text.hidden {
  display: none;
  opacity: 0;
}

.arrow-text.show {
  display: block;
  opacity: 1;
}

.arrow-toggle {
  cursor: pointer;
  transition: transform 0.3s ease;
}

.arrow-toggle.rotated {
  transform: rotate(180deg);
}

/* 방명록 입력폼 */
.guestbook {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.guestbook-title {
  margin: 0;
  margin-right: 5px;
  text-align: left;
}

.guestbook-arrow {
  cursor: pointer;
  transition: transform 0.3s ease;
  width: 15px;
  height: 15px;
}

.guestbook-arrow.rotated {
  transform: rotate(180deg);
}

.guestbook-form {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  max-height: 500px;
  overflow: hidden;
  transition:
    max-height 0.3s ease,
    opacity 0.3s ease;
  opacity: 1;
}

.guestbook-form.hidden {
  max-height: 0;
  opacity: 0;
  display: none;
}

.guestbook-name,
.guestbook-content {
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 2px;
  font-family: inherit;
  font-size: 12px;
  background-color: #ffffff;
  color: #000000;
  transition: border-color 0.3s ease;
  min-width: 100px;
}

.guestbook-name {
  width: 60px;
}

.guestbook-content {
  flex: 1;
  min-width: 120px;
}

.guestbook-name:focus,
.guestbook-content:focus {
  outline: none;
  border-color: var(--pink);
}

.guestbook-submit {
  padding: 4px 12px;
  border: 1px solid #ccc;
  border-radius: 2px;
  background-color: #ffffff;
  color: #000000;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.guestbook-submit:hover {
  border-color: var(--pink);
  color: var(--pink);
}

.guestbook-submit:active {
  transform: scale(0.95);
}

.guestbook-status {
  margin: 0;
  font-size: 11px;
  color: #666;
  min-height: 14px;
}

/* guestbook arrow text */
.guestbook-arrow-text {
  margin-top: 8px;
  text-align: left;
  max-height: 200px;
  transition: opacity 0.3s ease;
}

.guestbook-arrow-text.hidden {
  display: none;
  opacity: 0;
}

.guestbook-arrow-text.show {
  display: block;
  opacity: 1;
}

/* chimney */
.chimney {
  position: absolute;

  width: calc(var(--house-size) * 0.15);
  height: calc(var(--house-size) * 0.15);
  transform-style: preserve-3d;
  transform: translateY(calc(var(--house-size) * -0.65))
    translateX(calc(var(--house-size) * 0.7))
    translateZ(calc(var(--house-size) * 0.2));
}

.chimney-face {
  position: absolute;
  background-color: var(--pink);
  opacity: 0.9;
}

.chimney-face.front {
  width: calc(var(--house-size) * 0.15);
  height: calc(var(--house-size) * 0.45);
  transform: translateZ(calc(var(--house-size) * 0.075));
}

.chimney-face.back {
  width: calc(var(--house-size) * 0.15);
  height: calc(var(--house-size) * 0.45);
  transform: rotateY(180deg) translateZ(calc(var(--house-size) * 0.075));
}

.chimney-face.right {
  width: calc(var(--house-size) * 0.15);
  height: calc(var(--house-size) * 0.45);
  transform: rotateY(90deg) translateZ(calc(var(--house-size) * 0.075));
}

.chimney-face.left {
  width: calc(var(--house-size) * 0.15);
  height: calc(var(--house-size) * 0.45);
  transform: rotateY(-90deg) translateZ(calc(var(--house-size) * 0.075));
}

.chimney-face.top {
  width: calc(var(--house-size) * 0.15);
  height: calc(var(--house-size) * 0.15);
  transform: rotateX(90deg) translateZ(calc(var(--house-size) * 0.075));
}

/* mobile*/
@media (max-width: 768px) {
  body {
    font-size: 10px;
  }

  .indicator {
    font-size: 10px;
  }

  .indicator img {
    width: 18px;
    height: 18px;
  }

  .footer {
    font-size: 10px;
  }

  .scene {
    zoom: 1.6;
    font-size: 10px;
  }

  .text-content {
    font-size: 6px;
    line-height: 1.4;
    padding: 6px;
  }

  .gable-front img,
  .gable-back img {
    max-width: calc(var(--house-size) * 0.2);
    max-height: calc(var(--house-size) * 0.2);
    min-width: calc(var(--house-size) * 0.1);
    min-height: calc(var(--house-size) * 0.1);
  }

  .arrow-toggle {
    width: 10px !important;
    height: 10px !important;
  }

  .lang-content p.paragraph-break {
    margin-top: 10px !important;
    margin-bottom: 10px;
  }
}

/* hrs-indicator: 스크롤 가능, 스크롤바 숨김
.hrs-indicator {
  position: fixed;
  top: 8px;
  right: 16px;
  max-height: 80vh;
  width: 15vw;
  overflow-y: scroll;
  overflow-x: hidden;
  z-index: 10;
  scrollbar-width: none; /* Firefox */
/* } */

/* Chrome, Safari, Edge */
/* .hrs-indicator::-webkit-scrollbar {
  display: none;
} */
