:root {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #292929;
  background: #18aee9;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}
button {
  font: inherit;
}
.screen {
  width: min(100vw, 562px);
  min-height: 100svh;
  margin: auto;
  position: relative;
  overflow: hidden;
  background: url("./images/p2_bg.png") center / 100% 100% no-repeat;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}
.cover {
  /* 封面必须完整露出左右两侧：按容器宽度缩放，竖向不足用原图底色续接。 */
  background-color: #acfafa;
  background-image: url("./images/p1_bg.png");
  background-position: top center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  cursor: pointer;
}
.cover-start {
  position: absolute;
  left: 50%;
  top: auto;
  bottom: 4.4%;
  transform: translateX(-50%);
  width: 35%;
  border: 0;
  background: transparent;
  padding: 0;
  filter: drop-shadow(0 5px 4px #d77700);
}
.cover-start img,
.img-btn img {
  display: block;
  width: 100%;
}
.cover-start img {
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    transform: scale(1.05);
  }
}
.rules-link {
  position: absolute;
  right: 0;
  top: 3.6%;
  border: 0;
  background: transparent;
  width: 25%;
  padding: 0;
}
.rules-link img {
  width: 100%;
}
.brand {
  width: 87%;
  display: block;
  margin: 5.5vh auto 2vh;
}
.level-card {
  width: 92%;
  margin: auto;
  background: linear-gradient(#fff9d6, #fff);
  border: 10px solid #ffb91b;
  border-radius: 38px;
  padding: 7vh 9% 8vh;
  box-shadow:
    inset 0 0 0 5px #ffe27a,
    0 12px 0 #f9940b;
}
.level-btn {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 78px;
  margin: 22px 0;
  border: 3px solid #ffd786;
  border-radius: 38px;
  background: linear-gradient(#ffb841, #ff7900);
  color: white;
  box-shadow:
    inset 0 3px 7px #fff7,
    0 5px 8px #ef8100;
  font-weight: 900;
  text-shadow: 0 2px #d35e00;
}
.level-btn:disabled {
  filter: grayscale(0.8);
  opacity: 0.62;
}
.level-no {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin-left: -12px;
  border-radius: 50%;
  background: linear-gradient(#ff8156, #ff9b28);
  border: 2px solid #ffe4a4;
  font-size: 15px;
}
.level-no b {
  display: block;
  font-size: 27px;
}
.level-name {
  flex: 1;
  font-size: 27px;
}
.level-score {
  font-size: 14px;
  margin-right: 22px;
}
.big-label {
  display: block;
  width: 72%;
  margin: -3vh auto 0;
  padding: 12px;
  border-radius: 32px;
  background: #efff55;
  color: #ff7900;
  text-align: center;
  font-size: 34px;
  font-weight: 900;
  border: 2px solid white;
  box-shadow: 0 7px 0 #f78c08;
}
.levels-screen {
  padding: 0;
  background-color: #f5e8c8;
  background-image: url("./images/p2_bg.png");
  background-position: top center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.p2-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 750 / 1334;
}
.p2-title-art {
  position: absolute;
  z-index: 2;
  inset: 0 0 auto;
  width: 100%;
  height: 24.7%;
  background: url("./images/p1_bg.png") top center / 100% auto no-repeat;
  -webkit-mask-image: linear-gradient(
    to bottom,
    #000 0,
    #000 94%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    #000 0,
    #000 94%,
    transparent 100%
  );
  pointer-events: none;
}
.levels-screen .rules-link {
  z-index: 5;
  top: 3.6%;
  right: 0;
  width: 25.2%;
}
.level-bg-art {
  position: absolute;
  z-index: 1;
  top: 27.8%;
  left: 50%;
  width: 97.1%;
  height: auto;
  transform: translateX(-50%);
  pointer-events: none;
}
.p2-level-btn {
  position: absolute;
  z-index: 3;
  left: 23.35%;
  width: 53.35%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.p2-level-btn img {
  display: block;
  width: 100%;
  height: auto;
}
.p2-level-btn:active:not(:disabled) {
  transform: scale(0.97);
  filter: brightness(1.05);
}
.p2-level-btn:disabled {
  opacity: 1;
  filter: none;
  cursor: default;
}
.p2-level-1 {
  top: 39.3%;
}
.p2-level-2 {
  top: 51.2%;
}
.p2-level-3 {
  top: 63.05%;
}
.attempts-used {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 75.5%;
  transform: translateX(-50%);
  padding: 8px 18px;
  border-radius: 999px;
  background: #003d2dcc;
  color: white;
  font-size: 14px;
  white-space: nowrap;
}
.quiz-screen,
.result-screen {
  padding: 0;
  background-color: #f5e8c8;
  background-image: url("./images/p2_bg.png");
  background-position: top center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.quiz-stage,
.result-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 750 / 1334;
}
.quiz-back {
  position: absolute;
  z-index: 5;
  top: 2.05%;
  left: 3.7%;
  width: 13.35%;
  border: 0;
  padding: 0;
  background: transparent;
}
.quiz-back img,
.quiz-progress img,
.quiz-frame-art,
.quiz-intro-confirm img,
.result-art,
.draw-envelope-art,
.draw-claim img,
.rules-content-art,
.rules-confirm img {
  display: block;
  width: 100%;
  height: auto;
}
.quiz-progress {
  position: absolute;
  z-index: 5;
  top: 3.2%;
  right: 1.8%;
  width: 19.5%;
}
.quiz-progress span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-left: 20%;
  color: white;
  font-size: clamp(13px, 3.8vw, 21px);
  font-weight: 900;
  text-shadow: 0 1px 2px #ba6c00;
}
.quiz-frame-art {
  position: absolute;
  z-index: 1;
  top: 11.9%;
  left: 4.6%;
  width: 90.8%;
}
.quiz-intro-confirm {
  position: absolute;
  z-index: 4;
  top: 87.7%;
  left: 32.65%;
  width: 34.7%;
  border: 0;
  padding: 0;
  background: transparent;
}
.quiz-content {
  position: absolute;
  z-index: 3;
  top: 35.2%;
  left: 9.1%;
  width: 81.8%;
  height: 50.2%;
  overflow-y: auto;
  padding: 4px 3px 18px;
  scrollbar-width: none;
}
.quiz-content:not(.vision-content):not(.scene-content) {
  top: 37.45%;
  height: 48%;
}
.quiz-content::-webkit-scrollbar {
  display: none;
}
.quiz-content .question {
  margin: 0 0 12px;
  color: #333;
  font-size: clamp(15px, 4.15vw, 21px);
  line-height: 1.55;
  font-weight: 700;
}
.quiz-content .options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.quiz-content .option {
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 2px solid #ffbf00;
  border-radius: 999px;
  background: #fff;
  padding: 8px 10px;
  color: #333;
  font-size: clamp(14px, 4vw, 19px);
  font-weight: 700;
  text-align: center;
}
.quiz-content:not(.vision-content):not(.scene-content) .options {
  width: 84%;
  margin: 34px auto 0;
}
.quiz-content .option .mark {
  flex: 0 0 auto;
  width: auto;
  height: auto;
  display: inline;
  border-radius: 0;
  background: transparent;
  color: inherit;
}
.quiz-content .option .mark::after {
  content: ".";
  margin-right: 2px;
}
.quiz-content .option.selected {
  border-color: #ffbf00;
  background: #ffbf00;
  box-shadow: none;
}
.quiz-content .option.selected:not(.image-option) .mark {
  background: transparent;
  color: inherit;
}
.quiz-content .image-options {
  width: 94%;
  margin: 0 auto;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: 5.8%;
  row-gap: 22px;
}
.quiz-content .image-option {
  position: relative;
  grid-column: span 2;
  min-height: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.quiz-content .image-option:nth-child(4) {
  grid-column: 2 / span 2;
}
.quiz-content .image-option:nth-child(5) {
  grid-column: 4 / span 2;
}
.quiz-content .image-option img {
  width: 100%;
  height: auto;
  aspect-ratio: 160 / 191;
  object-fit: cover;
  border-radius: 0;
}
.quiz-content .image-option .mark {
  position: absolute;
  left: 50%;
  bottom: -11px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  border: 1px solid #81da54;
  border-radius: 50%;
  background: #f4ff9c;
  color: #148a17;
  font-size: 14px;
}
.quiz-content .image-option .mark::after {
  content: "";
  margin: 0;
}
.quiz-content .image-option.selected img {
  outline: 3px solid #81da54;
  outline-offset: 2px;
}
.quiz-content .image-option.selected {
  border: 0;
  background: transparent;
  box-shadow: none;
}
.quiz-content .image-option.selected .mark {
  background: #81da54;
  color: white;
}
.quiz-content .scene-image {
  max-height: 160px;
  margin: 0 auto 10px;
}
.quiz-next-wrap {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  top: 87.2%;
  text-align: center;
}
.quiz-next-wrap .primary {
  min-width: 34.7%;
  margin: 0;
  padding: 9px 26px;
  font-size: clamp(18px, 5vw, 27px);
}
.result-art {
  position: absolute;
  z-index: 1;
  top: 13.5%;
  left: 1.65%;
  width: 96.7%;
}
.result-action {
  position: absolute;
  z-index: 4;
  top: 70%;
  left: 32.5%;
  width: 35%;
  height: 7%;
  border: 0;
  border-radius: 999px;
  background: transparent;
}
.draw-shade {
  position: absolute;
  z-index: 2;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}
.draw-popup {
  position: absolute;
  z-index: 3;
  inset: 0;
}
.draw-envelope-art {
  position: absolute;
  top: 21.6%;
  left: 11.05%;
  width: 77.9%;
}
.draw-copy {
  position: absolute;
  z-index: 2;
  top: 33.5%;
  left: 14%;
  width: 72%;
  text-align: center;
  color: #111;
}
.draw-copy strong {
  display: block;
  font-size: clamp(27px, 7.5vw, 42px);
  font-weight: 400;
}
.draw-copy p {
  margin: 18px 0 0;
  font-size: clamp(24px, 6.5vw, 37px);
}
.draw-copy b {
  color: red;
  font-size: 1.45em;
}
.draw-claim {
  position: absolute;
  z-index: 3;
  top: 71.1%;
  left: 31.45%;
  width: 37.1%;
  border: 0;
  padding: 0;
  background: transparent;
}
.rules-modal {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: flex;
  justify-content: center;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.72);
}
.rules-modal-stage {
  position: relative;
  width: min(100vw, 562px);
  aspect-ratio: 750 / 1334;
  flex: 0 0 auto;
}
.rules-content-art {
  position: absolute;
  top: 24.7%;
  left: 10.75%;
  width: 78.55%;
}
.rules-confirm {
  position: absolute;
  top: 71.1%;
  left: 32.65%;
  width: 34.7%;
  border: 0;
  padding: 0;
  background: transparent;
}
.modal {
  position: fixed;
  z-index: 10;
  inset: 0;
  background: #001725c7;
  display: grid;
  place-items: center;
  padding: 24px;
}
.dialog {
  width: min(92vw, 460px);
  background: linear-gradient(#ffb32d 0 19%, #fffdf0 19%);
  border: 4px solid #ff9b17;
  border-radius: 24px;
  padding: 24px 18px 28px;
  box-shadow: 0 12px 40px #0007;
  text-align: center;
}
.dialog h2 {
  color: white;
  margin: 0 0 30px;
  font-size: 28px;
}
.dialog p {
  font-size: 18px;
  line-height: 1.75;
  margin: 0;
}
.accent {
  color: #ff7900;
  font-weight: 900;
}
.primary,
.secondary {
  border: 0;
  border-radius: 28px;
  padding: 11px 34px;
  margin-top: 24px;
  background: linear-gradient(#fff84d, #ff9d00);
  color: white;
  font-size: 22px;
  font-weight: 900;
  text-shadow: 0 2px #c86900;
  box-shadow:
    inset 0 2px #fff,
    0 5px 0 #de7900;
}
.secondary {
  background: white;
  color: #e87900;
  text-shadow: none;
  border: 2px solid #ffb514;
  box-shadow: none;
  margin-left: 8px;
}
.quiz {
  padding-top: max(18px, env(safe-area-inset-top));
}
.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.back {
  border: 0;
  background: url("./images/back_btn.png") center/contain no-repeat;
  width: 64px;
  height: 50px;
}
.progress {
  background: linear-gradient(#ffe666, #ff9b00);
  border: 2px solid white;
  border-radius: 20px;
  color: white;
  font-weight: 900;
  padding: 5px 14px;
  box-shadow: 0 2px 3px #bf7400;
}
.quiz-title {
  width: 72%;
  margin: 28px auto 20px;
  background: #fff;
  border: 6px solid #ffb000;
  border-radius: 40px;
  text-align: center;
  color: #ff7900;
  font-size: 34px;
  font-weight: 900;
  padding: 10px;
}
.paper {
  position: relative;
  min-height: 65vh;
  background: #fff;
  border: 9px solid #ffb400;
  border-radius: 22px;
  padding: 28px 22px 76px;
  box-shadow: 0 8px 0 #f18b00;
}
.question {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.55;
  margin: 0 0 18px;
}
.hint {
  background: #f0f0f0;
  color: #666;
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
  margin-bottom: 16px;
}
.options {
  display: grid;
  gap: 12px;
}
.option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 2px solid #ffd069;
  background: #fff9e7;
  border-radius: 14px;
  padding: 12px;
  text-align: left;
  line-height: 1.45;
}
.option.selected {
  border-color: #ff8a00;
  background: #fff0c4;
  box-shadow: 0 0 0 2px #ffb82a;
}
.mark {
  flex: 0 0 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffd85a;
  color: #a95400;
  font-weight: 900;
}
.option.selected .mark {
  background: #ff8a00;
  color: white;
}
.image-options {
  grid-template-columns: repeat(2, 1fr);
}
.image-option {
  padding: 7px;
  display: block;
}
.image-option img {
  display: block;
  width: 100%;
  height: 138px;
  object-fit: cover;
  border-radius: 9px;
}
.image-option .mark {
  margin: 5px auto 0;
}
.scene-image {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: 14px;
  margin-bottom: 14px;
}
.next-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  text-align: center;
}
.next-wrap .primary {
  margin: 0;
}
.result-card {
  margin: 14vh auto 0;
  width: 92%;
  background: #fffdf7;
  border: 8px solid #f8a435;
  border-radius: 28px;
  padding: 60px 24px 45px;
  text-align: center;
  box-shadow: 0 12px 0 #f18c18;
}
.result-card h1 {
  color: #fa6c31;
  font-size: 36px;
}
.score {
  font-size: 62px;
  color: #ff7900;
  font-weight: 900;
  line-height: 1;
}
.result-card p {
  font-size: 19px;
  line-height: 1.8;
}
.medal {
  font-size: 82px;
}
.draw-card {
  margin-top: 14vh;
}
.envelope {
  margin: 25px auto 10px;
  padding: 65px 20px;
  background: linear-gradient(#fffdf0, #fff0aa 55%, #fa3126 56%);
  border: 4px solid #ff6046;
  border-radius: 30px;
  font-size: 24px;
}
.money {
  font-size: 52px;
  color: red;
  font-weight: 900;
}
.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 9%;
  transform: translateX(-50%) translateY(20px);
  background: #102a3fe8;
  color: white;
  border-radius: 24px;
  padding: 10px 20px;
  opacity: 0;
  transition: 0.25s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
@media (max-height: 700px) {
  .brand {
    margin-top: 2vh;
    width: 68%;
  }
  .level-card {
    padding-top: 2vh;
    padding-bottom: 3vh;
  }
  .level-btn {
    margin: 12px 0;
    min-height: 60px;
  }
  .level-no {
    height: 58px;
    width: 58px;
  }
  .paper {
    min-height: 62vh;
  }
  .quiz-title {
    margin: 10px auto;
  }
  .result-card {
    margin-top: 7vh;
  }
}
