@font-face {
  font-family:"ZCOOL KuaiLe";
  src:url("fonts/zcool-kuaile.woff2") format("woff2");
  font-style:normal;
  font-weight:400;
  font-display:swap;
}
:root { --ink:#201f26; --sheet:#fff9ec; --white:#fffefa; --red:#f66954; --blue:#9ad8e3; --yellow:#ffd25c; --edge:3px solid var(--ink); --shadow:3px 4px 0 var(--ink); --wobble:8px 14px 7px 11px / 13px 7px 11px 6px; color:var(--ink); --lettering:"ZCOOL KuaiLe","Yuanti SC","YouYuan","PingFang SC","Microsoft YaHei",sans-serif; font-family:var(--lettering); line-height:1.45; }
* { box-sizing:border-box; }
[hidden] { display:none!important; }
body { margin:0; min-height:100vh; background:var(--sheet); }
main { width:calc(100% - 32px); max-width:540px; margin:auto; padding:20px 0 18px; padding:clamp(12px,4vh,38px) 0 18px; }
header,.brand,.ticket-top,.tower-head,.scores,.card-actions { display:flex; align-items:center; justify-content:space-between; }
.brand { gap:8px; font-size:17px; font-weight:400; }
.brand-icon { display:block; flex:none; border-radius:24%; }
.brand span { border-left:2px solid; padding-left:9px; font-size:16px; line-height:1; letter-spacing:.04em; }
button { font:inherit; color:inherit; cursor:pointer; touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
button:disabled { cursor:default; }
:focus-visible { outline:3px dashed #21679e; outline-offset:3px; }
#audio { min-height:36px; padding:3px 11px; font-weight:400; font-size:14px; }
.intro { position:relative; padding:18px 0 16px; }
h1 { position:relative; z-index:1; display:inline-block; margin:0; font-size:36px; font-size:clamp(34px,10.4vw,55px); font-weight:700; line-height:1.22; letter-spacing:.012em; transform:rotate(-2deg); }
h1::before { content:""; position:absolute; z-index:-1; left:0; right:-5px; bottom:1px; height:27%; background:var(--yellow); clip-path:polygon(0 20%,98% 0,95% 35%,100% 49%,99% 84%,2% 100%,4% 65%); }
.intro p { margin:7px 0 0; font-size:14px; font-size:clamp(14px,3.65vw,16px); }
.flight { width:55px; width:clamp(45px,16vw,83px); position:absolute; right:1%; top:18%; stroke:var(--ink); stroke-width:2.6; stroke-linecap:round; stroke-linejoin:round; }
.quiz-ticket,#after { background:var(--white); border:var(--edge); border-radius:var(--wobble); box-shadow:var(--shadow); }
.quiz-ticket { padding:10px 10px 0; }
.ticket-top { gap:12px; padding:0 1px; font-size:14px; font-weight:400; }
#round { background:var(--ink); color:white; padding:3px 8px 4px; border-radius:5px 2px 6px 3px; transform:rotate(-2deg); }
.time-track { flex:1; height:11px; overflow:hidden; background:#f0eada; border:2px solid var(--ink); border-radius:6px 4px 5px 3px; }
#time-fill { display:block; height:100%; background:var(--blue); transform-origin:left; }
#clock { min-width:44px; font-variant-numeric:tabular-nums; text-align:right; }
#clock.urgent { color:#a32c28; }
.ticket-top:has(.urgent) #time-fill { background:var(--red); }
.inspection { display:grid; grid-template-columns:minmax(0,1.44fr) minmax(0,1fr); grid-gap:8px; margin:10px 0; }
.portrait,.tower { position:relative; border:var(--edge); border-radius:4px 7px 3px 5px; overflow:hidden; }
.portrait { isolation:isolate; display:grid; align-items:center; justify-items:center; padding:28px 0 4px; background:#fff0cd; }
.rays { position:absolute; width:100%; height:100%; top:0; right:0; bottom:0; left:0; fill:#e5cfa3; pointer-events:none; }
.speech { position:absolute; z-index:2; top:7px; left:7px; padding:2px 8px 4px; border:2px solid var(--ink); background:white; border-radius:50% 38% 47% 34% / 36% 41% 39% 45%; font-size:13px; font-size:clamp(13px,3.4vw,16px); font-weight:400; transform:rotate(-5deg); }
.speech::after { content:""; position:absolute; bottom:-5px; right:11px; width:7px; height:6px; background:white; border-right:2px solid; border-bottom:2px solid; transform:skew(20deg,25deg); }
.piece { display:block; position:relative; aspect-ratio:1; }
.piece img:first-child { width:100%; height:100%; display:block; }
.piece .eyes { position:absolute; height:auto; transform:translate(-50%,-50%); pointer-events:none; }
.piece .regalia { position:absolute; top:0; right:0; bottom:0; left:0; width:100%; height:100%; pointer-events:none; }
.piece[data-egg="prick"]::after { content:""; position:absolute; left:var(--tear-x); top:var(--tear-y); width:max(2px,var(--tear-width)); aspect-ratio:.72; background:#96e2ff; border:1px solid #33495e; border-radius:75% 18% 62% 56%; transform:rotate(-22deg); pointer-events:none; }
#tower-caption[data-egg] { background:#ffe09c; }
#subject { z-index:1; width:96%; max-width:165px; width:min(96%,clamp(120px,22vh,194px)); }
@supports (width:min(2px,3px)) { #subject { max-width:none; } }
@supports not (aspect-ratio:1) {
  #subject::before { content:""; display:block; padding-top:100%; }
  .piece[data-egg="prick"]::after { width:4px; height:6px; }
}
#subject.arrive { animation:arrive .28s both; }
@keyframes arrive { 0% { transform:translateY(var(--travel)) scale(.97,1.04); animation-timing-function:ease-in; } 70% { transform:translateY(2px) scale(1.045,.955); animation-timing-function:ease-out; } 100% { transform:none; } }
#subject.depart { animation:depart .22s ease-in both; }
@keyframes depart { 0% { transform:none; } 24% { transform:translateY(-3px) scale(1.04,.96); } 100% { transform:translateY(var(--travel)) scale(.96,1.04); } }
#stamp { position:absolute; z-index:3; right:4px; bottom:8px; background:#b5e4a7; border:var(--edge); border-radius:4px 9px 3px 6px; padding:2px 7px; box-shadow:2px 2px var(--ink); font-weight:900; transform:rotate(-9deg); }
#stamp.missed { background:#ffab97; }
.tower { display:flex; flex-direction:column; background:#e0f4f3; }
.tower-head { flex-wrap:wrap; gap:1px 4px; border-bottom:2px solid; padding:3px 5px; background:var(--blue); }
.tower-head h2 { font-size:14px; font-weight:400; margin:0; }
#tower-count { font-size:12px; font-weight:400; font-variant-numeric:tabular-nums; }
.tower-window { flex:1; min-height:105px; position:relative; isolation:isolate; overflow:hidden; }
#tower-sky,#tower-rig,#tower-visitors,.tower-view { position:absolute; top:0; right:0; bottom:0; left:0; width:100%; height:100%; }
#tower-rig { z-index:1; transform-origin:50% 100%; }
#tower-visitors { z-index:2; pointer-events:none; }
.tower-view { overflow-y:auto; overflow-x:hidden; scrollbar-width:none; overflow-anchor:none; overscroll-behavior-y:contain; scroll-behavior:auto; }
.tower-view::-webkit-scrollbar { display:none; }
.tower-column { position:relative; display:grid; min-height:100%; }
#tower-ground { position:absolute; right:0; bottom:0; left:0; width:100%; height:50px; pointer-events:none; }
#tower-stack { position:relative; margin:0; padding:18px 0 16px; display:flex; flex-direction:column; justify-content:flex-end; list-style:none; }
.tower-layer { position:relative; flex:none; }
#tower-stack.with-landmark { padding-top:45px; }
.tower-layer .piece { position:absolute; bottom:var(--bottom); width:var(--size); height:var(--size); left:calc(50% - var(--size)/2); transform:translateX(var(--lean)); transform-origin:center top; }
.tower-layer::before { content:attr(data-floor); position:absolute; left:2px; bottom:3px; padding:0 2px; border-radius:3px; background:#fffae8de; font:400 11px/1.15 var(--lettering); }
#tower-caption { padding:3px; text-align:center; border-top:2px solid; background:#fff5cb; font-size:12px; font-weight:400; overflow-wrap:anywhere; }
.scores { position:relative; padding:6px 0; border-top:2px dashed #b9ae9e; }
#orbit-notice:not(:empty) { position:absolute; left:0; right:0; top:1px; bottom:1px; display:flex; align-items:center; justify-content:center; color:#fff4d2; background:#343858; border:2px solid var(--ink); border-radius:var(--wobble); font-size:16px; pointer-events:none; }
#orbit-notice:not(:empty)::before,#orbit-notice:not(:empty)::after { content:""; width:9px; height:9px; margin:0 12px; background:var(--yellow); transform:rotate(45deg); border-radius:5px 0; }
.scores div { flex:1; display:flex; align-items:baseline; justify-content:center; gap:5px; font-size:13px; font-weight:400; }
.scores div + div { border-left:2px solid #c2b5a6; }
.scores strong { font:700 25px/1 var(--lettering); }
.scores small { font-size:11px; }
#choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-gap:11px; margin-top:15px; }
button {
  --nib:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 56' preserveAspectRatio='none'%3E%3Cpath d='M12 2.2C26 .3 45 2.6 60 1.6S91 3.3 109 2.3 142 .1 164 1.5Q175 1 177.5 8.6C180 18 176.7 25 178.8 36.6Q181 52.7 169 53.5C149 56 132 52.8 113 54S78 52.7 59 54.2 31 53.5 13 54.7Q2.4 55.3 2.4 45C3.1 33 .1 26 1.3 16Q.2 3.4 12 2.2Z'/%3E%3C/svg%3E");
  --wash:var(--white); --press-x:2px; --press-y:3px;
  position:relative; isolation:isolate; appearance:none; background:transparent; border:2px solid transparent; border-radius:8px;
}
button::before,button::after {
  content:""; position:absolute; z-index:-1; pointer-events:none;
  -webkit-mask:var(--nib) center / 100% 100% no-repeat; mask:var(--nib) center / 100% 100% no-repeat;
  transform:scale(var(--flip-x,1),var(--flip-y,1));
}
button::before { left:-2px; top:-2px; right:calc(-2px - var(--press-x)); bottom:calc(-2px - var(--press-y)); background:var(--ink); }
button::after {
  top:1.5px; left:1.5px; right:1px; bottom:1px; background:var(--wash);
  -webkit-mask-image:var(--paint-edge,var(--nib)); mask-image:var(--paint-edge,var(--nib));
}
.choice,#save-card,#draw,#start {
  --paint-edge:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 56' preserveAspectRatio='none'%3E%3Cpath d='M11 2.6C25 1.7 43 3.8 60 2.1S92 3 109 2.8 144 1 164 1.4Q174 .8 176.9 9C179.6 19 176.4 25 178.4 37Q180.4 51.4 169 52.7C148 55 131 52.1 113 53.2S78 52 59 53.4 30 52.6 13 54Q3.7 54.8 3.4 44.7C3.8 33 .8 25.6 1.9 16.2Q.8 3.8 11 2.6Z'/%3E%3C/svg%3E");
  font-weight:400;
}
.choice { display:flex; align-items:center; gap:8px; padding:9px; min-height:52px; font-size:16px; font-size:clamp(16px,4.1vw,20px); line-height:1.3; text-align:left; }
.choice:nth-child(even),#draw { --flip-x:-1; }
.choice:nth-child(n+3),#save-card { --flip-y:-1; }
.choice .letter { flex:none; display:grid; align-items:center; justify-items:center; width:26px; height:27px; background:var(--yellow); border:2px solid; border-radius:6px 3px 7px 4px; font:400 18px/1 var(--lettering); transform:rotate(-5deg); }
.choice .letter { border-width:2px 2.5px 2.5px 1.5px; }
.choice.correct { --wash:#b4df9d; }
.choice.wrong { --wash:#ffa394; }
.choice:is(.correct,.wrong) .letter { background:var(--wash); }
@media(hover:hover) { .choice:enabled:hover,#save-card:enabled:hover { --wash:#fff3bf; } }
button:active:enabled { translate:var(--press-x) var(--press-y); }
button:active:enabled::before { left:-2px; top:-2px; right:-2px; bottom:-2px; }
#after { padding:12px; text-align:center; }
.ended .quiz-ticket,.ended #choices { display:none; }
#revive { margin-top:12px; padding:14px; border:var(--edge); border-radius:var(--wobble); box-shadow:var(--shadow); background:#fff3cc; }
#revive h2 { margin:0 0 5px; font-size:21px; }
#revive p { margin:4px 0; font-size:14px; line-height:1.5; }
.revive-actions { display:flex; gap:10px; margin:12px 0 6px; }
.revive-actions button { flex:1; min-height:44px; font-weight:850; }
#revive-check { --wash:var(--yellow); }
#revive-check:disabled { opacity:.7; }
#revive-follow { display:inline-flex; align-items:center; min-height:40px; color:var(--ink); font-size:14px; text-underline-offset:3px; }
#revive-status:empty { display:none; }
.end-title { font-size:24px; margin:0; transform:rotate(-2deg); }
#result,#card-hint { margin:7px 0 11px; font-size:13px; }
#tower-card { display:block; max-width:100%; max-height:51vh; height:auto; width:auto; margin:auto; }
#tower-card.enlarged { width:100%; max-height:none; }
#card-scale { display:block; margin:0 auto 8px; padding:5px 12px; --wash:var(--sheet); font-size:12px; font-weight:750; }
#audio,#card-scale { --press-x:1px; --press-y:1px; }
#audio::after,#card-scale::after { top:0; right:0; bottom:0; left:0; }
.card-actions { gap:10px; }
#save-card,#draw { min-height:44px; flex:1; font-size:15px; }
#draw { --wash:var(--yellow); }
#save-card:disabled { opacity:.65; }
#start { --wash:var(--yellow); display:flex; align-items:center; justify-content:center; width:100%; min-height:58px; margin:6px 0 24px; font-size:25px; }
#start svg { margin-right:8px; transform:rotate(-3deg); }
.home-board { background:var(--white); border:var(--edge); border-radius:var(--wobble); box-shadow:var(--shadow); padding:15px 17px 17px; }
.home-board h2 { display:flex; align-items:center; margin:0; font-size:22px; }
.home-board h2 svg { margin-right:8px; transform:rotate(-6deg); }
.home-board p { margin:8px 0 0; font-size:14px; color:#51493f; }
.home-board #rank-list-note { margin-top:14px; }
.ranking { margin-top:16px; padding-top:12px; border-top:2px dashed #c6b9a8; text-align:left; }
.rank-header { display:flex; align-items:center; }
.rank-copy { flex:1; min-width:0; }
#play-stamp { display:block; flex:none; width:86px; height:auto; margin-left:12px; }
.rank-actions { display:flex; align-items:center; flex-wrap:wrap; gap:9px; }
.rank-actions button { min-height:42px; padding:6px 13px; font-size:14px; font-weight:800; }
#rank-submit { --wash:var(--blue); }
#rank-submit:disabled { opacity:.7; }
#rank-toggle { --wash:var(--sheet); }
#rank-toggle[aria-expanded="true"] { --wash:var(--yellow); }
.ranking p { margin:8px 0 0; color:#51493f; font-size:13px; line-height:1.5; }
.ranking p:empty { display:none; }
.ranking #rank-panel { margin-top:10px; padding:4px 10px 10px; background:var(--sheet); border:2px solid var(--ink); border-radius:var(--wobble); }
#rank-list-note { font-weight:800; }
#rank-list { margin:0; padding:0; list-style:none; }
#rank-list li { display:grid; grid-template-columns:2em minmax(0,1fr) auto; align-items:center; gap:6px; padding:8px 0; border-top:1px dashed #c6b9a8; font-size:13px; font-variant-numeric:tabular-nums; }
#rank-list li:first-child { margin-top:7px; }
#rank-list li b { text-align:center; }
#rank-list li:first-child b { background:var(--yellow); border-radius:var(--wobble); }
#rank-list li span { overflow-wrap:anywhere; }
@media(forced-colors:active) {
  button { border:2px solid ButtonText; background:ButtonFace; }
  button::before,button::after { content:none; }
}
#feedback,footer { text-align:center; font-size:12px; }
#feedback { margin:12px 0 0; font-weight:750; }
#feedback:empty { display:none; }
footer { margin:16px 0 0; color:#635b53; letter-spacing:1px; }
footer i { display:inline-block; width:15px; border-bottom:2px solid; vertical-align:middle; }
@media(max-height:660px) { main { padding-top:8px; } .intro { padding:8px 0 10px; } .intro p { margin-top:3px; } #subject { max-width:135px; } }
@media (max-width:600px) and (min-height:480px) and (orientation:portrait) {
  .start-screen .intro { margin-top:calc(22vh - 70px); }
  .start-screen #start { margin-top:calc(20vh - 78px); }
}
@media(max-width:350px) { main { width:calc(100% - 20px); } .choice { gap:4px; padding:5px; } .flight { width:42px; } }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; } }

@supports not (aspect-ratio:1) {
  .brand-icon,.brand span,.choice .letter { margin-right:6px; }
  .brand span,.time-track { margin-left:6px; }
  .scores strong,.card-actions button + button,.revive-actions button + button { margin:0 4px; }
}

#hint-follow, #revive-follow {
  display:flex; align-items:center; justify-content:center; box-sizing:border-box;
  width:100%; min-height:48px; margin:12px 0; padding:8px 12px;
  border:var(--edge); border-radius:var(--wobble); box-shadow:var(--shadow);
  background:#9ddfec; color:var(--ink); font-size:17px; font-weight:850; text-decoration:none;
}
#revive-follow { background:#ffd25c; }
#revive-check { --wash:white; }
