* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --orange: #FF8A3D;
  --orange-deep: #F06A22;
  --orange-soft: #FFB35C;
  --gold: #FFD89A;
  --cream: #FFF6E8;
  --muted: rgba(255, 246, 232, 0.58);
  --faint: rgba(255, 246, 232, 0.36);
  --line: rgba(255, 206, 154, 0.17);
  --panel: rgba(31, 22, 49, 0.78);
  --aura: #FFB35C;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-display: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

html { background: #0D0917; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--cream);
  font-family: var(--font-ui);
  background: #0D0917;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

button, input { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
input { border: 0; outline: 0; }
img { display: block; }
[hidden] { display: none !important; }

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.mp-icon { flex: none; }

/* ---------- Sky ---------- */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 85% at 82% 4%, rgba(255, 138, 61, 0.34), transparent 55%),
    radial-gradient(110% 70% at 8% 0%, rgba(105, 73, 196, 0.30), transparent 58%),
    linear-gradient(180deg, #100C20 0%, #1C1431 36%, #2B1A3C 60%, #492537 80%, #75352B 100%);
  transition: filter 0.6s ease;
}
/* 境界越高，天幕染上的灵光不同 */
.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(72% 58% at 50% 40%, var(--aura), transparent 72%);
  opacity: 0.10;
  pointer-events: none;
  transition: background 0.8s ease;
}

/* 平台生成的成品仙山云海图：作为天幕底图，压暗虚化，避免截图里的按钮文字干扰操作 */
.world-photo {
  position: absolute;
  inset: -2%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.64;
  filter: blur(0.9px) saturate(0.98) brightness(0.86);
  transform: scale(1.03);
  transition: opacity 0.55s ease, filter 0.55s ease;
  /* 顶部让位给标题/HUD，底部淡入夜色；中间成品仙山完整露出 */
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 9%, #000 82%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 9%, #000 82%, transparent 100%);
}
.world-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
.world-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(58% 44% at 50% 42%, rgba(13, 9, 23, 0.10), rgba(13, 9, 23, 0.46) 64%, rgba(13, 9, 23, 0.82) 100%),
    linear-gradient(180deg, rgba(13, 9, 23, 0.74) 0%, rgba(13, 9, 23, 0.28) 38%, rgba(13, 9, 23, 0.68) 72%, #0D0917 100%);
}

/* 开始页：成品仙山图是主视觉，压暗程度更轻 */
body.in-start .world-photo {
  opacity: 0.92;
  filter: blur(0) saturate(1.02) brightness(0.96);
}
body.in-start .world-photo::after {
  background:
    radial-gradient(58% 44% at 50% 42%, rgba(13, 9, 23, 0.02), rgba(13, 9, 23, 0.30) 64%, rgba(13, 9, 23, 0.74) 100%),
    linear-gradient(180deg, rgba(13, 9, 23, 0.78) 0%, rgba(13, 9, 23, 0.18) 34%, rgba(13, 9, 23, 0.52) 70%, #0D0917 100%);
}
/* 开始页的画面交给成品图；只保留飞鹤与灵光，不叠简笔人物 */
.start-figure,
.start-mountains,
.start-palace,
.start-halo,
.start-ring,
.start-platform,
.start-mist { display: none; }

.sun-disc {
  position: absolute;
  top: 9%;
  right: 11%;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #FFF5D8 0%, #FFD58E 25%, #FF8A3D 62%, rgba(255, 138, 61, 0) 100%);
  filter: blur(1px);
  box-shadow: 0 0 80px 30px rgba(255, 138, 61, 0.20);
  animation: sunBreathe 8s ease-in-out infinite;
}

body.in-game .sun-disc,
body.in-end .sun-disc { display: none; }

.horizon-glow {
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: -22%;
  height: 62%;
  background: radial-gradient(ellipse at 50% 70%, rgba(255, 132, 63, 0.30), transparent 62%);
  filter: blur(10px);
}

.stars { position: absolute; inset: 0; }
.star {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #FFEACB;
  opacity: 0.5;
  animation: twinkle 3.4s ease-in-out infinite;
}

.sky-cloud {
  position: absolute;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 236, 216, 0.055);
  filter: blur(20px);
}
.cloud-a { width: 250px; left: -70px; top: 23%; animation: drift 34s ease-in-out infinite; }
.cloud-b { width: 190px; right: -60px; top: 37%; animation: drift 42s ease-in-out infinite reverse; }
.cloud-c { width: 300px; left: 20%; bottom: 24%; opacity: 0.7; animation: drift 50s ease-in-out infinite; }

/* ---------- Shared ---------- */
.screen {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

.glass {
  background: linear-gradient(180deg, rgba(41, 29, 62, 0.78), rgba(22, 16, 36, 0.86));
  border: 1px solid rgba(255, 199, 143, 0.16);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.12s ease, box-shadow 0.16s ease, filter 0.2s ease, opacity 0.2s ease;
}
.btn:active { transform: translateY(2px) scale(0.985); }
.btn:disabled { cursor: default; }

.btn-primary {
  min-height: 58px;
  padding: 0 20px;
  border-radius: 20px;
  color: #331707;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, #FFC572 0%, #FF8A3D 55%, #F06A22 100%);
  border: 1px solid rgba(255, 230, 190, 0.82);
  box-shadow: 0 5px 0 #A34713, 0 12px 26px rgba(255, 122, 47, 0.28), inset 0 1px 0 rgba(255, 244, 214, 0.9);
}
.btn-primary:active {
  box-shadow: 0 2px 0 #A34713, 0 7px 16px rgba(255, 122, 47, 0.22), inset 0 1px 0 rgba(255, 244, 214, 0.9);
}
.btn-primary .mp-icon { width: 22px; height: 22px; }

.btn-hero {
  width: 100%;
  max-width: 360px;
  height: 60px;
  gap: 10px;
  font-size: 16.5px;
}
.btn-hero .mp-icon:last-child { opacity: 0.65; }

.btn-ghost {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 206, 154, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 246, 232, 0.72);
  font-size: 13px;
  letter-spacing: 0.08em;
}
.btn-ghost:active { background: rgba(255, 255, 255, 0.08); }

.link-btn {
  font-size: 11.5px;
  color: rgba(255, 246, 232, 0.42);
  letter-spacing: 0.12em;
  padding: 5px 8px;
  border-bottom: 1px solid rgba(255, 246, 232, 0.18);
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #FFD8A6;
  border: 1px solid rgba(255, 206, 154, 0.20);
  background: rgba(24, 17, 38, 0.44);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: transform 0.12s ease, background 0.2s ease;
}
.icon-btn .mp-icon { width: 18px; height: 18px; }
.icon-btn:active { transform: scale(0.92); background: rgba(255, 255, 255, 0.09); }

.icon-mini {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: rgba(255, 232, 204, 0.48);
}
.icon-mini .mp-icon { width: 15px; height: 15px; }
.icon-mini:active { color: #FFD8A6; background: rgba(255, 255, 255, 0.07); }

/* ---------- Start screen ---------- */
.start-screen {
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
  padding: calc(16px + var(--safe-top)) 24px calc(20px + var(--safe-bottom));
  overflow-x: hidden;
  overflow-y: auto;
}

.start-top {
  flex: 0 0 auto;
  padding-top: 5.2vh;
  text-align: center;
  opacity: 0;
  animation: introUp 0.9s 0.08s ease-out forwards;
}

.seal-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 199, 143, 0.52);
  color: #FFE1B7;
  font-family: var(--font-display);
  font-size: 21px;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 215, 166, 0.25), transparent 58%),
    rgba(255, 138, 61, 0.10);
  box-shadow: 0 0 0 5px rgba(255, 138, 61, 0.045), 0 0 28px rgba(255, 138, 61, 0.28), inset 0 0 18px rgba(255, 138, 61, 0.14);
  position: relative;
}
.seal-mark::before,
.seal-mark::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 199, 143, 0.18);
}
.seal-mark::before { inset: 5px; }
.seal-mark::after { inset: -7px; border-style: dashed; opacity: 0.6; }

.start-kicker {
  margin: 0 0 10px;
  font-size: 10.5px;
  letter-spacing: 0.42em;
  color: #F5C28B;
  text-indent: 0.42em;
}

.start-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(46px, 14.6vw, 64px);
  line-height: 1.04;
  letter-spacing: 0.055em;
  font-weight: 800;
  color: #FFEDCF;
  background: linear-gradient(180deg, #FFF9EE 4%, #FFE6BE 40%, #FFB45D 78%, #FF8A3D 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 24px rgba(255, 138, 61, 0.24));
}

.start-sub {
  margin: 14px 0 0;
  font-size: 12.5px;
  line-height: 1.9;
  letter-spacing: 0.12em;
  color: rgba(255, 244, 226, 0.58);
}

.start-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 245px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  animation: introUp 1s 0.28s ease-out forwards;
}

.start-halo {
  position: absolute;
  left: 50%;
  bottom: 26px;
  width: min(330px, 90vw);
  height: min(330px, 90vw);
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 160, 80, 0.23) 0%, rgba(255, 138, 61, 0.07) 42%, transparent 68%);
  animation: breathe 5s ease-in-out infinite;
}

.start-ring {
  position: absolute;
  left: 50%;
  bottom: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 196, 130, 0.15);
  transform: translateX(-50%);
}
.start-ring.ring-one {
  width: min(270px, 72vw);
  height: min(270px, 72vw);
  border-style: dashed;
  animation: spinCenter 56s linear infinite;
}
.start-ring.ring-two {
  width: min(215px, 60vw);
  height: min(215px, 60vw);
  animation: spinCenter 38s linear infinite reverse;
  border-color: rgba(255, 196, 130, 0.1);
}

.start-platform {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 34px;
  width: min(200px, 56vw);
  height: 38px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 36%, rgba(255, 207, 151, 0.38), rgba(92, 54, 92, 0.42) 46%, rgba(20, 12, 32, 0) 73%);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.32), 0 0 26px rgba(255, 138, 61, 0.16);
}

.start-figure {
  position: relative;
  z-index: 3;
  width: min(188px, 48vw);
  height: auto;
  margin-bottom: 48px;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.42)) drop-shadow(0 0 18px rgba(255, 138, 61, 0.12));
  animation: floatFigure 5.4s ease-in-out infinite;
}

.start-mountains {
  position: absolute;
  z-index: 1;
  left: -24px;
  right: -24px;
  bottom: -14px;
  width: calc(100% + 48px);
  height: 62%;
  opacity: 0.78;
}

.start-palace {
  position: absolute;
  z-index: 1;
  left: -3%;
  top: -2%;
  width: min(122px, 32vw);
  height: auto;
  opacity: 0.42;
  pointer-events: none;
  animation: isleFloat 12s ease-in-out infinite;
}

/* 飞鹤与远景：让天幕有活气 */
.crane-layer {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.crane {
  position: absolute;
  left: -20%;
  height: auto;
  opacity: 0.5;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.22));
}
.crane-1 { top: 24%; width: 44px; animation: craneGlide 21s linear infinite; }
.crane-2 { top: 37%; width: 31px; opacity: 0.34; animation: craneGlide 27s linear 5s infinite; }
.crane-3 { top: 16%; width: 23px; opacity: 0.28; animation: craneGlide 33s linear 11s infinite; }
.start-cranes .crane-1 { top: 30%; }
.start-cranes .crane-2 { top: 48%; }

.start-mist {
  position: absolute;
  z-index: 2;
  left: -10%;
  right: -10%;
  bottom: -10px;
  height: 40%;
  background: linear-gradient(180deg, transparent, rgba(13, 9, 24, 0.74) 65%, #0D0917 100%);
  pointer-events: none;
}

.start-mote {
  position: absolute;
  z-index: 4;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #FFD08A;
  box-shadow: 0 0 10px 3px rgba(255, 138, 61, 0.5);
  opacity: 0;
  animation: moteUp 4.4s ease-out infinite;
}
.start-mote.m1 { left: 36%; bottom: 26%; animation-delay: 0.4s; }
.start-mote.m2 { left: 62%; bottom: 32%; animation-delay: 1.8s; width: 4px; height: 4px; }
.start-mote.m3 { left: 51%; bottom: 20%; animation-delay: 3.1s; width: 3px; height: 3px; }

.start-bottom {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  opacity: 0;
  animation: introUp 0.9s 0.5s ease-out forwards;
}

.start-record {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  margin-bottom: 2px;
  border-radius: 999px;
  border: 1px solid rgba(255, 206, 154, 0.20);
  background: rgba(24, 17, 38, 0.46);
  color: #FFD5A2;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.start-record .mp-icon { width: 13px; height: 13px; color: #FFB35C; }

.start-features {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 0 3px;
}
.start-features span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 206, 154, 0.14);
  background: rgba(24, 17, 38, 0.38);
  color: rgba(255, 246, 232, 0.52);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.start-features .mp-icon { width: 12px; height: 12px; color: #FFB35C; }

.start-note {
  margin: 2px 0 0;
  text-align: center;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: rgba(255, 246, 232, 0.38);
}

/* ---------- Game screen ---------- */
.game-screen {
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(8px + var(--safe-top)) 16px calc(10px + var(--safe-bottom));
}

.hud {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 0;
}

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

.avatar {
  position: relative;
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 199, 143, 0.66);
  background:
    radial-gradient(circle at 36% 30%, rgba(255, 226, 180, 0.32), transparent 56%),
    linear-gradient(145deg, #5B3A60, #2A1C40);
  box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.09), 0 7px 18px rgba(0, 0, 0, 0.34);
  color: #FFE1B5;
  font-family: var(--font-display);
  font-size: 18px;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.identity-text { min-width: 0; }
.name-row {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.15;
  white-space: nowrap;
}
.name-row > span { overflow: hidden; text-overflow: ellipsis; max-width: 158px; }
.realm-line {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-size: 10.5px;
  letter-spacing: 0.09em;
  color: #FFC58E;
  white-space: nowrap;
}
.realm-dot {
  width: 5px;
  height: 5px;
  flex: none;
  transform: rotate(45deg);
  background: var(--aura);
  box-shadow: 0 0 7px rgba(255, 179, 92, 0.9);
}
.realm-sep { opacity: 0.38; }

.hud-side { display: flex; align-items: center; gap: 8px; flex: none; }
.time-pill {
  height: 28px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 206, 154, 0.16);
  background: rgba(24, 17, 38, 0.42);
  color: rgba(255, 246, 232, 0.58);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.time-pill .mp-icon { width: 13px; height: 13px; color: #FFC58E; }

/* Realm track */
.realm-track {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 18px;
  margin: 9px 4px 2px;
  padding: 0 5px;
}
.realm-track::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 246, 232, 0.10);
  transform: translateY(-50%);
}
.realm-track::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  height: 2px;
  width: var(--track, 0%);
  max-width: calc(100% - 20px);
  border-radius: 2px;
  background: linear-gradient(90deg, #FF8A3D, #FFD89A);
  box-shadow: 0 0 9px rgba(255, 138, 61, 0.55);
  transform: translateY(-50%);
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.track-node {
  position: relative;
  z-index: 1;
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 3px;
  transform: rotate(45deg);
  background: #3A2A51;
  border: 1px solid rgba(255, 246, 232, 0.18);
  transition: all 0.4s ease;
}
.track-node.done {
  background: linear-gradient(135deg, #FFD89A, #FF8A3D);
  border-color: rgba(255, 225, 183, 0.8);
  box-shadow: 0 0 7px rgba(255, 138, 61, 0.5);
}
.track-node.current {
  width: 13px;
  height: 13px;
  background: #FFD89A;
  border-color: #FFF2D7;
  box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.16), 0 0 13px rgba(255, 138, 61, 0.85);
  animation: nodePulse 2.2s ease-in-out infinite;
}
.track-node.final { border-radius: 50%; }

/* Scene */
.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 292px;
  margin: 2px -16px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
  border-radius: 0 0 30px 30px;
  background: linear-gradient(180deg, rgba(12, 8, 22, 0) 0%, rgba(12, 8, 22, 0.10) 55%, rgba(12, 8, 22, 0.50) 100%);
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}
.stage:active { filter: brightness(1.03); }

.stage-glow {
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: 96%;
  height: 78%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 62%, rgba(255, 148, 77, 0.20), rgba(139, 89, 175, 0.10) 42%, transparent 70%);
  pointer-events: none;
}
.stage-sun {
  position: absolute;
  top: 11%;
  right: 7%;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, #FFF3D4, #FFC375 38%, #FF8A3D 64%, rgba(255, 138, 61, 0) 100%);
  filter: blur(0.5px);
  box-shadow: 0 0 48px 16px rgba(255, 138, 61, 0.18);
  opacity: 0.82;
  pointer-events: none;
}

.stage-cloud {
  position: absolute;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 241, 226, 0.075);
  filter: blur(7px);
  pointer-events: none;
}
.cloud-1 { width: 150px; left: -34px; top: 33%; animation: drift 26s ease-in-out infinite; }
.cloud-2 { width: 120px; right: -30px; top: 48%; opacity: 0.75; animation: drift 32s ease-in-out infinite reverse; }
.cloud-3 { width: 180px; left: 22%; bottom: 19%; opacity: 0.55; animation: drift 38s ease-in-out infinite; }

.scene-mountains {
  position: absolute;
  z-index: 0;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 58%;
  pointer-events: none;
}
.scene-palace {
  position: absolute;
  z-index: 0;
  left: -7%;
  top: 4%;
  width: min(160px, 42vw);
  height: auto;
  opacity: 0.72;
  pointer-events: none;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.24));
  animation: isleFloat 11s ease-in-out infinite;
}
.scene-mist {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34%;
  background: linear-gradient(180deg, transparent, rgba(12, 8, 22, 0.68) 68%, rgba(12, 8, 22, 0.92));
  pointer-events: none;
}

.character-wrap {
  position: relative;
  z-index: 3;
  width: min(246px, 66vw);
  aspect-ratio: 1 / 1.06;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-top: 16px;
  transform: translateY(1%);
}

.aura-glow {
  position: absolute;
  left: 50%;
  bottom: 8%;
  width: 112%;
  height: 90%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 58%, rgba(255, 147, 73, 0.30), rgba(255, 138, 61, 0.07) 45%, transparent 70%);
  filter: blur(6px);
  animation: breathe 4.6s ease-in-out infinite;
  pointer-events: none;
}

.aura-ring {
  --p: 0;
  position: absolute;
  left: 50%;
  top: 5%;
  width: 86%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: conic-gradient(from -90deg, var(--aura) 0 var(--deg, 0deg), rgba(255, 246, 232, 0.10) var(--deg, 0deg) 1turn);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  filter: drop-shadow(0 0 9px rgba(255, 138, 61, 0.58));
  opacity: 0.92;
  pointer-events: none;
  transition: background 0.3s linear;
}
.aura-ring::before {
  content: "";
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  border: 1px dashed rgba(255, 210, 158, 0.14);
}

.rune-ring {
  position: absolute;
  left: 50%;
  top: 8%;
  width: 100%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  animation: spinCenter 68s linear infinite;
  opacity: 0.6;
  pointer-events: none;
}
.rune-ring span {
  position: absolute;
  left: 50%;
  top: 50%;
  font-family: var(--font-display);
  font-size: 9px;
  color: rgba(255, 210, 158, 0.62);
  transform: translate(-50%, -50%) rotate(var(--a)) translateY(-106px) rotate(calc(0deg - var(--a)));
  text-shadow: 0 0 7px rgba(255, 138, 61, 0.55);
}

.platform {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 5.5%;
  width: 74%;
  height: 15%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 32%, rgba(255, 207, 151, 0.34), rgba(104, 61, 107, 0.48) 44%, rgba(22, 13, 34, 0) 73%);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.34), 0 0 28px rgba(255, 138, 61, 0.16);
}
.platform::before,
.platform::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  border: 1px solid rgba(255, 196, 130, 0.19);
  transform: translate(-50%, -50%);
}
.platform::before { width: 76%; height: 60%; }
.platform::after { width: 48%; height: 38%; border-style: dashed; opacity: 0.8; }

.cultivator {
  position: relative;
  z-index: 2;
  width: 71%;
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.38)) drop-shadow(0 0 16px rgba(255, 160, 80, 0.10));
  transform-origin: 50% 92%;
  animation: breatheFigure 5s ease-in-out infinite;
}
.character-wrap.tapped .cultivator { animation: tapPulse 0.24s ease-out; }
.stage.breaking .aura-ring { animation: ringBurst 0.8s ease-out infinite; }

.float-layer {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  overflow: hidden;
}

.status-pill {
  position: absolute;
  z-index: 6;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 206, 154, 0.14);
  background: rgba(20, 13, 30, 0.50);
  color: rgba(255, 230, 200, 0.72);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  white-space: nowrap;
  pointer-events: none;
}
.pulse-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--aura);
  box-shadow: 0 0 7px var(--aura);
  animation: pulseDot 1.6s ease-in-out infinite;
}

.tap-hint {
  position: absolute;
  z-index: 7;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 206, 154, 0.12);
  background: rgba(20, 13, 30, 0.42);
  color: rgba(255, 235, 208, 0.48);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
  white-space: nowrap;
}
.tap-hint .mp-icon { width: 13px; height: 13px; }
.tap-hint.hide { opacity: 0; transform: translate(-50%, 6px); }

.break-banner {
  position: absolute;
  z-index: 20;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 92%;
  pointer-events: none;
  animation: bannerIn 2s ease-out forwards;
}
.break-banner .banner-line {
  width: 46px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 216, 154, 0.9), transparent);
}
.break-banner b {
  font-family: var(--font-display);
  font-size: 27px;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  color: #FFEBC8;
  text-shadow: 0 2px 12px rgba(255, 138, 61, 0.7), 0 0 28px rgba(255, 138, 61, 0.5);
}
.break-banner small {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #FFC98F;
}
.break-banner.fail b { color: #FFD0C8; text-shadow: 0 2px 12px rgba(214, 66, 54, 0.65); }
.break-banner.fail small { color: rgba(255, 190, 178, 0.8); }

/* Cultivation panel */
.cultivation-panel {
  flex: 0 0 auto;
  position: relative;
  padding: 13px 15px 11px;
  border-radius: 21px;
  overflow: hidden;
}
.cultivation-panel::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 220, 175, 0.45), transparent);
}
.cult-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.cult-label-wrap { display: flex; align-items: center; min-width: 0; }
.cult-label {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.16em;
  color: #FFD8A6;
}
.cult-state {
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 138, 61, 0.26);
  background: rgba(255, 138, 61, 0.12);
  color: #FFB77A;
  font-size: 9px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.cult-state.full {
  border-color: rgba(255, 216, 154, 0.46);
  background: rgba(255, 216, 154, 0.16);
  color: #FFE4B6;
  animation: statePulse 1.8s ease-in-out infinite;
}
.cult-num {
  font-size: 10.5px;
  color: rgba(255, 246, 232, 0.42);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.cult-num b {
  font-size: 20px;
  font-weight: 800;
  color: #FFF3DF;
  margin-right: 2px;
  text-shadow: 0 0 14px rgba(255, 138, 61, 0.24);
}

.cult-bar {
  position: relative;
  height: 9px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(255, 246, 232, 0.08);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.34);
  overflow: hidden;
}
.cult-fill {
  position: relative;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #FF7A2F, #FF9F4A 46%, #FFD89A 100%);
  box-shadow: 0 0 12px rgba(255, 138, 61, 0.62);
  transition: width 0.15s linear;
  overflow: hidden;
}
.cult-fill .bar-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 18%, rgba(255, 255, 255, 0.48) 47%, transparent 72%);
  transform: translateX(-110%);
  animation: shine 2.6s ease-in-out infinite;
}
.cult-bar.full .cult-fill {
  background: linear-gradient(90deg, #FFB35C, #FFE4B6 55%, #FFF7E4 100%);
  box-shadow: 0 0 16px rgba(255, 216, 154, 0.9);
  animation: fullBar 1.6s ease-in-out infinite;
}
.cult-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 15px;
  margin-top: 6px;
  font-size: 10px;
  color: rgba(255, 246, 232, 0.38);
  letter-spacing: 0.03em;
}
.cult-foot > span:first-child {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.boost-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #FFD08A;
  white-space: nowrap;
}
.boost-tag .mp-icon { width: 12px; height: 12px; }
.boost-tag b { font-variant-numeric: tabular-nums; }

.mini-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 246, 232, 0.07);
  font-size: 9.5px;
  color: rgba(255, 246, 232, 0.36);
  letter-spacing: 0.01em;
}
.mini-stats span { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.mini-stats .mp-icon { width: 11px; height: 11px; color: rgba(255, 179, 92, 0.7); }
.mini-stats b { color: #FFD8A6; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Actions */
.actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 9px;
}

.btn-break {
  width: 100%;
  height: 58px;
  padding: 0 14px;
  gap: 12px;
  justify-content: flex-start;
  border-radius: 19px;
  overflow: hidden;
  color: #2C1405;
  border: 1px solid rgba(255, 230, 190, 0.75);
  background: linear-gradient(135deg, #FFC572 0%, #FF8A3D 56%, #F06A22 100%);
  box-shadow: 0 5px 0 #A34713, 0 11px 24px rgba(255, 122, 47, 0.26), inset 0 1px 0 rgba(255, 244, 214, 0.85);
}
.btn-break:disabled {
  color: rgba(255, 246, 232, 0.40);
  border-color: rgba(255, 206, 154, 0.12);
  background: linear-gradient(135deg, rgba(72, 53, 96, 0.72), rgba(40, 29, 60, 0.86));
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.btn-break:not(:disabled):active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #A34713, 0 7px 16px rgba(255, 122, 47, 0.22), inset 0 1px 0 rgba(255, 244, 214, 0.85);
}
.btn-break > .mp-icon { width: 25px; height: 25px; z-index: 1; }
.btn-break.ready { animation: readyGlow 2s ease-in-out infinite; }
.btn-break.ready .break-aura {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 246, 214, 0.36), transparent 58%);
  animation: pulseAura 1.8s ease-in-out infinite;
  pointer-events: none;
}
.break-aura { display: none; }
.btn-break.ready .break-aura { display: block; }
.break-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  line-height: 1.16;
  min-width: 0;
}
.break-text b { font-size: 16.5px; letter-spacing: 0.10em; }
.break-text small { margin-top: 4px; font-size: 9.5px; opacity: 0.66; letter-spacing: 0.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.break-chance {
  position: relative;
  z-index: 1;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.08;
  padding: 5px 9px;
  border-radius: 10px;
  background: rgba(66, 28, 8, 0.16);
  border: 1px solid rgba(93, 41, 12, 0.28);
}
.break-chance b { font-size: 14px; }
.break-chance small { font-size: 7.5px; opacity: 0.62; letter-spacing: 0.06em; }
.btn-break:disabled .break-chance { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.08); }

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.btn-tap,
.btn-ad {
  height: 56px;
  padding: 0 12px;
  gap: 9px;
  justify-content: flex-start;
  border-radius: 18px;
  text-align: left;
}
.btn-tap {
  color: #FFEFD8;
  border: 1px solid rgba(255, 206, 154, 0.20);
  background: linear-gradient(180deg, rgba(44, 31, 66, 0.82), rgba(25, 18, 40, 0.9));
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.btn-tap > .mp-icon { color: #FFB35C; width: 23px; height: 23px; }
.btn-tap:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.btn-ad {
  color: #3A1B05;
  border: 1px solid rgba(255, 230, 190, 0.78);
  background: linear-gradient(135deg, #FFDD92 0%, #FFBE63 50%, #FFA044 100%);
  box-shadow: 0 4px 0 #A55C17, 0 9px 18px rgba(255, 138, 61, 0.18), inset 0 1px 0 rgba(255, 249, 230, 0.8);
}
.btn-ad > .mp-icon { width: 23px; height: 23px; }
.btn-ad:active { transform: translateY(2px); box-shadow: 0 2px 0 #A55C17, 0 5px 12px rgba(255, 138, 61, 0.16), inset 0 1px 0 rgba(255, 249, 230, 0.8); }
.btn-ad:disabled {
  color: rgba(255, 246, 232, 0.46);
  border-color: rgba(255, 206, 154, 0.16);
  background: linear-gradient(135deg, rgba(74, 53, 100, 0.68), rgba(41, 29, 61, 0.86));
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.btn-ad:disabled > .mp-icon { color: #FFB35C; }
.action-text {
  display: flex;
  flex-direction: column;
  line-height: 1.16;
  min-width: 0;
}
.action-text b { font-size: 13px; letter-spacing: 0.04em; white-space: nowrap; }
.action-text small {
  margin-top: 3px;
  font-size: 9px;
  opacity: 0.62;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- End screen ---------- */
.end-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 520px;
  margin: 0 auto;
  padding: calc(24px + var(--safe-top)) 22px calc(22px + var(--safe-bottom));
  overflow-x: hidden;
}
.end-sky { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.end-beam {
  position: absolute;
  left: 50%;
  top: -16%;
  width: 110px;
  height: 82%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255, 238, 199, 0.0), rgba(255, 214, 150, 0.26) 42%, rgba(255, 138, 61, 0.05));
  filter: blur(18px);
  clip-path: polygon(36% 0, 64% 0, 100% 100%, 0% 100%);
}
.portal {
  position: absolute;
  left: 50%;
  top: 7%;
  width: min(330px, 86vw);
  height: min(330px, 86vw);
  transform: translateX(-50%);
  border-radius: 50%;
}
.portal-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 206, 154, 0.22);
}
.portal-ring.r1 { inset: 0; border-style: dashed; animation: spin 46s linear infinite; }
.portal-ring.r2 { inset: 8%; border-color: rgba(255, 206, 154, 0.14); animation: spin 32s linear infinite reverse; }
.portal-ring.r3 { inset: 18%; border-color: rgba(255, 226, 180, 0.34); box-shadow: 0 0 28px rgba(255, 138, 61, 0.16); }
.portal-core {
  position: absolute;
  inset: 27%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, rgba(255, 248, 222, 0.65), rgba(255, 191, 106, 0.28) 34%, rgba(255, 138, 61, 0.06) 62%, transparent 74%);
  filter: blur(2px);
  animation: portalBreathe 4s ease-in-out infinite;
}
.end-mist {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -8%;
  height: 46%;
  background: linear-gradient(180deg, transparent, rgba(13, 9, 24, 0.74) 64%, #0D0917 100%);
}
.end-content {
  position: relative;
  z-index: 3;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: min(20vh, 160px);
  text-align: center;
  animation: introUp 0.8s ease-out both;
}
.end-kicker {
  margin: 0;
  font-size: 10.5px;
  letter-spacing: 0.48em;
  text-indent: 0.48em;
  color: #F5C28B;
}
.end-title {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(42px, 13vw, 58px);
  line-height: 1.1;
  letter-spacing: 0.1em;
  text-indent: 0.1em;
  font-weight: 800;
  color: #FFF1D2;
  background: linear-gradient(180deg, #FFFDF6 6%, #FFE7BC 42%, #FFB45D 82%, #FF8A3D 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 26px rgba(255, 138, 61, 0.3));
}
.end-sub {
  margin: 11px 0 0;
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: 0.08em;
  color: rgba(255, 246, 232, 0.55);
}
.end-card {
  width: 100%;
  margin: 22px 0 16px;
  padding: 15px 16px 13px;
  border-radius: 22px;
  text-align: left;
}
.end-realm {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(255, 206, 154, 0.12);
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.18em;
  color: #FFE2AE;
}
.end-realm .mp-icon { width: 18px; height: 18px; color: #FFB35C; }
.end-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 11px 0 4px;
}
.end-stat {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 246, 232, 0.035);
  border: 1px solid rgba(255, 246, 232, 0.05);
}
.end-stat span { display: block; font-size: 9px; color: rgba(255, 246, 232, 0.38); letter-spacing: 0.05em; }
.end-stat b { display: block; margin-top: 3px; font-size: 13.5px; color: #FFD8A6; font-variant-numeric: tabular-nums; }
.end-best {
  padding-top: 9px;
  margin-top: 4px;
  border-top: 1px solid rgba(255, 206, 154, 0.10);
  text-align: center;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: rgba(255, 246, 232, 0.38);
}
.end-screen .btn-hero { margin-bottom: 9px; }

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  touch-action: none;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(7, 4, 14, 0.72);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  animation: fadeIn 0.25s ease-out;
}
.modal-card {
  position: relative;
  width: min(360px, 100%);
  padding: 26px 22px 22px;
  border-radius: 26px;
  text-align: center;
  background: linear-gradient(180deg, rgba(46, 33, 69, 0.98), rgba(24, 17, 38, 0.99));
  border: 1px solid rgba(255, 199, 143, 0.24);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: modalIn 0.38s cubic-bezier(0.2, 0.85, 0.25, 1);
  overflow: hidden;
}
.modal-card::before {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  top: -40px;
  height: 90px;
  background: radial-gradient(ellipse at 50% 40%, rgba(255, 138, 61, 0.30), transparent 66%);
  pointer-events: none;
}
.modal-orb {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 199, 143, 0.38);
  background: radial-gradient(circle at 36% 30%, rgba(255, 225, 180, 0.28), rgba(255, 138, 61, 0.08) 58%, transparent 70%);
  box-shadow: 0 0 0 7px rgba(255, 138, 61, 0.045), 0 0 28px rgba(255, 138, 61, 0.24);
  color: #FFD8A6;
}
.modal-orb .mp-icon { width: 28px; height: 28px; }
.modal-kicker {
  margin: 15px 0 5px;
  font-size: 9.5px;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  color: #FFB77A;
}
.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.12em;
  color: #FFEFD4;
}
.modal-desc {
  margin: 10px 0 16px;
  font-size: 12.5px;
  line-height: 1.82;
  letter-spacing: 0.03em;
  color: rgba(255, 246, 232, 0.53);
}
.modal-desc b { color: #FFD8A6; font-weight: 700; }
.reward-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  border-radius: 16px;
  border: 1px dashed rgba(255, 206, 154, 0.28);
  background: rgba(255, 138, 61, 0.07);
}
.reward-box span { font-size: 11px; color: rgba(255, 246, 232, 0.48); letter-spacing: 0.06em; }
.reward-box b {
  font-size: 24px;
  color: #FFD08A;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(255, 138, 61, 0.4);
}
.modal-note {
  margin: 8px 0 17px;
  font-size: 9.5px;
  color: rgba(255, 246, 232, 0.32);
  letter-spacing: 0.04em;
}
.offline-card .btn-primary { width: 100%; }
.name-card { text-align: left; }
.name-card .modal-kicker,
.name-card .modal-title,
.name-card .modal-desc { text-align: center; }
.name-input {
  width: 100%;
  height: 48px;
  margin-top: 4px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 206, 154, 0.20);
  background: rgba(10, 7, 18, 0.46);
  color: #FFF0D8;
  font-size: 16px;
  letter-spacing: 0.16em;
  text-align: center;
}
.name-input::placeholder { color: rgba(255, 246, 232, 0.24); letter-spacing: 0.08em; }
.name-input:focus { border-color: rgba(255, 138, 61, 0.62); box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.10); }
.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
.modal-actions .btn { width: 100%; }
.confirm-card { max-width: 336px; }

/* ---------- Ad fallback overlay ---------- */
.ad-overlay {
  position: fixed;
  touch-action: none;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(90% 60% at 50% 22%, rgba(255, 148, 74, 0.24), transparent 62%),
    radial-gradient(80% 60% at 20% 90%, rgba(105, 73, 196, 0.28), transparent 60%),
    linear-gradient(180deg, #07040E 0%, #140C24 56%, #2A1526 100%);
  animation: fadeIn 0.3s ease-out;
  overflow: hidden;
}
.ad-sky { position: absolute; inset: 0; pointer-events: none; }
.ad-star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #FFE9C8;
  box-shadow: 0 0 8px 2px rgba(255, 200, 130, 0.4);
  animation: twinkle 3s ease-in-out infinite;
}
.ad-star.s1 { left: 18%; top: 18%; }
.ad-star.s2 { left: 78%; top: 12%; animation-delay: 0.7s; }
.ad-star.s3 { left: 30%; top: 42%; animation-delay: 1.2s; }
.ad-star.s4 { left: 84%; top: 48%; animation-delay: 0.3s; }
.ad-star.s5 { left: 12%; top: 68%; animation-delay: 1.7s; }
.ad-star.s6 { left: 70%; top: 74%; animation-delay: 0.9s; }
.ad-cloud {
  position: absolute;
  left: 50%;
  bottom: 16%;
  width: 320px;
  height: 100px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(255, 205, 155, 0.06);
  filter: blur(26px);
}
.ad-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + var(--safe-top)) 18px 0;
}
.ad-label {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 206, 154, 0.22);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: rgba(255, 230, 200, 0.58);
}
.ad-center {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}
.ad-ring {
  position: relative;
  width: 184px;
  height: 184px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 199, 143, 0.34);
  box-shadow: 0 0 0 12px rgba(255, 138, 61, 0.04), 0 0 50px rgba(255, 138, 61, 0.18);
  animation: spin 14s linear infinite;
}
.ad-ring-inner {
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 206, 154, 0.20);
}
.ad-rune {
  display: block;
  font-family: var(--font-display);
  font-size: 54px;
  color: #FFE0AF;
  text-shadow: 0 0 26px rgba(255, 138, 61, 0.66);
  animation: spin 14s linear infinite reverse;
}
.ad-center h2 {
  margin: 28px 0 0;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  color: #FFEBCB;
}
.ad-center p {
  margin: 8px 0 0;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: rgba(255, 246, 232, 0.45);
}
.ad-count {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 45px;
  color: #FFD08A;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 28px rgba(255, 138, 61, 0.46);
}
.ad-bottom {
  position: relative;
  z-index: 2;
  padding: 0 26px calc(30px + var(--safe-bottom));
}
.ad-progress {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 246, 232, 0.10);
  overflow: hidden;
}
.ad-progress div {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #FF8A3D, #FFD89A);
  box-shadow: 0 0 10px rgba(255, 138, 61, 0.8);
  transition: width 0.2s linear;
}
.ad-bottom p {
  margin: 9px 0 0;
  text-align: center;
  font-size: 9px;
  letter-spacing: 0.04em;
  color: rgba(255, 246, 232, 0.25);
}

/* ---------- Toast & flash ---------- */
.toast {
  position: fixed;
  z-index: 300;
  top: calc(16px + var(--safe-top));
  left: 50%;
  max-width: 86vw;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid rgba(255, 206, 154, 0.22);
  background: rgba(20, 14, 32, 0.94);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: #FFE6C2;
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0.03em;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -8px);
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.flash {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  opacity: 0;
}
.flash.gold {
  background: radial-gradient(circle at 50% 44%, rgba(255, 226, 164, 0.56), rgba(255, 138, 61, 0.16) 38%, transparent 66%);
  animation: flash 0.78s ease-out;
}
.flash.red {
  background: radial-gradient(circle at 50% 44%, rgba(255, 96, 82, 0.42), rgba(160, 30, 30, 0.12) 40%, transparent 66%);
  animation: flash 0.78s ease-out;
}

/* ---------- Floating effects ---------- */
.float-text {
  position: absolute;
  z-index: 14;
  transform: translate(-50%, -50%);
  font-size: 16px;
  font-weight: 800;
  color: #FFE0A6;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55), 0 0 14px rgba(255, 138, 61, 0.55);
  font-variant-numeric: tabular-nums;
  animation: floatText 0.95s ease-out forwards;
}
.float-text.crit { font-size: 20px; color: #FFF6D8; }
.float-text.soft { color: #FFC9A0; font-size: 13px; }

.ripple {
  position: absolute;
  z-index: 11;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 208, 154, 0.8);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: ripple 0.62s ease-out forwards;
}

.mote {
  position: absolute;
  z-index: 9;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #FFD08A;
  box-shadow: 0 0 9px 2px rgba(255, 138, 61, 0.56);
  opacity: 0;
  pointer-events: none;
  animation: moteUp 2.2s ease-out forwards;
}

/* ---------- Animations ---------- */
@keyframes introUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes floatFigure {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes breatheFigure {
  0%, 100% { transform: scaleY(1) translateY(0); }
  50% { transform: scaleY(1.012) translateY(-1px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.78; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.035); }
}
@keyframes sunBreathe {
  0%, 100% { opacity: 0.9; filter: blur(1px); }
  50% { opacity: 1; filter: blur(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes spinCenter {
  from { transform: translateX(-50%) rotate(0deg); }
  to { transform: translateX(-50%) rotate(360deg); }
}
@keyframes portalBreathe {
  0%, 100% { opacity: 0.72; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.035); }
}
@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(22px, -7px, 0); }
}
@keyframes isleFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(3px, -8px, 0); }
}
@keyframes craneGlide {
  0% { transform: translate3d(-8vw, 8px, 0) rotate(-5deg); }
  55% { transform: translate3d(58vw, -16px, 0) rotate(3deg); }
  100% { transform: translate3d(122vw, -4px, 0) rotate(-4deg); }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.18; transform: scale(0.8); }
  50% { opacity: 0.85; transform: scale(1.15); }
}
@keyframes pulseDot {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.15); }
}
@keyframes nodePulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.12), 0 0 10px rgba(255, 138, 61, 0.65); }
  50% { box-shadow: 0 0 0 5px rgba(255, 138, 61, 0.05), 0 0 16px rgba(255, 138, 61, 0.95); }
}
@keyframes shine {
  0% { transform: translateX(-110%); }
  55%, 100% { transform: translateX(120%); }
}
@keyframes fullBar {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}
@keyframes statePulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}
@keyframes readyGlow {
  0%, 100% { box-shadow: 0 5px 0 #A34713, 0 11px 24px rgba(255, 122, 47, 0.26), inset 0 1px 0 rgba(255, 244, 214, 0.85); }
  50% { box-shadow: 0 5px 0 #A34713, 0 13px 34px rgba(255, 156, 74, 0.52), inset 0 1px 0 rgba(255, 244, 214, 0.85); }
}
@keyframes pulseAura {
  0%, 100% { opacity: 0.45; transform: scale(0.94); }
  50% { opacity: 0.9; transform: scale(1.04); }
}
@keyframes ringBurst {
  0% { filter: drop-shadow(0 0 8px rgba(255, 138, 61, 0.5)); opacity: 0.8; }
  50% { filter: drop-shadow(0 0 22px rgba(255, 220, 170, 0.95)); opacity: 1; }
  100% { filter: drop-shadow(0 0 8px rgba(255, 138, 61, 0.5)); opacity: 0.8; }
}
@keyframes tapPulse {
  0% { transform: scale(1); }
  45% { transform: scale(1.025) translateY(-2px); }
  100% { transform: scale(1); }
}
@keyframes floatText {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.82); }
  18% { opacity: 1; transform: translate(-50%, -72%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -168%) scale(0.92); }
}
@keyframes ripple {
  0% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.5); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(3.3); }
}
@keyframes moteUp {
  0% { opacity: 0; transform: translate3d(0, 6px, 0) scale(0.6); }
  16% { opacity: 0.8; }
  100% { opacity: 0; transform: translate3d(14px, -74px, 0) scale(1.15); }
}
@keyframes bannerIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.86); }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(1.02); }
  24% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  78% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -58%) scale(0.98); }
}
@keyframes flash {
  0% { opacity: 0; }
  12% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
.game-screen.shake { animation: shake 0.48s ease-in-out; }

/* ---------- Responsive ---------- */
@media (max-height: 760px) {
  .start-top { padding-top: 2.4vh; }
  .start-title { font-size: clamp(42px, 13vw, 54px); }
  .start-sub { margin-top: 10px; }
  .start-stage { min-height: 190px; }
  .start-figure { width: min(160px, 42vw); margin-bottom: 38px; }
  .start-halo { bottom: 18px; width: min(280px, 80vw); height: min(280px, 80vw); }
  .start-ring.ring-one { width: min(230px, 64vw); height: min(230px, 64vw); bottom: 26px; }
  .start-ring.ring-two { width: min(184px, 53vw); height: min(184px, 53vw); bottom: 26px; }
  .start-platform { bottom: 26px; }
  .start-mountains { height: 54%; }

  .stage { min-height: 248px; }
  .cultivation-panel { padding: 11px 14px 9px; }
  .cult-num b { font-size: 18px; }
  .mini-stats { margin-top: 5px; padding-top: 5px; }
  .actions { gap: 7px; padding-top: 7px; }
  .btn-break { height: 54px; }
  .btn-tap, .btn-ad { height: 52px; }
}

@media (max-height: 680px) {
  .start-top { padding-top: 1vh; }
  .seal-mark { width: 42px; height: 42px; margin-bottom: 11px; }
  .start-stage { min-height: 150px; }
  .start-figure { width: min(136px, 36vw); margin-bottom: 31px; }
  .start-halo { width: min(230px, 68vw); height: min(230px, 68vw); bottom: 12px; }
  .start-ring.ring-one { width: min(190px, 54vw); height: min(190px, 54vw); bottom: 20px; }
  .start-ring.ring-two { width: min(150px, 44vw); height: min(150px, 44vw); bottom: 20px; }
  .start-platform { bottom: 20px; }
  .start-note { display: none; }
  .start-features { display: none; }
  .start-palace { display: none; }

  .stage { min-height: 218px; }
  .scene-palace { width: min(126px, 36vw); opacity: 0.6; }
  .character-wrap { width: min(210px, 58vw); }
  .cult-state { display: none; }
  .cult-foot { font-size: 9.5px; }
  .mini-stats { font-size: 8.5px; }
  .break-text b { font-size: 15px; }
  .break-text small { font-size: 8.5px; }
  .action-text b { font-size: 12px; }
  .action-text small { font-size: 8px; }
}

@media (max-width: 365px) {
  .game-screen { padding-left: 13px; padding-right: 13px; }
  .stage { margin-left: -13px; margin-right: -13px; }
  .avatar { width: 40px; height: 40px; }
  .name-row { font-size: 14px; }
  .name-row > span { max-width: 120px; }
  .realm-line { font-size: 9.5px; }
  .time-pill { padding: 0 7px; font-size: 9.5px; }
  .icon-btn { width: 31px; height: 31px; }
  .mini-stats { font-size: 8.5px; }
  .mini-stats .mp-icon { width: 10px; height: 10px; }
  .btn-break { padding: 0 11px; gap: 9px; }
  .break-text b { font-size: 15px; }
  .break-chance { padding: 4px 7px; }
  .btn-tap, .btn-ad { padding: 0 9px; gap: 6px; }
  .action-text b { font-size: 11.5px; }
  .action-text small { font-size: 8px; }
  .btn-tap > .mp-icon, .btn-ad > .mp-icon { width: 20px; height: 20px; }
}

@media (min-width: 600px) {
  .stage { border-radius: 30px; margin-left: 0; margin-right: 0; }
  .game-screen { padding-left: 20px; padding-right: 20px; }
}


@media (max-height: 680px) {
  .end-content { padding-top: 9vh; }
  .end-title { font-size: clamp(38px, 11vw, 48px); }
  .end-sub { margin-top: 7px; }
  .end-card { margin: 15px 0 12px; padding: 12px 14px 11px; }
  .end-stat { padding: 7px 9px; }
  .end-screen .btn-hero { height: 54px; min-height: 54px; }
  .end-screen .btn-ghost { min-height: 40px; }
  .stage { min-height: 200px; }
  .character-wrap { width: min(210px, 58vw); }
}

@media (max-width: 340px) {
  .time-pill { display: none; }
  .name-row > span { max-width: 106px; }
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .start-title, .end-title { -webkit-text-fill-color: #FFE6BE; color: #FFE6BE; background: none; }
}

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