.title {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(14px, 5.5dvh, 60px) 16px max(6px, env(safe-area-inset-bottom));
}

.title-head {
  text-align: center;
}

/* タイトルだけ背景にうっすら虹色を重ねる */
.page-title .page-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 80% 45% at 50% 22%, rgba(255, 255, 255, 0.22), transparent 70%),
    linear-gradient(160deg, rgba(255, 150, 200, 0.28), rgba(150, 200, 255, 0.24) 35%, rgba(160, 240, 180, 0.2) 60%, rgba(255, 220, 120, 0.22));
  mix-blend-mode: soft-light;
}

.page-title .page-bg::after {
  z-index: 2;
}

.logo {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(56px, min(25vw, 12.5dvh), 120px);
  line-height: 1.05;
  letter-spacing: 0.02em;
  background: var(--rainbow-text);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 3px 0 #7a5020)
    drop-shadow(0 3px 0 #3e2709)
    drop-shadow(0 8px 14px rgba(0, 0, 0, 0.4));
  animation: shimmer 8s linear infinite;
}

/*
 * ロゴの一文字の形に画像を透かす（虹色を上に重ねて、画像は控えめに）
 * --img-top / --img-h は Dela Gothic One の字形を実測した値（文字枠の上端から字の上端まで / 字の高さ）
 * --img-x は画像の左端の位置（字の中央）
 */
.logo-img {
  --veil: 0.22;
  background:
    linear-gradient(90deg,
      rgba(255, 224, 138, var(--veil)), rgba(255, 246, 196, var(--veil)), rgba(182, 245, 196, var(--veil)),
      rgba(166, 226, 255, var(--veil)), rgba(210, 194, 255, var(--veil)), rgba(255, 192, 226, var(--veil)),
      rgba(255, 224, 138, var(--veil))),
    var(--img),
    var(--rainbow-text);
  background-size: 200% 100%, auto var(--img-h), 200% 100%;
  background-position: 0% 0, var(--img-x) var(--img-top), 0% 0;
  background-repeat: repeat, no-repeat, repeat;
  /* 虹色を「スクリーン」で重ね、画像の濃い部分を明るく抜く */
  background-blend-mode: screen, normal, normal;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer-img 8s linear infinite;
}

/* 「天」に台座 */
.logo-ten {
  --img: url("../assets/images/objects/pedestal.png");
  --img-top: 0.42em;
  --img-h: 0.76em;
  --img-x: 0.5em;
}

/* 「井」にミスリル */
.logo-sei {
  --img: url("../assets/images/objects/mythril.png");
  --img-top: 0.40em;
  --img-h: 0.77em;
  --img-x: 0.48em;
}

@keyframes shimmer-img {
  from { background-position: 0% 0, var(--img-x) var(--img-top), 0% 0; }
  to { background-position: 200% 0, var(--img-x) var(--img-top), 200% 0; }
}

/* 「C天井」の下に「KEEPER」。両端を「C天井」の字の両端にそろえる */
.logo-box {
  display: inline-flex;
  flex-direction: column;
}

.logo-sub {
  display: flex;
  justify-content: space-between;
  /* 字の実際の端に合わせる微調整（「C」は枠の左端より内側、「井」は右端より内側に字がある） */
  padding: 0 0.1em 0 0.05em;
  margin-top: 0.06em;
  font-size: 0.4em;
  line-height: 1;
  letter-spacing: 0;
}

/*
 * 「KEEPER」の字の中をドクターモグが左から右へ横切る。
 * 透明な部分は下の虹色（.logo の背景）がそのまま見える。
 * 位置は em（この要素の文字サイズ基準）で指定：枠の幅は約 7.5em、画像の幅は約 0.75em。
 */
.logo-sub {
  background: url("../assets/images/objects/drmog.png") no-repeat;
  background-size: auto 1.3em;
  background-position: -1em 55%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: mog-walk 9s linear 1.5s infinite;
}

@keyframes mog-walk {
  0% { background-position: -1em 55%; }
  50% { background-position: 8.5em 55%; }
  100% { background-position: 8.5em 55%; }
}

@media (prefers-reduced-motion: reduce) {
  .logo-sub { animation: none; }
}

.title-lead {
  margin: clamp(6px, 1.6dvh, 14px) 0 0;
  color: var(--cream-dim);
  font-size: 14px;
  line-height: 1.9;
  letter-spacing: 0.08em;
}

.orb-line {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: clamp(8px, 2.2dvh, 20px);
}

.orb-line img {
  width: 26px;
  height: 26px;
}

/* ★9は円の直径を他と揃え、上下の飾りだけはみ出させる（130/150） */
.orb-line img.is-star9 {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  width: 30px;
  height: 30px;
  margin: -2px;
}

.title-menu {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4dvh, 12px);
  width: min(100%, 320px);
  margin-top: clamp(14px, 4.5dvh, 40px);
}

.name-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background:
    linear-gradient(rgba(30, 19, 8, 0.85), rgba(30, 19, 8, 0.85)) padding-box,
    var(--rainbow) border-box;
}

.name-field span {
  flex: none;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.name-field input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 16px;
  outline: none;
}

.name-field input::placeholder {
  color: rgba(217, 199, 163, 0.45);
}

.name-field:focus-within {
  box-shadow: 0 0 0 2px rgba(190, 170, 255, 0.35);
}

.btn-start {
  min-height: clamp(46px, 6.6dvh, 56px);
  font-size: 18px;
}

.title-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sound-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.toggle {
  min-width: 92px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(227, 180, 92, 0.4);
  border-radius: 999px;
  background: rgba(30, 19, 8, 0.6);
  color: var(--cream-dim);
  font-size: 13px;
  cursor: pointer;
}

.toggle b {
  display: inline-block;
  min-width: 2.4em;
  color: var(--gold);
}

.toggle[aria-pressed="false"] b {
  color: #8d7a5c;
}

.btn-back-fan {
  min-height: 40px;
  margin-top: clamp(8px, 2.4dvh, 20px);
  font-size: 14px;
  font-weight: 500;
  color: var(--cream-dim);
}

.title-foot {
  margin: auto 0 0;
  padding-top: clamp(4px, 3dvh, 32px);
  text-align: center;
}

/* 幅も高さも小さい端末（iPhone SE 初代など）向けに少しだけ詰める */
@media (max-width: 340px), (max-height: 580px) {
  .orb-line img {
    width: 22px;
    height: 22px;
  }

  .orb-line img.is-star9 {
    width: 25.4px;
    height: 25.4px;
  }

  .title-foot {
    font-size: 11px;
  }

  .logo {
    font-size: clamp(46px, min(22vw, 10dvh), 120px);
  }

  .title-lead {
    line-height: 1.6;
  }
}
