/* =========================
   기본 초기화
========================= */

@font-face {
  font-family: "CherrySpoon";
  src: url("../fonts/Griun_Cherry1Spoon-Rg.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  overflow: hidden;
  font-family: "CherrySpoon", sans-serif;
}

button {
  font: inherit;
}

a.island-button {
  display: block;
  color: inherit;
  text-decoration: none;
}

/* =========================
   전체 첫 화면
========================= */

.main-screen {
  position: relative;

  width: 100%;
  height: 100vh;
  min-height: 700px;

  overflow: hidden;

  background-image: url("../images/sky.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* 화면 위쪽의 은은한 빛 효과 */

.main-screen::before {
  content: "";

  position: absolute;
  inset: 0;

  background:
    radial-gradient(
      circle at 50% 35%,
      rgba(255, 255, 255, 0.2),
      transparent 48%
    );

  pointer-events: none;
}

/* =========================
   제목
========================= */

.main-title {
  position: absolute;
  top: 45px;
  left: 50%;
  z-index: 100;

  width: 90%;

  text-align: center;
  color: white;

  transform: translateX(-50%);

  text-shadow:
    0 3px 12px rgba(15, 91, 148, 0.35),
    0 1px 3px rgba(0, 0, 0, 0.15);

  pointer-events: none;
}

.main-title h1 {
  font-size: clamp(34px, 4vw, 60px);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.main-title p {
  margin-top: 10px;

  font-size: clamp(15px, 1.4vw, 21px);
  font-weight: 600;
}

/* =========================
   섬 배치 영역
========================= */

.island-area {
  position: relative;

  width: 100%;
  height: 100%;
}

/* =========================
   공통 섬 버튼
========================= */

.island-button {
  position: absolute;
  z-index: 10;

  width: clamp(220px, 24vw, 420px);

  border: none;
  outline: none;
  background: transparent;

  cursor: pointer;

  transform:
    translate(-50%, -50%)
    scale(1);

  transform-origin: center;

  transition:
    transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.28s ease;

  animation: floating 4.8s ease-in-out infinite;

  -webkit-tap-highlight-color: transparent;
}

/* 섬 이미지 */

.island-button img {
  display: block;

  width: 100%;
  height: auto;

  user-select: none;
  pointer-events: none;

  filter:
    drop-shadow(
      0 22px 17px rgba(28, 80, 115, 0.23)
    );

  transition:
    filter 0.28s ease;
}

/* 섬 이름 */

.country-label {
  position: absolute;
  left: 50%;
  bottom: 2%;

  padding: 9px 19px;

  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;

  color: #326584;
  background: rgba(255, 255, 255, 0.92);

  font-size: clamp(13px, 1vw, 17px);
  font-weight: 800;
  white-space: nowrap;

  box-shadow:
    0 10px 25px rgba(42, 111, 155, 0.2);

  opacity: 0;

  transform:
    translate(-50%, 12px)
    scale(0.9);

  transition:
    opacity 0.22s ease,
    transform 0.22s ease;

  pointer-events: none;
}

/* =========================
   마우스를 올렸을 때
========================= */

.island-button:hover,
.island-button:focus-visible {
  z-index: 50;

  animation-play-state: paused;

  transform:
    translate(-50%, -50%)
    translateY(-16px)
    scale(1.1);

  filter:
    brightness(1.06)
    saturate(1.07);
}

.island-button:hover img,
.island-button:focus-visible img {
  filter:
    drop-shadow(
      0 33px 24px rgba(27, 76, 110, 0.35)
    );
}

.island-button:hover .country-label,
.island-button:focus-visible .country-label {
  opacity: 1;

  transform:
    translate(-50%, 0)
    scale(1);
}

/* 클릭하는 순간 */

.island-button:active {
  transform:
    translate(-50%, -50%)
    translateY(-5px)
    scale(0.97);

  transition-duration: 0.08s;
}

/* 키보드 선택 효과 */

.island-button:focus-visible {
  border-radius: 30px;

  outline: 4px solid rgba(255, 255, 255, 0.95);
  outline-offset: 7px;
}

/* =========================
   클릭 반짝임 효과
========================= */

.island-button::after {
  content: "";

  position: absolute;
  inset: 12%;

  border-radius: 50%;

  background:
    radial-gradient(
      circle,
      rgba(255, 255, 255, 0.75),
      rgba(255, 255, 255, 0)
    );

  opacity: 0;
  transform: scale(0.5);

  pointer-events: none;
}

.island-button.clicked::after {
  animation: click-flash 0.24s ease-out;
}

.island-button.clicked {
  transform:
    translate(-50%, -50%)
    scale(0.93);
}

/* =========================
   각 섬의 위치
========================= */

/* 왼쪽 위 */
:root {
  --island-size: clamp(240px, 23vw, 390px);
}
.island-usa {
  left: 17%;
  top: 38%;

  width: calc(var(--island-size) * 1.06);

  animation-delay: 0s;
}

/* 가운데 위 */

.island-switzerland {
  left: 33%;
  top: 75%;

  width: var(--island-size);

  animation-delay: -1.1s;
}

/* 오른쪽 위 */

.island-japan {
  left: 83%;
  top: 38%;

  width: calc(var(--island-size) * 1.03);

  animation-delay: -2.2s;
}

/* 왼쪽 아래 */

.island-korea {
  left: 50%;
  top: 40%;

  width: calc(var(--island-size) * 1.08);
}

/* 오른쪽 아래 */

.island-australia {
  left: 68%;
  top: 75%;

  width: calc(var(--island-size) * 1.0);

  animation-delay: -1.8s;
}

/* =========================
   둥둥 떠 있는 효과
========================= */

@keyframes floating {
  0%,
  100% {
    margin-top: 0;
  }

  50% {
    margin-top: -11px;
  }
}

/* 클릭 반짝임 */

@keyframes click-flash {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }

  45% {
    opacity: 0.75;
  }

  100% {
    opacity: 0;
    transform: scale(1.3);
  }
}

/* =========================
   태블릿
========================= */

@media (max-width: 1100px) {
  .main-screen {
    min-height: 760px;
  }

  .island-button {
    width: clamp(180px, 28vw, 290px);
  }

  .island-usa {
    left: 20%;
    top: 37%;
  }

  .island-switzerland {
    left: 50%;
    top: 31%;
  }

  .island-japan {
    left: 80%;
    top: 37%;
  }

  .island-korea {
    left: 32%;
    top: 70%;
  }

  .island-australia {
    left: 68%;
    top: 71%;
  }
}

/* =========================
   모바일
========================= */

@media (max-width: 700px) {
  body {
    overflow-y: auto;
  }

  .main-screen {
    height: auto;
    min-height: 100vh;

    background-position: center;
  }

  .main-title {
    position: relative;
    top: auto;
    left: auto;

    width: 100%;
    padding: 40px 20px 15px;

    transform: none;
  }

  .main-title h1 {
    font-size: 31px;
  }

  .main-title p {
    font-size: 15px;
  }

  .island-area {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 12px;

    width: min(100%, 650px);
    min-height: 780px;

    margin: 0 auto;
    padding: 5px 12px 80px;
  }

  .island-button {
    position: relative;

    top: auto;
    left: auto;

    align-self: center;

    width: 100%;
    max-width: 270px;

    margin: auto;

    transform: none;
  }

  .island-button:hover,
  .island-button:focus-visible {
    transform:
      translateY(-9px)
      scale(1.05);
  }

  .island-button:active {
    transform:
      translateY(-3px)
      scale(0.97);
  }

  .island-button.clicked {
    transform: scale(0.93);
  }

  .country-label {
    bottom: 0;

    opacity: 1;

    transform:
      translate(-50%, 0)
      scale(0.9);
  }

  .island-switzerland {
    grid-column: 2;
  }

  .island-japan {
    grid-column: 1;
  }

  .island-korea {
    grid-column: 2;
  }

  .island-australia {
    grid-column: 1 / -1;

    width: min(65vw, 300px);
  }
}

/* 움직임 최소화 설정 */

@media (prefers-reduced-motion: reduce) {
  .island-button {
    animation: none;

    transition-duration: 0.01ms;
  }
}


/* 휴대폰 전용 */
@media screen and (max-width: 600px) {

  .island-japan {
    left: 12%;
    top: 18%;
    width: 170px;
  }

  .island-usa {
    left: 6%;
    top: 23%;
    width: 173px;
  }

  .island-switzerland {
    left: -7%;
    top: 65%;
    width: 165px;
  }

  .island-korea {
    left: -4%;
    top: 66%;
    width: 184px;
  }

  .island-australia {
    left: -17%;
    top: 16%;
    width: 172px;
  }
}

body {
  margin: 0;
}

.main-screen {
  width: 100vw;
  height: 100vh;
  background: url("../images/sky.png") center / cover no-repeat;
}
.flight-loading {
  position: fixed;
  inset: 0;
  z-index: 99999;

  display: flex;
  align-items: flex-end;
  justify-content: center;

  padding-bottom: 90px;

  background:
    linear-gradient(
      to top,
      rgba(0, 0, 0, 0.5),
      rgba(0, 0, 0, 0.05) 50%,
      rgba(0, 0, 0, 0)
    ),
    url("../images/flight-loading.jpg") center / cover no-repeat;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition: opacity 0.35s ease;
}

.flight-loading.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.flight-text {
  margin: 0;

  color: white;
  font-family: Arial, sans-serif;
  font-size: clamp(25px, 3vw, 44px);
  font-weight: 700;

  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.8);

  animation: floatingText 1.6s ease-in-out infinite;
}

.loading-dots::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  text-align: left;

  animation: loadingDots 1.3s steps(4, end) infinite;
}

@keyframes floatingText {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-7px);
  }
}

@keyframes loadingDots {
  0% {
    content: "";
  }

  25% {
    content: ".";
  }

  50% {
    content: "..";
  }

  75%,
  100% {
    content: "...";
  }
}