:root {
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #121821;
  color: #eef6ff;
  --app-width: 100vw;
  --app-height: 100dvh;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

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

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #101722;
}

body {
  position: fixed;
  inset: 0;
  width: var(--app-width);
  height: var(--app-height);
  margin: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.game-shell {
  width: var(--app-width);
  height: var(--app-height);
  display: grid;
  place-items: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(rgba(9, 20, 35, 0.16), rgba(9, 20, 35, 0.34)),
    url("./assets/ui/brand_hero.png") center / cover no-repeat;
}

.game-stage {
  position: relative;
  width: min(var(--app-width), calc(var(--app-height) * 16 / 9));
  height: min(var(--app-height), calc(var(--app-width) * 9 / 16));
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  background: #8fd0ff;
  box-shadow: 0 18px 60px rgba(2, 12, 26, 0.28);
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #8fd0ff;
  box-shadow: none;
  z-index: 1;
}

.screen-panel {
  position: absolute;
  width: min(92%, 760px);
  max-height: 92%;
  overflow: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(13, 24, 36, 0.88);
  box-shadow: 0 24px 60px rgba(4, 10, 20, 0.34);
  backdrop-filter: blur(14px);
  text-align: center;
  z-index: 4;
}

.screen-panel[hidden] {
  display: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: #9ee5ff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(34px, 7vw, 64px);
}

h2 {
  font-size: clamp(30px, 6vw, 48px);
}

.screen-copy {
  margin: 14px auto 20px;
  max-width: 560px;
  color: #d9ecff;
  font-size: 16px;
  line-height: 1.6;
}

.hero-panel {
  display: grid;
  width: min(92%, 980px);
  min-height: auto;
  align-content: start;
  gap: 12px;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 44%, rgba(16, 42, 70, 0.62), rgba(11, 24, 39, 0.9) 62%),
    url("./assets/ui/brand_hero.png") center / cover no-repeat;
}

.home-scene {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  --home-platform-center-x: 36%;
  --home-cloud-contact-y: 250px;
  --home-story-width: min(26%, 290px);
  --home-story-half-width: min(13%, 145px);
  --home-final-width: min(28%, 310px);
  --home-final-half-width: min(14%, 155px);
  background:
    linear-gradient(rgba(96, 190, 255, 0.1), rgba(255, 255, 255, 0.12)),
    url("./assets/startinter/home_background.png") center / cover no-repeat;
}

.home-scene[hidden] {
  display: none;
}

.home-logo {
  position: absolute;
  left: 4%;
  top: 4%;
  z-index: 4;
  width: min(18%, 220px);
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
  box-shadow: none;
  filter:
    drop-shadow(0 0 3px rgba(255, 255, 255, 0.96))
    drop-shadow(0 2px 5px rgba(26, 86, 128, 0.2));
}

.home-scene::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 24%;
  background: linear-gradient(rgba(255, 255, 255, 0), rgba(225, 246, 255, 0.7));
  pointer-events: none;
}

.home-story {
  position: absolute;
  left: clamp(
    calc(12px + var(--home-story-half-width)),
    var(--home-platform-center-x),
    calc(100% - 12px - var(--home-story-half-width))
  );
  top: var(--home-cloud-contact-y);
  width: var(--home-story-width);
  height: auto;
  min-height: 96px;
  z-index: 3;
  pointer-events: none;
  transform: translate(-50%, -100%);
}

.home-value-card {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: end center;
  min-width: 0;
  opacity: 0;
}

.home-value-title {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  z-index: 1;
  filter:
    drop-shadow(0 5px 0 rgba(45, 119, 214, 0.22))
    drop-shadow(0 14px 22px rgba(46, 134, 224, 0.22));
  transition: opacity 420ms ease;
}

.home-value-cloud {
  position: absolute;
  left: 50%;
  top: auto;
  bottom: 0;
  z-index: 3;
  width: 112%;
  aspect-ratio: 1 / 1;
  pointer-events: none;
  opacity: 1;
  background-image: url("./assets/startinter/static_cloud_clean.png");
  background-size: 300% 100%;
  background-position: 0% 0%;
  transform: translate(-50%, 33%) scale(1);
  filter:
    drop-shadow(0 15px 15px rgba(43, 89, 123, 0.24))
    drop-shadow(0 0 12px rgba(255, 255, 255, 0.56));
  animation: homeCloudIdleFrames 880ms steps(1, end) infinite;
}

.home-scene:not([data-home-value]) .value-prospect,
.home-scene[data-home-value="0"] .value-prospect,
.home-scene[data-home-value="1"] .value-growth,
.home-scene[data-home-value="2"] .value-true-self,
.home-scene[data-home-value="3"] .value-life {
  opacity: 1;
}

.home-scene.is-home-impact .home-value-cloud {
  background-image: url("./assets/startinter/cloud_burst_clean.png");
  opacity: 1;
  animation: homeCloudBurstFrames 720ms steps(1, end) forwards;
}

.home-scene.is-home-revealing .home-value-title {
  opacity: 1;
}

.home-scene.is-home-revealing:not(.is-home-impact) .home-story .home-value-cloud {
  opacity: 0;
  animation: none;
}

.home-scene[data-home-value="4"] .home-value-card {
  opacity: 0;
}

.home-scene.is-home-complete .home-value-cloud {
  display: none;
}

.home-final-message {
  position: absolute;
  left: clamp(
    calc(12px + var(--home-final-half-width)),
    var(--home-platform-center-x),
    calc(100% - 12px - var(--home-final-half-width))
  );
  top: var(--home-cloud-contact-y);
  z-index: 4;
  width: var(--home-final-width);
  --home-final-line-one-offset: clamp(-62px, calc(-6vw + 10px), -38px);
  display: grid;
  gap: 4px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% + 10px)) scale(0.98);
  transition:
    opacity 900ms ease,
    transform 900ms ease;
}

.home-final-line {
  display: block;
  width: 100%;
  height: clamp(34px, 5.2vw, 58px);
  object-fit: cover;
  object-position: 50% 47%;
  filter:
    drop-shadow(0 5px 0 rgba(45, 119, 214, 0.2))
    drop-shadow(0 14px 22px rgba(46, 134, 224, 0.22));
}

.home-final-line-one {
  opacity: 0;
  transform: translateY(var(--home-final-line-one-offset));
  transition: opacity 1100ms ease;
}

.home-final-line-two-wrap {
  position: relative;
  width: 118%;
  margin-top: 0;
  margin-left: -9%;
}

.home-final-line-two {
  opacity: 0;
  transform: scale(0.985);
  transition:
    opacity 420ms ease,
    transform 420ms ease;
}

.home-final-cloud {
  position: absolute;
  left: 50%;
  top: auto;
  bottom: 0;
  z-index: 3;
  width: 98%;
  aspect-ratio: 1 / 1;
  opacity: 0;
  background-image: url("./assets/startinter/static_cloud_clean.png");
  background-size: 300% 100%;
  background-position: 0% 0%;
  transform: translate(-50%, 33%) scale(1);
  filter:
    drop-shadow(0 15px 15px rgba(43, 89, 123, 0.24))
    drop-shadow(0 0 12px rgba(255, 255, 255, 0.56));
}

.home-scene.is-home-final .home-final-message {
  opacity: 1;
  transform: translate(-50%, -100%) scale(1);
}

.home-scene.is-home-final .home-final-line-one {
  opacity: 1;
}

.home-scene.is-home-final-ready .home-final-cloud {
  opacity: 1;
  animation: homeCloudIdleFrames 880ms steps(1, end) infinite;
}

.home-scene.is-home-final-impact .home-final-cloud {
  background-image: url("./assets/startinter/cloud_burst_clean.png");
  animation: homeCloudBurstFrames 720ms steps(1, end) forwards;
}

.home-scene.is-home-final-revealing .home-final-line-two {
  opacity: 1;
  transform: scale(1);
  animation: homeFinalHighlight 1.35s ease-in-out infinite;
}

.home-scene.is-home-complete .home-final-line-two {
  opacity: 1;
  transform: scale(1);
  animation: homeFinalHighlight 1.35s ease-in-out infinite;
}

.home-scene.is-home-complete .home-final-cloud {
  display: none;
}

@keyframes homeFinalHighlight {
  0%, 100% {
    filter:
      brightness(1)
      drop-shadow(0 5px 0 rgba(45, 119, 214, 0.18))
      drop-shadow(0 0 12px rgba(255, 255, 255, 0.72))
      drop-shadow(0 0 18px rgba(89, 196, 255, 0.35));
  }
  50% {
    filter:
      brightness(1.2)
      drop-shadow(0 6px 0 rgba(45, 119, 214, 0.28))
      drop-shadow(0 0 26px rgba(255, 255, 255, 1))
      drop-shadow(0 0 42px rgba(89, 196, 255, 0.9));
  }
}

.music-toggle-button {
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 11;
  width: 38px;
  height: 38px;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow:
    0 10px 16px rgba(97, 75, 23, 0.2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: musicButtonPulse 1.7s ease-in-out infinite;
  transition:
    filter 180ms ease,
    opacity 180ms ease,
    transform 120ms ease;
}

.music-toggle-button::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 50%;
  height: 4px;
  border-radius: 999px;
  background: #14295b;
  border: 2px solid rgba(255, 255, 255, 0.88);
  box-shadow:
    0 2px 0 rgba(159, 95, 0, 0.34),
    0 0 8px rgba(255, 255, 255, 0.55);
  opacity: 0;
  transform: rotate(-38deg);
  transform-origin: center;
}

.music-toggle-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  pointer-events: none;
}

.music-toggle-button.is-muted {
  filter: grayscale(0.55) brightness(0.78);
  opacity: 0.86;
  animation: none;
}

.music-toggle-button:active {
  transform: translateY(3px) scale(0.92);
  filter: brightness(0.95) saturate(1.1);
}

.music-toggle-button.is-tapped {
  animation: musicButtonTap 220ms ease-out;
}

.music-toggle-button.is-muted::after {
  opacity: 1;
}

.music-toggle-button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.82);
  outline-offset: 3px;
}

.loading-panel.is-active ~ .music-toggle-button {
  opacity: 0;
  pointer-events: none;
}

body.is-playing .music-toggle-button {
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 86px);
}

@keyframes musicButtonPulse {
  0%, 100% {
    transform: translateY(0) scale(1);
    filter:
      drop-shadow(0 0 0 rgba(255, 255, 255, 0))
      saturate(1);
  }
  48% {
    transform: translateY(-2px) scale(1.045);
    filter:
      drop-shadow(0 0 10px rgba(255, 255, 255, 0.72))
      saturate(1.12);
  }
}

@keyframes musicButtonTap {
  0% {
    transform: translateY(3px) scale(0.9);
  }
  58% {
    transform: translateY(-3px) scale(1.08);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes homeCloudIdleFrames {
  0%, 100% {
    background-position: 0% 0%;
    transform: translate(-50%, calc(33% + 1px)) scale(1);
  }
  33% {
    background-position: 50% 0%;
    transform: translate(-50%, calc(33% - 2px)) scale(1.01);
  }
  66% {
    background-position: 100% 0%;
    transform: translate(-50%, calc(33% - 1px)) scale(1.005);
  }
}

@keyframes homeCloudBurstFrames {
  0% {
    opacity: 1;
    background-position: 0% 0%;
    transform: translate(-50%, 33%) scale(1.02);
  }
  34% {
    opacity: 0.95;
    background-position: 50% 0%;
    transform: translate(-50%, calc(33% - 8px)) scale(1.08);
  }
  68% {
    opacity: 0.62;
    background-position: 100% 0%;
    transform: translate(-50%, calc(33% - 18px)) scale(1.15);
  }
  100% {
    opacity: 0;
    background-position: 100% 0%;
    transform: translate(-50%, calc(33% - 28px)) scale(1.24);
  }
}

.home-character {
  position: absolute;
  left: 18%;
  bottom: 12%;
  width: 38%;
  max-width: 430px;
  min-width: 280px;
  aspect-ratio: 2.3 / 1;
  z-index: 2;
}

.home-platform {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 16px rgba(57, 105, 124, 0.28));
}

.home-player {
  position: absolute;
  left: 18%;
  bottom: 17%;
  width: min(48%, 210px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  filter: drop-shadow(0 8px 6px rgba(28, 72, 94, 0.22));
  animation: homePlayerRunLoop 4s linear infinite;
}

.home-player::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("./assets/chibi_scientist_spritesheet.png") 0 0 / 500% 400% no-repeat;
  image-rendering: pixelated;
  transform-origin: center center;
  animation:
    homeRunFrames 4s steps(1, end) infinite,
    homePlayerDirection 4s steps(1, end) infinite;
}

.home-scene.is-home-jumping .home-player {
  animation:
    homePlayerRunLoop 4s linear infinite,
    homePlayerClickJump 860ms ease-out;
}

.home-scene.is-home-jumping .home-player::before {
  animation:
    homeJumpFrames 860ms steps(1, end) forwards,
    homePlayerDirection 4s steps(1, end) infinite;
}

@keyframes homeRunFrames {
  0%, 50%, 100% {
    background-position: 0% 33.333%;
  }
  12.5%, 62.5% {
    background-position: 25% 33.333%;
  }
  25%, 75% {
    background-position: 50% 33.333%;
  }
  37.5%, 87.5% {
    background-position: 75% 33.333%;
  }
}

@keyframes homeJumpFrames {
  0% {
    background-position: 0% 100%;
  }
  20% {
    background-position: 25% 100%;
  }
  40% {
    background-position: 50% 100%;
  }
  62% {
    background-position: 75% 100%;
  }
  84%, 100% {
    background-position: 100% 100%;
  }
}

@keyframes homePlayerRunLoop {
  0% {
    left: 13%;
  }
  50% {
    left: 72%;
  }
  100% {
    left: 13%;
  }
}

@keyframes homePlayerClickJump {
  0% {
    transform: translateX(-50%) translateY(0);
  }
  28% {
    transform: translateX(-50%) translateY(-28%);
  }
  52% {
    transform: translateX(-50%) translateY(-62%);
  }
  74% {
    transform: translateX(-50%) translateY(-22%);
  }
  100% {
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes homePlayerDirection {
  0%, 49.99% {
    transform: scaleX(1);
  }
  50%, 100% {
    transform: scaleX(-1);
  }
}

.home-items {
  position: absolute;
  left: 40%;
  right: 10%;
  bottom: 44%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  display: none;
}

.home-items img {
  width: 18%;
  max-width: 58px;
  min-width: 34px;
  object-fit: contain;
  filter:
    drop-shadow(0 4px 0 rgba(50, 133, 204, 0.15))
    drop-shadow(0 0 14px rgba(255, 255, 255, 0.72));
  animation: homeItemFloat 3.6s ease-in-out infinite;
}

.home-items img:nth-child(2) {
  animation-delay: 0.4s;
}

.home-items img:nth-child(3) {
  animation-delay: 0.8s;
}

.home-items img:nth-child(4) {
  animation-delay: 1.2s;
}

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

.home-actions {
  position: absolute;
  right: 7%;
  bottom: 12%;
  width: min(26%, 286px);
  display: grid;
  gap: 12px;
  justify-items: center;
  z-index: 3;
}

.home-jump-prompt {
  margin: 0;
  color: #ffffff;
  font-size: clamp(17px, 2.3vw, 28px);
  font-weight: 900;
  line-height: 1.18;
  text-align: center;
  text-shadow:
    0 3px 0 rgba(49, 122, 196, 0.28),
    0 0 18px rgba(255, 255, 255, 0.92),
    0 10px 28px rgba(43, 102, 172, 0.3);
  transition:
    opacity 240ms ease,
    transform 240ms ease;
  animation: homePromptPulse 1.45s ease-in-out infinite;
}

.home-jump-prompt span {
  display: block;
}

@keyframes homePromptPulse {
  0%, 100% {
    opacity: 0.72;
    transform: scale(0.99);
    text-shadow:
      0 3px 0 rgba(49, 122, 196, 0.22),
      0 0 12px rgba(255, 255, 255, 0.68),
      0 10px 24px rgba(43, 102, 172, 0.24);
  }
  48% {
    opacity: 1;
    transform: scale(1.015);
    text-shadow:
      0 3px 0 rgba(49, 122, 196, 0.3),
      0 0 24px rgba(255, 255, 255, 1),
      0 12px 30px rgba(43, 102, 172, 0.34);
  }
}

.home-scene.is-home-complete .home-jump-prompt {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  animation: none;
}

.home-actions .start-image-button {
  opacity: 0;
  pointer-events: none;
  width: min(100%, 238px);
  transform: translateY(14px) scale(0.96);
  transition:
    opacity 320ms ease,
    transform 320ms ease;
}

.home-scene.is-home-complete .home-actions .start-image-button {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.image-button {
  min-width: 0;
  min-height: 0;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.image-button img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 12px rgba(35, 94, 136, 0.22));
  transition:
    transform 150ms ease,
    filter 150ms ease;
}

.image-button:active {
  transform: none;
  box-shadow: none;
}

.image-button:active img {
  transform: translateY(3px) scale(0.985);
  filter: drop-shadow(0 7px 8px rgba(35, 94, 136, 0.2));
}

.choice-panel {
  width: min(88%, 520px);
}

.text-link-button {
  min-width: 0;
  min-height: 34px;
  margin-top: 16px;
  padding: 0 8px;
  background: transparent;
  color: #d9ecff;
  box-shadow: none;
}

.text-link-button:active {
  transform: none;
  box-shadow: none;
}

.loading-panel {
  width: min(88%, 560px);
  display: grid;
  gap: 14px;
  justify-items: center;
  background:
    linear-gradient(rgba(11, 24, 39, 0.78), rgba(11, 24, 39, 0.92)),
    url("./assets/ui/brand_hero.png") center / cover no-repeat;
}

.loading-panel h1 {
  font-size: clamp(32px, 6vw, 54px);
}

.loading-track {
  width: min(100%, 360px);
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(7, 21, 36, 0.72);
}

.loading-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #58e6ff, #ffe36e);
  transition: width 180ms ease;
}

.loading-percent {
  margin: -2px 0 0;
  color: #f7fbff;
  font-size: 14px;
  font-weight: 900;
}

.showcase-image {
  width: min(100%, 760px);
  aspect-ratio: 16 / 9;
  max-height: min(38%, 350px);
  justify-self: center;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

.compact-panel {
  width: min(88%, 520px);
}

.game-over-panel {
  width: min(92%, 640px);
  max-height: calc(100% - 36px);
  overflow: hidden;
  padding: 22px 24px;
}

.game-over-panel .eyebrow {
  margin-bottom: 4px;
}

.game-over-panel h2 {
  font-size: clamp(28px, 5vw, 42px);
}

.game-over-panel .hint {
  display: none;
}

.info-panel {
  text-align: left;
}

.info-panel h2,
.info-panel .eyebrow,
.info-panel > .screen-copy {
  text-align: center;
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 24px;
}

.brand-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.brand-card img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  float: left;
  margin: 0 12px 6px 0;
}

.brand-card h3 {
  margin: 2px 0 8px;
  color: #f7fbff;
  font-size: 18px;
  font-weight: 900;
}

.brand-card p,
.rule-list p,
.rule-value-card p {
  margin: 0;
  color: #dceeff;
  font-size: 14px;
  line-height: 1.65;
}

.brand-card.prospect {
  border-color: rgba(255, 224, 91, 0.42);
}

.brand-card.growth {
  border-color: rgba(137, 239, 89, 0.38);
}

.brand-card.true-self {
  border-color: rgba(93, 218, 255, 0.4);
}

.brand-card.life {
  border-color: rgba(255, 127, 183, 0.42);
}

.rule-list {
  display: grid;
  gap: 12px;
  margin: 22px 0;
}

.rule-list p {
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.rule-value-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: -4px 0 22px;
}

.rule-value-card {
  min-width: 0;
  padding: 12px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.075);
  text-align: center;
}

.rule-value-card img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.rule-value-card h3 {
  margin: 4px 0 7px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
}

.rule-value-card.prospect {
  border-color: rgba(255, 224, 91, 0.42);
}

.rule-value-card.growth {
  border-color: rgba(137, 239, 89, 0.38);
}

.rule-value-card.true-self {
  border-color: rgba(93, 218, 255, 0.4);
}

.rule-value-card.life {
  border-color: rgba(255, 127, 183, 0.42);
}

.screen-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  min-width: 160px;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffe36e, #f6a629);
  color: #172033;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 0 rgba(98, 60, 6, 0.55);
  touch-action: manipulation;
}

.secondary-button {
  background: linear-gradient(180deg, #e7f4ff, #9cc9f2);
  color: #10223a;
}

button:active {
  transform: translateY(2px);
  box-shadow: 0 6px 0 rgba(98, 60, 6, 0.55);
}

.music-toggle-button,
.music-toggle-button:active {
  min-width: 0;
  min-height: 0;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.music-toggle-button {
  box-shadow: 0 7px 10px rgba(97, 75, 23, 0.18);
}

.music-toggle-button:active {
  box-shadow: 0 4px 7px rgba(97, 75, 23, 0.18);
}

.hint {
  margin: 18px 0 0;
  color: rgba(225, 240, 255, 0.76);
  font-size: 13px;
  line-height: 1.5;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0 14px;
}

.game-over-panel .result-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 10px;
}

.result-grid div {
  min-width: 0;
  padding: 13px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
}

.game-over-panel .result-grid div {
  padding: 10px 8px;
}

.result-grid dt {
  margin-bottom: 5px;
  color: #9ee5ff;
  font-size: 12px;
  font-weight: 800;
}

.result-grid dd {
  margin: 0;
  color: #ffffff;
  font-size: clamp(20px, 5vw, 30px);
  font-weight: 900;
}

.game-over-panel .result-grid dd {
  font-size: clamp(19px, 4vw, 26px);
}

.value-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  margin: 0 0 22px;
  list-style: none;
}

.game-over-panel .value-breakdown {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 16px;
}

.value-breakdown li {
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: #eef6ff;
  font-size: 14px;
  font-weight: 800;
}

.touch-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  z-index: 5;
  display: none;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 0 calc(18px + var(--safe-right)) calc(14px + var(--safe-bottom)) calc(18px + var(--safe-left));
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.touch-controls[hidden] {
  display: none;
}

.touch-controls.is-tutorial-paused {
  opacity: 0;
  pointer-events: none;
}

.joystick-zone,
.jump-zone {
  pointer-events: auto;
  padding: 0;
  touch-action: none;
}

.joystick-zone {
  display: none;
  position: relative;
  --joystick-x: 74px;
  --joystick-y: calc(100% - 64px);
  width: min(52%, 460px);
  height: 100%;
  min-width: 280px;
  min-height: 220px;
}

.joystick-zone,
.jump-zone span {
  opacity: 0.46;
  transition:
    opacity 360ms ease,
    filter 360ms ease,
    transform 160ms ease;
}

.joystick-zone.is-faded,
.jump-zone.is-faded span {
  opacity: 0.16;
  filter: saturate(0.78);
}

.joystick-zone.is-active,
.jump-zone.is-pressed span {
  opacity: 0.72;
  filter: none;
}

.joystick-base {
  position: absolute;
  left: var(--joystick-x);
  top: var(--joystick-y);
  bottom: auto;
  width: 112px;
  height: 112px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.12) 0 22%, transparent 23%),
    rgba(12, 28, 48, 0.22);
  box-shadow:
    inset 0 0 18px rgba(149, 245, 255, 0.1),
    0 8px 18px rgba(3, 10, 20, 0.16);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.joystick-zone.is-active .joystick-base {
  opacity: 0.72;
}

.joystick-base::before,
.joystick-base::after {
  position: absolute;
  top: 50%;
  color: rgba(255, 255, 255, 0.48);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-50%);
}

.joystick-base::before {
  content: "‹";
  left: 17px;
}

.joystick-base::after {
  content: "›";
  right: 17px;
}

.joystick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(247, 253, 255, 0.46), rgba(111, 202, 255, 0.36));
  box-shadow: 0 6px 12px rgba(3, 10, 20, 0.16);
  transform: translate(-50%, -50%);
  transition: transform 120ms ease;
}

.control-label {
  display: none;
}

.jump-zone {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: end;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #172033;
  font: inherit;
}

.jump-zone:active {
  box-shadow: none;
  transform: none;
}

.jump-zone span {
  display: grid;
  place-items: center;
  width: 94px;
  height: 62px;
  margin: 0 0 6px auto;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 232, 118, 0.42), rgba(246, 169, 43, 0.34));
  color: rgba(23, 32, 51, 0.82);
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 5px 0 rgba(111, 68, 0, 0.18);
  backdrop-filter: blur(5px);
}

.jump-zone.is-pressed span {
  transform: translateY(4px);
  box-shadow: 0 3px 0 rgba(111, 68, 0, 0.45);
}

.jump-zone.is-hidden span {
  opacity: 0;
  transform: translateY(10px) scale(0.92);
  pointer-events: none;
}

.tutorial-hud {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.tutorial-hud[hidden] {
  display: none;
}

.tutorial-skip {
  position: absolute;
  top: calc(16px + var(--safe-top));
  right: calc(16px + var(--safe-right));
  min-width: 0;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(8, 23, 39, 0.72);
  color: #f7fbff;
  font-size: 13px;
  box-shadow: 0 8px 20px rgba(3, 10, 20, 0.28);
  pointer-events: auto;
}

.tutorial-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(460px, calc(100% - 64px - var(--safe-left) - var(--safe-right)));
  padding: 18px 20px 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(11, 24, 39, 0.78);
  box-shadow: 0 14px 34px rgba(3, 10, 20, 0.3);
  backdrop-filter: blur(10px);
  pointer-events: auto;
  text-align: center;
  transform: translate(-50%, -50%);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.tutorial-hud.is-collecting .tutorial-card {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% - 10px)) scale(0.98);
}

.tutorial-item-illustration {
  display: block;
  width: 96px;
  max-width: 28%;
  height: auto;
  margin: 0 auto 8px;
  object-fit: contain;
  filter:
    drop-shadow(0 0 16px rgba(255, 255, 255, 0.58))
    drop-shadow(0 8px 10px rgba(0, 0, 0, 0.2));
}

.tutorial-eyebrow {
  margin: 0 0 4px;
  color: #9ee5ff;
  font-size: 12px;
  font-weight: 900;
}

.tutorial-card h2 {
  margin: 0;
  font-size: 20px;
}

.tutorial-card p {
  margin: 8px 0 0;
  color: #e2f1ff;
  font-size: 14px;
  line-height: 1.55;
}

.tutorial-task {
  color: #ffe7a0;
  font-weight: 900;
}

.tutorial-progress {
  display: flex;
  gap: 7px;
  margin-top: 11px;
}

.tutorial-progress span {
  width: 34px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.tutorial-progress span.is-complete {
  background: linear-gradient(90deg, #58e6ff, #ffe36e);
}

.tutorial-start {
  min-width: 156px;
  min-height: 38px;
  margin-top: 12px;
  padding: 0 16px;
  font-size: 14px;
}

.tutorial-start:disabled {
  opacity: 0.48;
  cursor: default;
  transform: none;
  box-shadow: 0 8px 0 rgba(98, 60, 6, 0.24);
}

body.is-playing {
  overflow: hidden;
}

.rotate-notice {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 32px;
  text-align: center;
  background:
    linear-gradient(rgba(9, 20, 35, 0.78), rgba(9, 20, 35, 0.92)),
    url("./assets/ui/game_showcase.png") center / cover no-repeat;
}

body.needs-rotate .rotate-notice {
  display: grid;
}

.rotate-notice > * {
  max-width: 360px;
}

.rotate-notice h2 {
  margin-top: 18px;
  font-size: 34px;
}

.rotate-notice p {
  margin: 12px auto 0;
  color: #d9ecff;
  line-height: 1.7;
}

.rotate-continue {
  min-width: 176px;
  min-height: 42px;
  margin-top: 18px;
  padding: 0 18px;
  font-size: 14px;
}

.phone-icon {
  width: 76px;
  height: 118px;
  margin: 0 auto;
  border: 5px solid rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  position: relative;
  animation: rotatePhone 1.8s ease-in-out infinite;
  box-shadow: 0 0 28px rgba(95, 220, 255, 0.42);
}

.phone-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 14px;
  height: 14px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
}

@keyframes rotatePhone {
  0%, 18% {
    transform: rotate(0deg);
  }
  58%, 100% {
    transform: rotate(90deg);
  }
}

@media (pointer: coarse), (max-width: 760px) {
  body {
    min-height: var(--app-height);
  }

  .game-shell {
    min-height: var(--app-height);
    place-items: center;
  }

  .game-stage {
    width: var(--app-width);
    height: var(--app-height);
  }

  body.is-playing .touch-controls {
    display: flex;
  }

  canvas {
    border: 0;
  }

  .screen-panel {
    position: absolute;
    inset: 0;
    width: 100%;
    max-height: none;
    min-height: 100%;
    transform: none;
    padding: calc(28px + env(safe-area-inset-top, 0px)) 20px calc(30px + var(--safe-bottom));
    border: 0;
    border-radius: 0;
    display: grid;
    align-content: center;
  }

  .screen-panel[hidden] {
    display: none;
  }

  .game-over-panel {
    inset: auto;
    left: 50%;
    top: 50%;
    width: min(92%, 720px);
    max-height: calc(100% - 20px);
    min-height: 0;
    padding: 16px;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    overflow: hidden;
    align-content: center;
  }

  .info-panel {
    align-content: start;
    overflow-y: auto;
  }

  .hero-panel {
    gap: 12px;
  }

  .showcase-image {
    max-height: 34%;
  }

  .loading-panel {
    align-content: center;
  }

  .home-story {
    --home-story-width: min(25%, 270px);
    --home-story-half-width: min(12.5%, 135px);
  }

  .home-final-message {
    --home-final-width: min(28%, 310px);
    --home-final-half-width: min(14%, 155px);
  }

  .home-logo {
    left: 4%;
    top: 4%;
    width: min(18%, 190px);
  }

  .home-character {
    left: 13%;
    bottom: 12%;
    width: 43%;
    min-width: 250px;
  }

  .home-actions {
    right: 5%;
    bottom: 12%;
    width: min(28%, 238px);
    gap: 10px;
  }

  .home-jump-prompt {
    font-size: clamp(15px, 2.1vw, 22px);
  }

  h1 {
    font-size: clamp(38px, 12vw, 58px);
  }

  h2 {
    font-size: clamp(30px, 9vw, 44px);
  }

  .brand-grid {
    grid-template-columns: 1fr;
  }

  .rule-value-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .screen-actions {
    position: sticky;
    bottom: 0;
    padding-top: 12px;
    background: linear-gradient(rgba(13, 24, 36, 0), rgba(13, 24, 36, 0.92) 34%);
  }

  .tutorial-card {
    top: 50%;
    left: 50%;
    width: min(420px, calc(100% - 92px - var(--safe-left) - var(--safe-right)));
    padding: 12px 13px;
  }

  .tutorial-item-illustration {
    width: 78px;
    margin-bottom: 6px;
  }

  .tutorial-card h2 {
    font-size: 18px;
  }

  .tutorial-card p {
    font-size: 13px;
    line-height: 1.45;
  }

  .tutorial-skip {
    top: calc(10px + var(--safe-top));
    right: calc(10px + var(--safe-right));
  }

  .joystick-base {
    width: 104px;
    height: 104px;
  }

  .joystick-knob {
    width: 50px;
    height: 50px;
  }

  .jump-zone span {
    width: 88px;
    height: 58px;
    margin-bottom: 4px;
    font-size: 17px;
  }
}

@media (max-height: 760px) and (orientation: landscape) {
  .game-stage {
    width: var(--app-width);
    height: var(--app-height);
  }
}

@media (max-width: 520px) {
  .screen-panel {
    padding-left: 18px;
    padding-right: 18px;
  }

  .result-grid,
  .value-breakdown,
  .rule-value-grid {
    grid-template-columns: 1fr;
  }

  .game-over-panel .result-grid,
  .game-over-panel .value-breakdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand-card img {
    width: 48px;
    height: 48px;
  }

  .tutorial-card {
    width: calc(100% - 64px - var(--safe-left) - var(--safe-right));
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .screen-panel {
    max-height: 96%;
    padding: 16px;
  }

  .game-over-panel {
    width: min(88%, 690px);
    padding: 12px 14px;
  }

  .game-over-panel .eyebrow {
    font-size: 11px;
  }

  .game-over-panel h2 {
    font-size: 26px;
  }

  .game-over-panel .result-grid {
    margin: 10px 0 8px;
    gap: 7px;
  }

  .game-over-panel .result-grid div {
    padding: 7px 6px;
  }

  .game-over-panel .result-grid dt {
    margin-bottom: 3px;
    font-size: 10px;
  }

  .game-over-panel .result-grid dd {
    font-size: 20px;
  }

  .game-over-panel .value-breakdown {
    gap: 6px;
    margin-bottom: 10px;
  }

  .game-over-panel .value-breakdown li {
    padding: 6px 5px;
    font-size: 12px;
  }

  .game-over-panel .screen-actions {
    padding-top: 0;
    background: none;
  }

  .hero-panel,
  .loading-panel {
    gap: 8px;
    padding: 14px;
  }

  .home-story {
    --home-story-width: min(24%, 240px);
    --home-story-half-width: min(12%, 120px);
  }

  .home-final-message {
    --home-final-width: min(27%, 280px);
    --home-final-half-width: min(13.5%, 140px);
  }

  .home-logo {
    left: 4%;
    top: 4%;
    width: min(17%, 170px);
  }

  .home-character {
    left: 16%;
    bottom: 11%;
    width: 36%;
    min-width: 245px;
  }

  .home-actions {
    right: 6%;
    bottom: 11%;
    width: min(24%, 218px);
    gap: 8px;
  }

  .home-actions .start-image-button {
    width: min(100%, 198px);
  }

  .home-jump-prompt {
    font-size: clamp(14px, 2vw, 20px);
  }

  .hero-panel h1,
  .loading-panel h1 {
    font-size: 42px;
  }

  .screen-copy {
    margin: 8px auto 10px;
    font-size: 14px;
    line-height: 1.45;
  }

  .showcase-image {
    width: min(100%, 600px);
    max-height: 118px;
  }

  .screen-actions {
    gap: 9px;
  }

  button {
    min-height: 40px;
    padding: 0 18px;
  }

  .hint {
    margin-top: 8px;
    font-size: 12px;
  }

  .brand-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0 14px;
  }

  .brand-card {
    padding: 9px;
  }

  .brand-card img {
    float: none;
    display: block;
    width: 42px;
    height: 42px;
    margin: 0 auto 5px;
  }

  .brand-card h3 {
    margin: 0 0 4px;
    font-size: 14px;
    text-align: center;
  }

  .brand-card p {
    font-size: 11px;
    line-height: 1.38;
  }
}
