html,
body {
  margin: 0;
  background: #fff;
  /* どんぐりを払ったときに、引っぱって再読み込みなどが起きないように */
  overscroll-behavior: none;
}

.coming-soon {
  --ink: #0c305c;
  /*
   * 大きさの単位。画面の幅と高さの小さいほうに合わせて、すべての部品をいっしょに縮める
   * （縦 2：横 1 の画面で幅 1% と同じ。PC の大きな画面では 4.8px で止める）
   */
  --unit: min(1vw, 0.5svh, 4.8px);
  /* おびちゃんの足もとの、画面の下からの距離 */
  --obi-bottom: calc(34 * var(--unit) + env(safe-area-inset-bottom));

  box-sizing: border-box;
  position: relative;
  height: 100svh;
  overflow: hidden;
  /* 指の払いはすべてどんぐりに渡す（ページはスクロールしない） */
  touch-action: none;
  color: var(--ink);
  background: #fff;
  font-family: system-ui, -apple-system, 'Hiragino Sans', sans-serif;
}

/* ロゴは画面の上に合わせる */
.coming-soon__header {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding-top: max(calc(6 * var(--unit)), env(safe-area-inset-top));
}

/* ロゴはランプライトシアターのページへのリンク */
.coming-soon__logo-link {
  display: block;
  border-radius: 0.5rem;
  -webkit-tap-highlight-color: transparent;
}

.coming-soon__logo-link:focus-visible {
  outline: 3px solid #5a8fc0;
  outline-offset: 4px;
}

.coming-soon__logo {
  display: block;
  width: calc(62 * var(--unit));
  height: auto;
}

/* おびちゃん・鼻提灯・どんぐりの舞台。画面全体に広げ、枠は見せない */
.nose-bubble-game {
  position: absolute;
  inset: 0;
}

/* おびちゃんは画面の下から測って置く */
.nose-bubble-game__character {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: var(--obi-bottom);
  width: calc(40 * var(--unit));
  transform: translateX(-50%);
  animation: character-breathe 4.8s ease-in-out infinite;
}

.nose-bubble-game__character img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
}

/* 斜めの地面をやんわり感じさせる楕円の影（右が高い坂） */
.nose-bubble-game__shadow {
  position: absolute;
  left: 4%;
  right: -2%;
  bottom: 2%;
  height: 26%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(40 52 64 / 40%), rgb(40 52 64 / 20%) 55%, transparent);
  transform: rotate(-12deg);
}

.coming-soon__title {
  position: absolute;
  z-index: 1;
  bottom: calc(var(--obi-bottom) - 9 * var(--unit));
  left: calc(50% + 12 * var(--unit));
  margin: 0;
  color: var(--ink);
  font-size: max(10px, calc(3.2 * var(--unit)));
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1;
  white-space: nowrap;
  opacity: 0.72;
}

.coming-soon__dots span {
  opacity: 0.15;
  animation: coming-soon-dot 3.6s infinite;
}

.coming-soon__dots span:nth-child(2) {
  animation-delay: 0.45s;
}

.coming-soon__dots span:nth-child(3) {
  animation-delay: 0.9s;
}

.nose-bubble-game__acorns {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
}

/*
 * 鼻提灯。位置と大きさは game.js が毎フレーム決める。
 * 絵（nose_bubble.webp）の円は画像の幅の約 74%。割れた絵（nose_bubble_pop.webp）は同じ大きさ・同じ中心で描いてある
 */
.nose-bubble {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  /* タップできる大きさ（44px）より小さくしない */
  width: max(44px, calc(15 * var(--unit)));
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: url('nose_bubble.webp') center / contain no-repeat;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.nose-bubble.is-popping {
  background-image: url('nose_bubble_pop.webp');
  pointer-events: none;
}

.nose-bubble:focus-visible {
  outline: 3px solid #5a8fc0;
  outline-offset: 4px;
}

.acorn,
.acorn-shadow {
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 400ms ease-out;
}

.acorn {
  width: calc(4.4 * var(--unit));
  aspect-ratio: 1;
  background: url('acorn.webp') center / contain no-repeat;
}

.acorn-shadow {
  width: calc(4.2 * var(--unit));
  height: calc(1.3 * var(--unit));
  border-radius: 50%;
  background: rgb(40 52 64 / 30%);
}

.acorn.is-leaving,
.acorn-shadow.is-leaving {
  opacity: 0;
}

@keyframes character-breathe {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-0.18rem);
  }
}

@keyframes coming-soon-dot {
  0%,
  18%,
  100% {
    opacity: 0.15;
  }
  35%,
  68% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nose-bubble-game__character {
    animation: none;
  }

  .coming-soon__dots span {
    opacity: 1;
    animation: none;
  }
}
