:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #24272a;
  background: #c6d3ce;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100svh;
  overflow-x: hidden;
  background-color: #c6d3ce;
  background-image: url("assets/background.png");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
}

button {
  font: inherit;
}

.launcher-shell {
  position: relative;
  display: grid;
  width: min(100%, 760px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 22px max(20px, env(safe-area-inset-bottom));
  isolation: isolate;
}

.launcher-shell::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: rgba(248, 242, 225, .34);
  border-inline: 1px solid rgba(52, 47, 39, .12);
}

.brand-header {
  align-self: start;
  text-align: center;
}

.brand-title {
  display: block;
  width: min(78vw, 384px);
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 3px 0 rgba(255, 247, 225, .84));
}

.brand-header p {
  margin: 4px 0 0;
  color: #48535a;
  font-size: 13px;
  font-weight: 700;
}

.game-showcase {
  position: relative;
  display: grid;
  place-items: center;
  align-self: center;
  min-height: 270px;
  margin-top: 10px;
}

.showcase-art {
  display: block;
  width: min(86vw, 460px);
  max-height: 40svh;
  object-fit: contain;
  filter: drop-shadow(0 10px 9px rgba(42, 37, 30, .22));
}

.mascot {
  position: absolute;
  right: max(0px, calc(50% - 255px));
  bottom: -4px;
  width: clamp(86px, 22vw, 132px);
  height: auto;
  transform: rotate(2deg);
  filter: drop-shadow(0 5px 3px rgba(42, 37, 30, .2));
  animation: mascot-bob 2.7s ease-in-out infinite;
}

.launcher-actions {
  align-self: end;
  width: min(100%, 510px);
  margin: 12px auto 0;
  text-align: center;
}

.launcher-actions h1 {
  margin: 0;
  font-family: "KaiTi", "STKaiti", serif;
  font-size: clamp(28px, 8vw, 42px);
  font-weight: 900;
}

.target-line {
  margin: 4px 0 13px;
  color: #5a6267;
  font-size: 12px;
}

.target-line strong {
  color: #8d3b32;
}

.game-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 64px;
  padding: 0 24px 6px;
  border: 0;
  color: #fff;
  background-color: transparent;
  background-image: url("assets/button-red.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  font-size: 18px;
  font-weight: 900;
  text-shadow: 0 2px 0 rgba(28, 20, 17, .82);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 140ms ease, filter 140ms ease;
}

.game-button:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
}

.game-button:active {
  transform: translateY(2px) scale(.985);
}

.game-button:focus-visible {
  outline: 3px solid #1d647c;
  outline-offset: 3px;
}

.game-button:disabled {
  cursor: default;
  filter: grayscale(.55);
  opacity: .72;
}

.game-button.is-enter {
  width: min(100%, 350px);
  height: 72px;
  font-size: 23px;
  animation: enter-pulse 2.4s ease-in-out infinite;
}

.button-symbol {
  margin-right: 10px;
  font-size: 18px;
}

.platform-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.platform-actions .game-button {
  width: 100%;
  padding-inline: 12px;
  font-size: 15px;
}

.game-button.is-android {
  background-image: url("assets/button-blue.png");
}

.install-status {
  min-height: 21px;
  margin: 7px 0 0;
  color: #355663;
  font-size: 12px;
  font-weight: 700;
}

.launcher-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: end;
  gap: 7px;
  margin-top: 10px;
  color: #5a5f61;
  font-size: 11px;
  text-align: center;
}

.install-dialog {
  width: min(92vw, 460px);
  max-height: min(82svh, 620px);
  padding: 0;
  overflow: auto;
  border: 3px solid #514427;
  border-radius: 8px;
  color: #292b2d;
  background: #f5ecd7;
  box-shadow: 0 18px 52px rgba(20, 22, 23, .38);
}

.install-dialog::backdrop {
  background: rgba(20, 25, 27, .7);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid #cbbb99;
}

.dialog-kicker {
  display: block;
  color: #9a4037;
  font-size: 11px;
  font-weight: 900;
}

.dialog-header h2 {
  margin: 3px 0 0;
  font-size: 23px;
}

.dialog-close {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid #978868;
  border-radius: 50%;
  color: #413b31;
  background: #fffaf0;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.dialog-body {
  padding: 16px 20px 6px;
}

.guide-note {
  margin: 0 0 14px;
  color: #565a5d;
  font-size: 13px;
  line-height: 1.6;
}

.guide-steps {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-steps li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  min-height: 50px;
  padding: 8px 10px;
  border-left: 3px solid #557b8c;
  background: #fffaf0;
  font-size: 14px;
  line-height: 1.45;
}

.guide-steps b {
  color: #944037;
  font-size: 17px;
}

.dialog-done {
  display: block;
  width: calc(100% - 40px);
  height: 48px;
  margin: 14px 20px 20px;
  border: 0;
  color: #fff;
  background: #a3473c;
  font-weight: 900;
  cursor: pointer;
}

.dialog-copy {
  display: block;
  width: calc(100% - 40px);
  height: 44px;
  margin: 14px 20px -4px;
  border: 1px solid #807250;
  color: #4a4234;
  background: #fffaf0;
  font-weight: 800;
  cursor: pointer;
}

.dialog-copy[hidden] {
  display: none;
}

@keyframes mascot-bob {
  0%, 100% { transform: translateY(0) rotate(2deg); }
  50% { transform: translateY(-7px) rotate(-1deg); }
}

@keyframes enter-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12) drop-shadow(0 0 8px rgba(196, 77, 55, .28)); }
}

@media (min-width: 760px) and (min-height: 760px) {
  .launcher-shell {
    grid-template-rows: auto minmax(280px, 1fr) auto auto;
    padding-inline: 46px;
  }

  .game-showcase {
    min-height: 320px;
  }
}

@media (max-height: 720px) {
  .launcher-shell {
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .brand-title {
    width: min(62vw, 300px);
  }

  .game-showcase {
    min-height: 190px;
    margin-top: 0;
  }

  .showcase-art {
    max-height: 31svh;
  }

  .launcher-actions h1 {
    font-size: 27px;
  }

  .game-button.is-enter {
    height: 62px;
  }
}

@media (max-width: 480px) {
  .launcher-shell {
    padding-inline: 14px;
  }

  .platform-actions {
    gap: 6px;
  }

  .platform-actions .game-button {
    height: 58px;
    padding-inline: 7px;
    font-size: 13px;
  }

  .launcher-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .launcher-footer span {
    width: 100%;
  }

  .launcher-footer span[aria-hidden] {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
