:root {
  --paper: #f7f1e5;
  --paper-deep: #eee3d0;
  --ink: #292722;
  --muted: #7a756c;
  --red: #a82f35;
  --red-dark: #7c1f26;
  --desk: #7b5946;
  --cream: #fbf6ed;
  --hand: "STKaiti", "KaiTi", "FangSong", serif;
  --sans: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: #4f382e;
  color: var(--ink);
  font-family: var(--sans);
}

body {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-shell,
.scene {
  width: 100%;
  height: 100svh;
  min-height: 620px;
}

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .7s ease, visibility .7s;
}

.scene.is-active {
  z-index: 2;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.music-toggle {
  position: fixed;
  z-index: 50;
  top: 22px;
  right: 24px;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 50%;
  background: rgba(39, 31, 27, .48);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  backdrop-filter: blur(8px);
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity .3s, transform .3s, background .3s;
}

.music-toggle.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.music-toggle:hover {
  background: rgba(124, 31, 38, .82);
}

.music-disc {
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(255, 255, 255, .75);
  border-radius: 50%;
  animation: spin 8s linear infinite;
}

.music-toggle.is-paused .music-disc {
  animation-play-state: paused;
}

.music-bars {
  height: 15px;
  display: flex;
  align-items: end;
  gap: 2px;
}

.music-bars i {
  display: block;
  width: 2px;
  height: 6px;
  background: white;
  animation: sound .8s ease-in-out infinite alternate;
}

.music-bars i:nth-child(2) {
  height: 13px;
  animation-delay: -.35s;
}

.music-bars i:nth-child(3) {
  height: 9px;
  animation-delay: -.6s;
}

.music-toggle.is-paused .music-bars i {
  height: 3px;
  animation: none;
}

/* P1 — exam */
.scene-exam {
  overflow-x: hidden;
  overflow-y: auto;
  background:
    linear-gradient(rgba(42, 25, 18, .18), rgba(42, 25, 18, .18)),
    repeating-linear-gradient(90deg, transparent 0 68px, rgba(255, 255, 255, .025) 69px 70px),
    #7d5c49;
  padding: 42px 18px 80px;
}

.scene-exam::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 18%, rgba(255, 235, 201, .28), transparent 48%);
}

.desk-shadow {
  position: absolute;
  left: 50%;
  top: 75px;
  width: min(900px, 92vw);
  height: calc(100% - 120px);
  transform: translateX(-50%) rotate(-1.2deg);
  background: rgba(28, 14, 10, .3);
  filter: blur(25px);
}

.exam-paper {
  position: relative;
  width: min(830px, calc(100vw - 36px));
  min-height: 1040px;
  margin: 0 auto;
  padding: 54px 62px 32px;
  background:
    repeating-linear-gradient(0deg, rgba(75, 55, 35, .018) 0 1px, transparent 1px 4px),
    var(--paper);
  border: 1px solid rgba(95, 70, 46, .25);
  box-shadow: 0 24px 65px rgba(28, 13, 8, .32), inset 0 0 90px rgba(142, 108, 66, .07);
  transform: rotate(.25deg);
}

.exam-paper::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(75, 55, 35, .18);
  pointer-events: none;
}

.paper-pin {
  position: absolute;
  top: 22px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8f897c;
  box-shadow: inset 1px 1px 2px rgba(255, 255, 255, .5), 1px 2px 4px rgba(0, 0, 0, .24);
}

.pin-left {
  left: 30px;
}

.pin-right {
  right: 30px;
}

.exam-header {
  text-align: center;
  border-bottom: 3px double var(--ink);
  padding-bottom: 19px;
}

.exam-kicker {
  font: 700 10px/1 var(--sans);
  letter-spacing: .32em;
  color: var(--red);
}

.exam-header h1 {
  margin: 13px 0 8px;
  font-family: "SimSun", serif;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: .35em;
  text-indent: .35em;
}

.exam-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .1em;
}

.admission-card {
  position: relative;
  margin: 27px 0 24px;
  padding: 19px 24px 15px 105px;
  border: 1px solid var(--ink);
  background: rgba(255, 255, 255, .18);
  overflow: hidden;
}

.admission-title {
  position: absolute;
  inset: 0 auto 0 0;
  width: 82px;
  display: grid;
  place-items: center;
  writing-mode: vertical-rl;
  letter-spacing: .32em;
  font: 700 18px/1 "SimSun", serif;
  color: var(--paper);
  background: var(--ink);
}

.admission-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px 28px;
  margin: 0 0 14px;
}

.admission-card dl div {
  display: flex;
  gap: 11px;
  align-items: baseline;
  border-bottom: 1px dotted rgba(41, 39, 34, .42);
  padding-bottom: 5px;
}

.admission-card dt {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.admission-card dd {
  margin: 0;
  font: 700 15px/1.3 var(--hand);
  letter-spacing: .03em;
}

.admission-card dd.duration-value {
  color: var(--red-dark);
  font-size: 21px;
  line-height: 1;
}

.ticket-code {
  height: 12px;
  display: flex;
  gap: 3px;
  opacity: .72;
}

.ticket-code span {
  display: block;
  width: 4px;
  background: var(--ink);
}

.ticket-code span:nth-child(2),
.ticket-code span:nth-child(5) {
  width: 14px;
}

.ticket-code span:nth-child(4) {
  width: 32px;
}

.exam-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .18em;
}

.exam-rule span {
  height: 1px;
  flex: 1;
  background: rgba(41, 39, 34, .23);
}

.question-block {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 17px;
  min-height: 170px;
  padding: 25px 15px 23px 5px;
  border-bottom: 1px dashed rgba(41, 39, 34, .25);
}

.question-number {
  align-self: start;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--ink);
  font: 700 12px/1 var(--sans);
}

.question-content h2 {
  margin: 4px 0 9px;
  font: 500 clamp(17px, 2.4vw, 21px)/1.8 "SimSun", serif;
}

.question-hint {
  margin: 0 0 18px;
  color: #8b857b;
  font-size: 11px;
  letter-spacing: .04em;
}

.answer-blank {
  appearance: none;
  border: 0;
  border-bottom: 1.5px solid var(--ink);
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--red-dark);
  font: 700 21px/1.3 var(--hand);
  text-align: center;
  transition: border-color .2s, background .2s;
}

.answer-blank:focus {
  border-color: var(--red);
  background: rgba(168, 47, 53, .045);
}

.answer-years {
  width: 68px;
  margin: 0 5px;
}

.date-fields {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 4px 0 18px;
}

.date-fields label {
  display: flex;
  align-items: flex-end;
  gap: 5px;
}

.date-fields b {
  padding-bottom: 6px;
  font: 500 17px/1 var(--hand);
}

.date-part {
  width: 52px;
  height: 37px;
  text-align: center;
}

.date-year {
  width: 90px;
}

.date-part::placeholder {
  color: #aaa297;
  font-weight: 400;
}

.ink-button {
  min-width: 102px;
  height: 36px;
  padding: 0 17px;
  border: 1px solid rgba(41, 39, 34, .75);
  background: transparent;
  font-size: 12px;
  letter-spacing: .08em;
  cursor: pointer;
  transition: color .2s, background .2s, border-color .2s, transform .2s;
}

.ink-button:hover {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
  transform: translateY(-1px);
}

.ink-button:disabled {
  opacity: .42;
  cursor: default;
  transform: none;
}

.teacher-mark {
  position: absolute;
  right: 16px;
  bottom: 22px;
  max-width: 270px;
  color: var(--red);
  font: 700 20px/1.25 var(--hand);
  transform: rotate(-5deg);
  text-align: right;
  opacity: 0;
}

.teacher-mark.is-showing {
  animation: markIn .35s cubic-bezier(.2, 1.7, .5, 1) forwards;
}

.teacher-mark .big-check {
  display: inline-block;
  margin-right: 7px;
  font: 700 68px/.35 var(--hand);
  vertical-align: -14px;
}

.teacher-mark .big-cross {
  display: inline-block;
  margin-right: 7px;
  font: 700 60px/.35 var(--hand);
  vertical-align: -11px;
}

.teacher-mark .underline-note {
  border-bottom: 2px solid currentColor;
}

.danger-note {
  height: 0;
  margin-left: 62px;
  color: var(--red);
  font: 700 24px/1 var(--hand);
  overflow: hidden;
  transform: rotate(-2deg);
  opacity: 0;
  transition: height .5s ease, opacity .3s, margin .5s;
}

.danger-note.is-visible {
  height: 58px;
  margin-top: 21px;
  margin-bottom: 3px;
  opacity: 1;
}

.danger-note .pen-icon {
  font-size: 21px;
}

.danger-note i {
  display: inline-block;
  width: 88px;
  height: 11px;
  margin-left: 9px;
  border-top: 2px solid var(--red);
  transform: rotate(-4deg);
}

.question-two {
  max-height: 0;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(12px);
  transition: max-height .65s ease, min-height .65s ease, padding .65s ease, opacity .5s .15s, transform .55s .1s;
}

.question-two.is-visible {
  max-height: 260px;
  min-height: 205px;
  padding-top: 25px;
  padding-bottom: 23px;
  opacity: 1;
  transform: translateY(0);
}

.exam-footer {
  position: absolute;
  left: 62px;
  right: 62px;
  bottom: 28px;
  display: flex;
  justify-content: space-between;
  color: #8d867c;
  font-size: 9px;
  letter-spacing: .04em;
  transition: opacity .3s;
}

.exam-paper.is-completed .exam-footer {
  opacity: 0;
}

.seal {
  position: absolute;
  z-index: 7;
  pointer-events: none;
  right: 78px;
  bottom: 170px;
  width: 130px;
  height: 130px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  place-items: center;
  border: 7px double var(--red);
  color: var(--red);
  font: 700 31px/1 var(--hand);
  opacity: 0;
  transform: scale(3.3) rotate(-17deg);
  filter: blur(2px);
  mix-blend-mode: multiply;
}

.seal::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid currentColor;
}

.seal.is-stamped {
  animation: stamp .52s cubic-bezier(.1, 1.15, .45, 1) forwards;
}

.full-score {
  position: absolute;
  z-index: 8;
  pointer-events: none;
  left: 50%;
  bottom: 148px;
  width: max-content;
  color: var(--red);
  font: 800 clamp(25px, 5vw, 44px)/1 var(--hand);
  letter-spacing: .05em;
  opacity: 0;
  transform: translate(-50%, 30px) rotate(-3deg);
  text-shadow: 0 1px 0 rgba(168, 47, 53, .2);
}

.full-score.is-visible {
  animation: scoreFloat 1.5s .28s ease forwards;
}

.forever-score {
  position: absolute;
  z-index: 9;
  left: 50%;
  bottom: 91px;
  width: max-content;
  max-width: calc(100% - 40px);
  color: var(--red);
  font: 700 clamp(20px, 3.3vw, 29px)/1.25 var(--hand);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 15px) rotate(-1.5deg);
  pointer-events: none;
}

.forever-score.is-visible {
  animation: foreverIn .65s ease forwards;
}

.to-memory-button {
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: 40px;
  height: 38px;
  padding: 0 16px 0 19px;
  border: 1px solid var(--red-dark);
  background: var(--paper);
  color: var(--red-dark);
  font-size: 11px;
  letter-spacing: .1em;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 12px);
  pointer-events: none;
  cursor: pointer;
  transition: color .2s, background .2s, opacity .45s, transform .45s, visibility .45s;
}

.to-memory-button b {
  margin-left: 10px;
  font-size: 17px;
  font-weight: 400;
}

.to-memory-button.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.to-memory-button:hover {
  background: var(--red-dark);
  color: var(--paper);
}

.name-gate {
  position: fixed;
  z-index: 20;
  inset: 0;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(32, 20, 15, .62);
  backdrop-filter: blur(7px);
  transition: opacity .55s, visibility .55s;
}

.name-gate.is-gone {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.name-card {
  position: relative;
  width: min(460px, 100%);
  padding: 58px 52px 38px;
  background:
    repeating-linear-gradient(0deg, rgba(75, 55, 35, .02) 0 1px, transparent 1px 4px),
    var(--paper);
  border: 1px solid #d7c8b2;
  box-shadow: 0 30px 90px rgba(22, 10, 6, .45);
  transform: rotate(-.45deg);
}

.name-card::before {
  content: "";
  position: absolute;
  inset: 13px;
  border: 1px solid rgba(41, 39, 34, .14);
}

.name-card-top {
  position: absolute;
  inset: 0 0 auto;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: white;
  font-size: 10px;
  letter-spacing: .28em;
}

.mini-stamp {
  position: absolute;
  z-index: 2;
  top: 49px;
  right: 40px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 2px solid var(--red);
  color: var(--red);
  font: 700 12px/1.05 var(--hand);
  text-align: center;
  transform: rotate(9deg);
}

.gate-eyebrow {
  margin: 0 0 9px;
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .24em;
}

.name-card h2 {
  position: relative;
  margin: 0 0 28px;
  font: 700 29px/1.35 "SimSun", serif;
  letter-spacing: .08em;
}

.name-card > p:not(.gate-eyebrow) {
  position: relative;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 12px;
}

.name-card label {
  position: relative;
  display: block;
  margin-bottom: 8px;
  color: #70695f;
  font-size: 11px;
  letter-spacing: .12em;
}

.name-card input {
  position: relative;
  width: 100%;
  height: 50px;
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  outline: none;
  background: rgba(255, 255, 255, .24);
  color: var(--red-dark);
  font: 700 25px/1 var(--hand);
  padding: 0 11px;
}

.field-error {
  position: relative;
  min-height: 25px;
  padding-top: 5px;
  color: var(--red);
  font: 700 13px/1.2 var(--hand);
}

.start-button {
  position: relative;
  width: 100%;
  height: 52px;
  padding: 0 17px 0 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 0;
  background: var(--red-dark);
  color: white;
  letter-spacing: .12em;
  cursor: pointer;
  transition: background .2s, transform .2s;
}

.start-button:hover {
  background: #921f29;
  transform: translateY(-2px);
}

.start-button b {
  font-size: 23px;
  font-weight: 400;
}

.name-card small {
  position: relative;
  display: block;
  margin-top: 19px;
  text-align: center;
  color: var(--red-dark);
  font: 700 16px/1.3 var(--hand);
  letter-spacing: .12em;
}

.barrage {
  position: fixed;
  z-index: 15;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.barrage span {
  position: absolute;
  left: var(--start-x);
  top: var(--start-y);
  width: max-content;
  color: var(--red-dark);
  font: 800 clamp(18px, 3vw, 32px)/1 var(--hand);
  text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, 0 2px 7px rgba(0, 0, 0, .15);
  transform: translate(-50%, -50%);
  animation: barrageTravel var(--duration) linear var(--delay) both;
}

.truth-overlay {
  position: fixed;
  z-index: 18;
  inset: 0;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(30, 18, 13, .62);
  backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .42s, visibility .42s;
}

.truth-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.truth-card {
  position: relative;
  width: min(570px, 100%);
  padding: 64px 42px 42px;
  background:
    repeating-linear-gradient(0deg, transparent 0 36px, rgba(76, 108, 132, .15) 37px 38px),
    #fbf5e9;
  box-shadow: 0 25px 80px rgba(0, 0, 0, .38);
  text-align: center;
  transform: rotate(-1.3deg) translateY(25px);
  transition: transform .55s cubic-bezier(.2, 1.1, .4, 1);
}

.truth-overlay.is-visible .truth-card {
  transform: rotate(-1.3deg) translateY(0);
}

.tape {
  position: absolute;
  top: -15px;
  width: 105px;
  height: 38px;
  background: rgba(221, 202, 165, .68);
  box-shadow: inset 0 0 8px rgba(112, 91, 57, .08);
}

.tape-left {
  left: 15px;
  transform: rotate(-15deg);
}

.tape-right {
  right: 15px;
  transform: rotate(13deg);
}

.truth-label {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--red);
  color: var(--red);
  font: 700 12px/1.2 var(--hand);
  transform: rotate(3deg);
}

.truth-card p {
  margin: 27px 0 34px;
  color: #4b4039;
  font: 700 clamp(23px, 5vw, 35px)/1.7 var(--hand);
}

.hand-in-button {
  width: 132px;
  height: 47px;
  border: 1px solid var(--red-dark);
  background: var(--red-dark);
  color: white;
  font: 700 16px/1 var(--hand);
  letter-spacing: .3em;
  text-indent: .3em;
  cursor: pointer;
  transition: background .2s, transform .2s;
}

.hand-in-button:hover {
  background: #9b2730;
  transform: translateY(-2px);
}

/* P2 — memory pages */
.scene-memory {
  background: #070a17;
  color: #f7efe4;
}

.star-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 115%, rgba(74, 60, 128, .34), transparent 45%),
    radial-gradient(circle at 18% 28%, rgba(45, 70, 128, .17), transparent 28%),
    #070a17;
}

.star {
  position: absolute;
  left: var(--star-x);
  top: var(--star-y);
  width: var(--star-size);
  height: var(--star-size);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 calc(var(--star-size) * 4) rgba(205, 218, 255, .8);
  opacity: var(--star-opacity);
  animation: starTwinkle var(--star-duration) ease-in-out var(--star-delay) infinite alternate;
}

.shooting-star {
  position: absolute;
  left: var(--shoot-x);
  top: var(--shoot-y);
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .9));
  transform: rotate(-35deg) translateX(-180px);
  opacity: 0;
  animation: starShoot var(--shoot-duration) ease-in var(--shoot-delay) infinite;
}

.memory-grain {
  position: absolute;
  inset: 0;
  opacity: .3;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, transparent 0 5px, rgba(255, 255, 255, .015) 6px),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, .025) 4px);
  mix-blend-mode: overlay;
}

.memory-header {
  position: absolute;
  z-index: 5;
  top: 34px;
  left: 5vw;
  right: 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .3em;
}

.memory-header > div {
  display: flex;
  align-items: center;
  gap: 13px;
}

.memory-header i {
  width: 65px;
  height: 1px;
  background: currentColor;
  opacity: .6;
}

.memory-header b {
  font: 500 11px/1 Georgia, serif;
}

.memory-center {
  position: relative;
  z-index: 4;
  width: min(900px, 86vw);
  height: 100%;
  min-height: 620px;
  margin: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 0 120px;
}

.memory-overline {
  margin: 0 0 12px 9%;
  color: #d6b788;
  font: 700 11px/1 var(--sans);
  letter-spacing: .28em;
}

.memory-number {
  position: absolute;
  left: 0;
  top: 50%;
  color: rgba(255, 255, 255, .07);
  font: italic 700 clamp(170px, 32vw, 390px)/.7 Georgia, serif;
  transform: translateY(-52%);
  user-select: none;
}

.memory-text-wrap {
  position: relative;
  min-height: 200px;
  margin-left: 9%;
  display: flex;
  align-items: center;
}

.memory-text {
  position: relative;
  max-width: 760px;
  margin: 0;
  color: #fffaf2;
  font: 500 clamp(25px, 4.2vw, 50px)/1.55 var(--hand);
  letter-spacing: .02em;
  text-wrap: balance;
  text-shadow: 0 5px 28px rgba(0, 0, 0, .23);
}

.memory-text.is-refreshing {
  animation: textRefresh .72s cubic-bezier(.2, .8, .2, 1) both;
}

.memory-text .crossed {
  position: relative;
  display: inline-block;
  color: #d8b78c;
}

.memory-text .crossed::after,
.memory-text .crossed::before {
  content: "";
  position: absolute;
  left: -5%;
  top: 53%;
  width: 0;
  height: 2px;
  background: #d8b78c;
  transform: rotate(-10deg);
  animation: crossOut .7s .45s ease forwards;
}

.memory-text .crossed::before {
  transform: rotate(11deg);
  animation-delay: .65s;
}

.memory-dots {
  position: absolute;
  z-index: 6;
  left: 9%;
  bottom: 15vh;
  display: flex;
  gap: 9px;
}

.memory-dots i {
  width: 26px;
  height: 2px;
  background: rgba(255, 255, 255, .2);
  transition: width .35s, background .35s;
}

.memory-dots i.is-current {
  width: 54px;
  background: #d6b788;
}

.memory-next-button {
  position: absolute;
  z-index: 7;
  right: 4%;
  bottom: 13vh;
  height: 40px;
  padding: 0 16px 0 19px;
  border: 1px solid rgba(255, 255, 255, .48);
  background: rgba(7, 10, 23, .38);
  color: #fffaf2;
  font-size: 12px;
  letter-spacing: .14em;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  pointer-events: none;
  cursor: pointer;
  backdrop-filter: blur(5px);
  transition: color .2s, background .2s, opacity .35s, transform .35s, visibility .35s;
}

.memory-next-button b {
  margin-left: 9px;
  color: #d6b788;
  font-size: 17px;
  font-weight: 400;
}

.memory-next-button.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.memory-next-button:hover {
  background: #fffaf2;
  color: #070a17;
}

.memory-ending {
  position: absolute;
  z-index: 8;
  inset: 0;
  padding: 60px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(5, 7, 17, .9);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.04);
  transition: opacity 1s, transform 1.1s, visibility 1s;
}

.memory-ending.is-visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.memory-ending > span {
  width: 1px;
  height: 54px;
  margin-bottom: 27px;
  background: #d6b788;
}

.memory-ending p,
.memory-ending h2 {
  font: 500 clamp(38px, 7vw, 76px)/1.3 var(--hand);
  letter-spacing: .08em;
  text-indent: .08em;
}

.memory-ending p {
  margin: 0 0 2px;
  color: #d6b788;
}

.memory-ending h2 {
  margin: 0;
}

.memory-ending button {
  margin-top: 48px;
  padding: 13px 21px 13px 25px;
  border: 1px solid rgba(255, 255, 255, .5);
  background: transparent;
  color: white;
  font-size: 12px;
  letter-spacing: .16em;
  cursor: pointer;
  transition: color .2s, background .2s, transform .2s;
}

.memory-ending button:hover {
  color: #28211d;
  background: white;
  transform: translateY(-2px);
}

.memory-ending button b {
  margin-left: 15px;
  font-size: 18px;
  font-weight: 400;
}

.memory-page-no {
  position: absolute;
  z-index: 5;
  left: 5vw;
  bottom: 31px;
  color: rgba(255, 255, 255, .55);
  font: 500 11px/1 Georgia, serif;
}

/* P3 — tree */
.scene-tree {
  background: #fff9ef;
  color: #372e29;
}

#treeCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.tree-haze {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 249, 239, .93) 0%, rgba(255, 249, 239, .54) 36%, transparent 65%),
    linear-gradient(0deg, rgba(255, 249, 239, .7) 0, transparent 22%);
}

.tree-header {
  position: absolute;
  z-index: 4;
  top: 35px;
  left: 5vw;
  display: flex;
  align-items: center;
  gap: 15px;
  color: #766a61;
  font-size: 9px;
  letter-spacing: .28em;
}

.tree-header i {
  width: 55px;
  height: 1px;
  background: #b3a59b;
}

.tree-header b {
  font: 500 13px/1 var(--hand);
  letter-spacing: .12em;
}

.birthday-wish {
  position: absolute;
  z-index: 6;
  left: 8vw;
  top: 50%;
  width: min(540px, 44vw);
  opacity: 0;
  transform: translateY(-42%) translateX(-25px);
  transition: opacity 1.4s, transform 1.4s;
}

.birthday-wish.is-visible {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.birthday-wish > p:first-child {
  margin: 0 0 10px;
  color: var(--red);
  font: 800 10px/1 var(--sans);
  letter-spacing: .38em;
}

.birthday-wish h1 {
  margin: 0;
  font: 700 clamp(39px, 5.2vw, 72px)/1.25 var(--hand);
  letter-spacing: .02em;
}

.birthday-wish i {
  display: block;
  width: 75px;
  height: 2px;
  margin: 25px 0;
  background: var(--red);
}

.birthday-wish h2 {
  margin: 0 0 18px;
  font: 500 clamp(17px, 2vw, 24px)/1.7 var(--hand);
  color: #62564e;
}

.birthday-wish .gift-note {
  max-width: 510px;
  margin: 0 0 15px;
  color: #74665d;
  font: 500 clamp(12px, 1.15vw, 15px)/1.85 var(--hand);
  letter-spacing: .025em;
}

.birthday-wish small {
  display: block;
  color: #9c8d82;
  font-size: 10px;
  letter-spacing: .14em;
}

.birthday-wish .closing-notes {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.birthday-wish .closing-note {
  margin: 0;
  color: #8e7f75;
  font: 500 clamp(13px, 1.15vw, 15px)/1.7 var(--hand);
  letter-spacing: .04em;
}

.birthday-wish .made-note {
  max-width: 155px;
  padding-top: 3px;
  color: var(--red);
  font-size: 9px;
  line-height: 1.55;
  transform: rotate(-2deg);
}

.tree-footer {
  position: absolute;
  z-index: 5;
  left: 5vw;
  right: 5vw;
  bottom: 29px;
  display: flex;
  justify-content: space-between;
  color: #9b8e84;
  font-size: 9px;
  letter-spacing: .19em;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes sound {
  to { height: 14px; }
}

@keyframes markIn {
  0% { opacity: 0; transform: scale(1.7) rotate(-10deg); }
  100% { opacity: 1; transform: scale(1) rotate(-5deg); }
}

@keyframes stamp {
  0% { opacity: 0; transform: scale(3.3) rotate(-17deg); filter: blur(2px); }
  55% { opacity: .92; transform: scale(.91) rotate(-11deg); filter: blur(0); }
  72% { transform: scale(1.06) rotate(-11deg); }
  100% { opacity: .84; transform: scale(1) rotate(-11deg); filter: blur(0); }
}

@keyframes scoreFloat {
  0% { opacity: 0; transform: translate(-50%, 30px) rotate(-3deg); }
  30%, 100% { opacity: 1; transform: translate(-50%, 0) rotate(-3deg); }
}

@keyframes barrageTravel {
  0% {
    left: var(--start-x);
    top: var(--start-y);
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--start-rotation)) scale(.76);
  }
  8% {
    opacity: var(--item-opacity);
  }
  50% {
    left: var(--mid-x);
    top: var(--mid-y);
    opacity: var(--item-opacity);
    transform: translate(-50%, -50%) rotate(var(--mid-rotation)) scale(1.08);
  }
  88% {
    opacity: var(--item-opacity);
  }
  100% {
    left: var(--end-x);
    top: var(--end-y);
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--end-rotation)) scale(.9);
  }
}

@keyframes foreverIn {
  0% { opacity: 0; transform: translate(-50%, 15px) rotate(-1.5deg); }
  100% { opacity: 1; transform: translate(-50%, 0) rotate(-1.5deg); }
}

@keyframes starTwinkle {
  0% { opacity: .12; transform: scale(.65); }
  100% { opacity: var(--star-opacity); transform: scale(1.3); }
}

@keyframes starShoot {
  0%, 78% { opacity: 0; transform: rotate(-35deg) translateX(-180px); }
  82% { opacity: 1; }
  100% { opacity: 0; transform: rotate(-35deg) translateX(120vw); }
}

@keyframes textRefresh {
  0% { opacity: 0; filter: blur(7px); transform: translateY(26px); }
  100% { opacity: 1; filter: blur(0); transform: translateY(0); }
}

@keyframes crossOut {
  to { width: 110%; }
}

@media (max-width: 720px) {
  .site-shell,
  .scene {
    min-height: 600px;
  }

  .scene-exam {
    padding: 18px 10px 55px;
  }

  .exam-paper {
    width: calc(100vw - 20px);
    min-height: 1010px;
    padding: 43px 26px 28px;
  }

  .exam-paper::before {
    inset: 9px;
  }

  .admission-card {
    padding: 16px 15px 13px 66px;
  }

  .admission-title {
    width: 51px;
    font-size: 15px;
  }

  .admission-card dl {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .question-block {
    grid-template-columns: 37px 1fr;
    gap: 10px;
    padding-right: 0;
  }

  .question-number {
    width: 34px;
    height: 34px;
  }

  .teacher-mark {
    right: 0;
    bottom: 17px;
    max-width: 190px;
    font-size: 17px;
  }

  .teacher-mark .big-check {
    font-size: 49px;
  }

  .danger-note {
    margin-left: 44px;
    font-size: 20px;
  }

  .exam-footer {
    left: 26px;
    right: 26px;
  }

  .exam-footer span:first-child,
  .exam-footer span:last-child {
    display: none;
  }

  .exam-footer {
    justify-content: center;
  }

  .name-card {
    padding: 55px 31px 32px;
  }

  .seal {
    right: 24px;
    bottom: 290px;
    width: 80px;
    height: 80px;
    font-size: 19px;
  }

  .full-score {
    bottom: 128px;
  }

  .forever-score {
    bottom: 88px;
    font-size: 19px;
  }

  .to-memory-button {
    bottom: 40px;
  }

  .music-toggle {
    top: 14px;
    right: 14px;
    width: 43px;
    height: 43px;
  }

  .memory-header {
    top: 24px;
  }

  .memory-center {
    width: 88vw;
    padding-bottom: 125px;
  }

  .memory-overline,
  .memory-text-wrap {
    margin-left: 2%;
  }

  .memory-number {
    left: -3%;
    top: 43%;
  }

  .memory-dots {
    left: 2%;
    bottom: 17vh;
  }

  .memory-next-button {
    right: 2%;
    bottom: 14vh;
  }

  .tree-haze {
    background: linear-gradient(0deg, rgba(255, 249, 239, .86) 0, transparent 30%);
  }

  .birthday-wish {
    left: 8vw;
    top: 12%;
    width: 84vw;
    text-align: left;
    transform: translateY(-20px);
  }

  .birthday-wish.is-visible {
    transform: translateY(0);
  }

  .birthday-wish i {
    margin: 14px 0;
  }

  .birthday-wish h2 {
    margin-bottom: 10px;
  }

  .birthday-wish .gift-note {
    max-width: 84vw;
    margin-bottom: 9px;
    font-size: 12px;
    line-height: 1.65;
  }

  .birthday-wish .closing-notes {
    gap: 8px;
  }

  .birthday-wish .story-note {
    flex: 1 1 auto;
    font-size: 12px;
  }

  .birthday-wish .made-note {
    flex: 0 0 145px;
    font-size: 8px;
  }

  .tree-header b {
    display: none;
  }
}

@media (max-height: 680px) and (min-width: 721px) {
  .scene-exam {
    padding-top: 22px;
  }

  .name-card {
    padding-top: 50px;
    padding-bottom: 27px;
  }

  .memory-dots {
    bottom: 11vh;
  }
}

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