/* landing.css - 游戏启动封面（马里奥式横版动背景 + 波普贴纸标题） */

:root {
  --ink: #1d1d1d;
  --paper: #ffffff;
  --miku: #39C5BB;
  --teto: #F0605A;
  --tianyi: #66CCFF;
  --star: #FFD93D;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  color: var(--ink);
  background: linear-gradient(180deg, #6FC3F0 0%, #A8DCF7 55%, #D9F1FF 100%);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ================= 动态背景层 ================= */
.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

/* 白云漂移 */
.cloud {
  position: absolute;
  background: #fff;
  border-radius: 999px;
  opacity: 0.95;
  animation: drift linear infinite;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 50%;
}

.cloud.c1 { top: 9%;  width: 84px; height: 26px; animation-duration: 46s; animation-delay: -8s; }
.cloud.c1::before { width: 34px; height: 34px; top: -16px; left: 14px; }
.cloud.c1::after  { width: 24px; height: 24px; top: -10px; left: 44px; }

.cloud.c2 { top: 21%; width: 64px; height: 20px; animation-duration: 34s; animation-delay: -20s; opacity: 0.85; }
.cloud.c2::before { width: 26px; height: 26px; top: -12px; left: 10px; }
.cloud.c2::after  { width: 18px; height: 18px; top: -8px; left: 34px; }

.cloud.c3 { top: 33%; width: 96px; height: 28px; animation-duration: 58s; animation-delay: -34s; opacity: 0.8; }
.cloud.c3::before { width: 38px; height: 38px; top: -18px; left: 16px; }
.cloud.c3::after  { width: 26px; height: 26px; top: -12px; left: 52px; }

.cloud.c4 { top: 4%;  width: 56px; height: 18px; animation-duration: 28s; animation-delay: -4s; opacity: 0.9; }
.cloud.c4::before { width: 22px; height: 22px; top: -10px; left: 10px; }
.cloud.c4::after  { width: 16px; height: 16px; top: -7px; left: 30px; }

@keyframes drift {
  from { transform: translateX(110vw); }
  to   { transform: translateX(-25vw); }
}

/* 天上飘过的收集物 */
.sky-item {
  position: absolute;
  font-size: 26px;
  filter: drop-shadow(2px 2px 0 rgba(29, 29, 29, 0.25));
  animation: drift linear infinite;
}

.sky-item > img {
  display: block;
  width: 36px;
  height: auto;
  animation: bob 1.6s ease-in-out infinite;
}

.sky-item.i1 { top: 15%; animation-duration: 15s; animation-delay: -3s; }
.sky-item.i2 { top: 29%; animation-duration: 19s; animation-delay: -11s; }
.sky-item.i3 { top: 42%; animation-duration: 13s; animation-delay: -7s; }
.sky-item.i4 { top: 22%; animation-duration: 23s; animation-delay: -16s; }
.sky-item.i5 { top: 49%; animation-duration: 17s; animation-delay: -1s; }
.sky-item.i6 { top: 36%; animation-duration: 21s; animation-delay: -13s; }

.sky-item.i2 > img { width: 30px; animation-delay: -0.4s; }
.sky-item.i3 > img { width: 34px; animation-delay: -0.9s; }
.sky-item.i4 > img { width: 28px; animation-delay: -1.2s; }
.sky-item.i5 > img { width: 32px; animation-delay: -0.6s; }
.sky-item.i6 > img { width: 30px; animation-delay: -1.6s; }

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-9px) rotate(6deg); }
}

/* 远景山丘 */
.hill {
  position: absolute;
  bottom: 78px;
  border: 4px solid var(--ink);
  border-bottom: none;
  border-radius: 50% 50% 0 0;
}

.hill.h1 { left: -40px;  width: 260px; height: 172px; background: var(--miku); }
.hill.h2 { left: 19%;    width: 180px; height: 116px; background: var(--tianyi); }
.hill.h3 { right: -30px; width: 230px; height: 152px; background: #2FA89E; }

/* 砖块地面 */
.ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 78px;
  background: #F2A65A;
  background-image:
    repeating-linear-gradient(0deg, rgba(29, 29, 29, 0.35) 0 3px, transparent 3px 28px),
    repeating-linear-gradient(90deg, rgba(29, 29, 29, 0.35) 0 3px, transparent 3px 54px);
  border-top: 4px solid var(--ink);
}

.ground::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  height: 8px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.35) 0 26px, transparent 26px 54px);
}

/* 行走的 Q 版小人 */
.char {
  position: absolute;
  bottom: 70px;
  left: 0;
  animation: walkAcross linear infinite;
}

.char .body-wrap {
  animation: stepBob 0.5s ease-in-out infinite;
}

.char .head {
  position: relative;
  width: 34px;
  height: 30px;
  margin: 0 auto;
  background: var(--c-soft);
  border: 3px solid var(--ink);
  border-radius: 50%;
  z-index: 1;
}

/* 双马尾 */
.char .head::before,
.char .head::after {
  content: "";
  position: absolute;
  top: -6px;
  width: 12px;
  height: 26px;
  background: var(--c);
  border: 3px solid var(--ink);
  border-radius: 50%;
}

.char .head::before { left: -12px; transform: rotate(-18deg); }
.char .head::after  { right: -12px; transform: rotate(18deg); }

.char .torso {
  width: 30px;
  height: 26px;
  margin: -3px auto 0;
  background: var(--c);
  border: 3px solid var(--ink);
  border-radius: 10px;
}

.char.k1 { --c: var(--miku);   --c-soft: #DDF7F4; animation-duration: 13s; animation-delay: -2s; }
.char.k2 { --c: var(--teto);   --c-soft: #FDE7E5; animation-duration: 17s; animation-delay: -9s; transform: scale(0.86); }
.char.k3 { --c: var(--tianyi); --c-soft: #E3F5FF; animation-duration: 21s; animation-delay: -14s; transform: scale(0.72); }

@keyframes walkAcross {
  from { transform: translateX(-80px); }
  to   { transform: translateX(105vw); }
}

@keyframes stepBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

/* ================= 前景内容 ================= */
.landing {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 1fr 78px; /* 底行与砖块地面同高，信息栏落在地面上 */
  width: 100%;
  height: 100%;
  min-height: 100svh;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 4vh;
}

/* 大标题：逐字弹跳 */
.game-title {
  display: inline-block;
  font-size: clamp(40px, 8.5vw, 62px);
  font-weight: 900;
  letter-spacing: 6px;
  color: #fff;
  transform: rotate(-2.5deg);
}

.game-title .ch {
  display: inline-block;
  animation: titleBounce 1.5s ease-in-out infinite;
  text-shadow:
    -3px -3px 0 var(--ink), 3px -3px 0 var(--ink),
    -3px 3px 0 var(--ink), 3px 3px 0 var(--ink),
    -3px 0 0 var(--ink), 3px 0 0 var(--ink),
    0 -3px 0 var(--ink), 0 3px 0 var(--ink),
    7px 7px 0 var(--miku);
}

.game-title .ch:nth-child(1) { animation-delay: 0s; }
.game-title .ch:nth-child(2) { animation-delay: 0.12s; }
.game-title .ch:nth-child(3) { animation-delay: 0.24s; }
.game-title .ch:nth-child(4) { animation-delay: 0.36s; }
.game-title .ch:nth-child(5) { animation-delay: 0.48s; }

.game-title .star {
  display: inline-block;
  font-size: 0.55em;
  color: var(--star);
  text-shadow: 2px 2px 0 var(--ink);
  vertical-align: super;
  animation: starWobble 1.2s ease-in-out infinite;
}

@keyframes titleBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-0.26em) rotate(2deg); }
}

@keyframes starWobble {
  0%, 100% { transform: rotate(-12deg) scale(1); }
  50%      { transform: rotate(12deg) scale(1.2); }
}

.game-subtitle {
  display: inline-block;
  margin-top: 14px;
  padding: 3px 18px;
  background: var(--ink);
  color: var(--star);
  font-size: clamp(11px, 1.6vw, 13px);
  font-weight: 900;
  letter-spacing: 7px;
  transform: rotate(-1deg);
}

/* 开始按钮 */
.start-button {
  display: inline-block;
  margin-top: clamp(20px, 5vh, 34px);
  padding: 13px 52px;
  background: var(--star);
  color: var(--ink);
  font-size: clamp(17px, 2.4vw, 21px);
  font-weight: 900;
  letter-spacing: 6px;
  text-indent: 6px;
  text-decoration: none;
  border: 4px solid var(--ink);
  border-radius: 999px;
  box-shadow: 5px 5px 0 var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  animation: btnPulse 1.4s ease-in-out infinite;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.start-button:hover,
.start-button:focus-visible {
  background: #ffe47a;
  outline: none;
}

.start-button:active {
  animation: none;
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--ink);
}

@keyframes btnPulse {
  0%, 100% { transform: scale(1); box-shadow: 5px 5px 0 var(--ink); }
  50%      { transform: scale(1.06); box-shadow: 7px 7px 0 var(--ink); }
}

/* ================= 底部信息栏（落在砖块地面上） ================= */
.credits {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 max(22px, env(safe-area-inset-right)) 0 max(22px, env(safe-area-inset-left));
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.version {
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 6px 18px;
  white-space: nowrap;
}

.producer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.producer p {
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 6px 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.producer strong {
  font-weight: 900;
}

.creator-actions {
  display: flex;
  gap: 8px;
}

.creator-actions button {
  min-height: 44px;
  padding: 8px 22px;
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink);
  font: inherit;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.creator-actions button:hover,
.creator-actions button:focus-visible {
  background: var(--star);
  outline: none;
}

.creator-actions button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

/* 前往主页：初音青；充电支持：Teto 红 */
.creator-actions .home-link:hover,
.creator-actions .home-link:focus-visible {
  background: var(--miku);
  color: #fff;
}

.creator-actions .support-link {
  background: #FFE3E1;
}

.creator-actions .support-link:hover,
.creator-actions .support-link:focus-visible {
  background: var(--teto);
  color: #fff;
}

/* 链接待配置提示 */
.link-status {
  position: absolute;
  right: 22px;
  bottom: calc(100% + 8px);
  padding: 6px 12px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translateY(5px);
}

.link-status.show {
  animation: statusNotice 1.8s ease both;
}

@keyframes statusNotice {
  0%, 100% { opacity: 0; transform: translateY(5px); }
  15%, 80% { opacity: 1; transform: translateY(0); }
}

/* ================= 响应式 ================= */
/* 矮屏横屏 */
@media (max-height: 520px) {
  .game-title {
    font-size: clamp(34px, 7vw, 46px);
  }

  .game-subtitle {
    margin-top: 8px;
  }

  .start-button {
    margin-top: 16px;
    padding: 10px 44px;
  }

  .hill.h1 { height: 112px; }
  .hill.h2 { height: 78px; }
  .hill.h3 { height: 98px; }
}

/* 竖屏 */
@media (orientation: portrait) {
  .landing {
    grid-template-rows: 1fr auto;
  }

  .credits {
    flex-wrap: wrap;
    justify-content: center;
    padding: 8px 16px;
    row-gap: 6px;
  }

  .producer {
    flex-wrap: wrap;
    justify-content: center;
  }

  .ground {
    height: 108px;
  }

  .hill {
    bottom: 108px;
  }

  .char {
    bottom: 104px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
  }
}
