:root {
  --ink: #24384e;
  --blue: #4682b4;
  --deep-blue: #1f4e9a;
  --deep-red: #9b1d20;
  --pale-blue: #cfe8fb;
  --pale-red: #f3bcbc;
  --page: #eef5fb;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #18232d; }
body { font-family: YouYuan, "Microsoft YaHei", "PingFang SC", sans-serif; color: var(--ink); user-select: none; }
button { font: inherit; }
#viewport { position: fixed; inset: 0; display: grid; place-items: center; overflow: hidden; }
.stage {
  position: absolute; left: 50%; top: 50%; margin-left: -800px; margin-top: -450px;
  width: 1600px; height: 900px; overflow: hidden; background: #fff;
  transform-origin: center center; box-shadow: 0 0 28px rgba(0,0,0,.35);
}
.stage.framed { background: var(--page) url("../pictures/相框.png") center/100% 100% no-repeat; }
.stage.plain { background: #fff; }
.screen { position: absolute; inset: 0; }
.hidden { display: none !important; }
.title { position: absolute; left: 230px; top: 110px; width: 1140px; text-align: center; font-size: 64px; font-weight: 700; line-height: 1.2; }
.body-copy { position: absolute; left: 232px; top: 238px; width: 1136px; min-height: 300px; font-size: 42px; line-height: 1.5; white-space: pre-line; }
.body-copy.center { text-align: center; }
.body-copy.compact { font-size: 34px; }
.intro-copy { font-size: 32px; line-height: 1.55; top: 230px; height: 224px; }
.intro-cover { position: absolute; left: 525px; top: 455px; width: 550px; height: 235px; object-fit: contain; }
.nav-row { position: absolute; left: 330px; top: 694px; width: 940px; display: flex; justify-content: space-between; align-items: center; }
.btn {
  min-width: 240px; min-height: 66px; padding: 10px 20px; border: 2px solid var(--blue);
  border-radius: 10px; color: var(--ink); background: rgba(207,232,251,.68); cursor: pointer;
  font-size: 34px; line-height: 1.25; transition: transform .08s, background .12s, border-color .12s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { cursor: default; color: #8996a2; border-color: #c7d0d8; background: #eef1f4; }
.btn.selected { background: rgba(243,188,188,.76); border: 4px solid var(--deep-red); }
.btn.primary { min-width: 330px; }
.btn.slim { min-height: 52px; font-size: 30px; }
.deep-red { color: var(--deep-red); }
.deep-blue { color: var(--deep-blue); }
.steel { color: var(--blue); }
.loading-screen h1 { position: absolute; top: 230px; left: 300px; width: 1000px; text-align: center; font-size: 72px; }
.loading-screen p { position: absolute; top: 400px; left: 350px; width: 900px; text-align: center; font-size: 34px; }
.progress { position: absolute; top: 510px; left: 400px; width: 800px; height: 28px; border-radius: 14px; background: #d8e4ec; overflow: hidden; }
.progress > div { width: 0; height: 100%; background: var(--blue); transition: width .2s; }
.fatal { position: fixed; inset: 0; z-index: 100; padding: 10vh 10vw; background: #fff; color: #8d1115; font: 28px/1.55 "Microsoft YaHei", sans-serif; white-space: pre-wrap; overflow: auto; }

/* Game number */
.entry-title { top: 118px; }
.entry-subtitle { position: absolute; left: 300px; top: 232px; width: 1000px; text-align: center; font-size: 48px; font-weight: 700; }
.number-box { position: absolute; left: 475px; top: 320px; width: 650px; height: 112px; border: 4px solid var(--blue); border-radius: 14px; background: rgba(255,255,255,.78); text-align: center; font-size: 78px; letter-spacing: 20px; line-height: 104px; }
.entry-help { position: absolute; left: 310px; top: 452px; width: 980px; text-align: center; font-size: 32px; }
.entry-error { position: absolute; left: 260px; top: 492px; width: 1080px; text-align: center; color: var(--deep-red); font-size: 30px; font-weight: 700; }
.digits { position: absolute; left: 155px; top: 552px; width: 1290px; display: grid; grid-template-columns: repeat(10, 1fr); gap: 13px; }
.digit { min-width: 0; height: 88px; padding: 0; font-size: 50px; }
.entry-actions { position: absolute; left: 460px; top: 686px; width: 680px; display: flex; justify-content: space-between; }

/* Rules */
.rules-lines { position: absolute; left: 245px; top: 242px; width: 1150px; font-size: 40px; line-height: 50px; }
.rules-lines p { height: 52px; margin: 0; white-space: nowrap; }

/* Countdown */
.countdown-title { position: absolute; left: 230px; top: 205px; width: 1140px; text-align: center; font-size: 64px; font-weight: 700; }
.countdown-value { position: absolute; left: 350px; top: 390px; width: 900px; text-align: center; font-size: 160px; font-weight: 700; color: var(--deep-red); }

/* Task */
.task-round { position: absolute; left: 22px; top: 15px; font-size: 42px; font-weight: 700; }
.task-counter { position: absolute; left: 190px; top: 22px; font-size: 29px; font-weight: 700; }
.timer { position: absolute; font-size: 32px; font-weight: 700; }
.question-image { position: absolute; object-fit: contain; }
.answer-slot { position: absolute; }
.answer-number { position: absolute; left: 0; top: 0; padding: 0; border-radius: 6px; font-size: 34px; font-weight: 700; }
.answer-image { position: absolute; object-fit: contain; pointer-events: none; }
.task-nav { position: absolute; height: 54px; }
.task-nav .btn { height: 54px; min-height: 54px; padding: 4px 18px; font-size: 32px; }
.preview-badge { position: absolute; z-index: 8; left: 325px; bottom: 4px; width: 950px; text-align: center; font-size: 22px; color: #8c502c; }

/* Choice screens */
.question-text { position: absolute; left: 190px; top: 145px; width: 1220px; height: 185px; display: grid; place-items: center; text-align: center; font-size: 50px; line-height: 1.35; }
.cards { position: absolute; left: 220px; top: 344px; width: 1160px; display: flex; gap: 15px; justify-content: center; }
.rating-card { width: 218px; height: 320px; padding: 10px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; font-size: 38px; }
.rating-card img { width: 128px; height: 128px; object-fit: contain; margin: 8px 0 4px; }
.rating-number { font-size: 44px; font-weight: 700; }
.rating-label { margin-top: 2px; text-align: center; font-size: 34px; line-height: 1.2; }
.number-grid { position: absolute; left: 302px; top: 365px; width: 996px; display: grid; grid-template-columns: repeat(6, 156px); gap: 28px 12px; justify-content: center; }
.number-grid .btn { min-width: 0; width: 156px; height: 104px; font-size: 62px; }
.two-cards { position: absolute; left: 252px; top: 359px; width: 1095px; display: flex; justify-content: space-between; }
.two-card { width: 520px; height: 255px; padding: 24px; display: grid; place-items: center; text-align: center; font-size: 42px; line-height: 1.35; }
.two-card.info-tip { font-size: 38px; white-space: nowrap; }
.choice-actions { position: absolute; left: 330px; top: 694px; width: 940px; display: flex; justify-content: space-between; }

/* Feedback */
.feedback-face { position: absolute; left: 649px; top: 255px; width: 302px; height: 302px; object-fit: contain; }
.feedback-label { position: absolute; left: 320px; top: 585px; width: 960px; text-align: center; font-size: 76px; font-weight: 700; }
.true-score { position: absolute; left: 120px; top: 345px; width: 1360px; text-align: center; font-size: 92px; font-weight: 700; }

/* Allocation */
.allocation-instruction { position: absolute; left: 80px; top: 104px; width: 1440px; text-align: center; font-size: 42px; color: var(--blue); }
.remaining { position: absolute; left: 300px; top: 168px; width: 1000px; text-align: center; font-size: 50px; }
.stars { position: absolute; left: 250px; top: 225px; width: 1100px; height: 152px; display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 8px 14px; }
.stars img { width: 72px; height: 72px; object-fit: contain; }
.alloc-cards { position: absolute; left: 46px; top: 390px; width: 1508px; display: flex; justify-content: space-between; }
.alloc-card { width: 344px; height: 355px; border: 2px solid #b7cfdd; background: #f4f8fb; display: flex; flex-direction: column; align-items: center; }
.alloc-card.practice { width: 380px; }
.alloc-icon { width: 126px; height: 126px; object-fit: contain; margin-top: 10px; }
.alloc-label { height: 56px; display: grid; place-items: center; text-align: center; font-size: 41px; line-height: 1.1; }
.alloc-count { font-size: 60px; line-height: 1.05; }
.alloc-controls { margin-top: 10px; display: flex; gap: 52px; }
.symbol { min-width: 86px; width: 86px; height: 72px; min-height: 72px; padding: 0; font-size: 58px; font-weight: 700; }
.allocation-actions { position: absolute; left: 454px; top: 802px; width: 692px; display: flex; justify-content: space-between; }
.allocation-actions .btn { min-width: 243px; min-height: 53px; font-size: 30px; }

/* Understanding and end */
.understanding-actions { position: absolute; left: 252px; top: 392px; width: 1095px; display: flex; justify-content: space-between; }
.understanding-actions .btn { width: 520px; height: 255px; font-size: 58px; }
.ending-image { position: absolute; inset: 0; width: 1600px; height: 900px; object-fit: fill; }
.save-panel { position: absolute; right: 18px; bottom: 16px; max-width: 520px; padding: 12px 14px; border-radius: 10px; background: rgba(255,255,255,.9); border: 1px solid #aac1cf; font-size: 20px; }
.save-panel .btn { min-width: 170px; min-height: 42px; font-size: 20px; margin: 6px 4px 0 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
