/* ================= 第十幕 小游戏 ================= */
#ch-games { padding: calc(var(--vh) * 12) 0 calc(var(--vh) * 14); }
.ga-wrap { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.ga-list { width: 100%; display: flex; flex-direction: column; gap: 16px; }
.ga-card { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-align: left; transform: rotate(var(--r)); transition: transform .2s; }
.ga-card:active { transform: rotate(var(--r)) scale(.97); }
.ga-card.won { background-color: #fff3d0; }
.ga-ic { position: relative; width: 68px; height: 68px; flex: none; }
.ic-memory::before, .ic-memory::after { content: ''; position: absolute; width: 38px; height: 50px; top: 8px; border: 3px solid var(--ink); border-radius: 8px; }
.ic-memory::before { left: 4px; background: var(--pink) url(../assets/art/heart.webp) center / 22px no-repeat; transform: rotate(-10deg); }
.ic-memory::after { left: 26px; background: #fff6e8 url(../assets/art/star_sparkle.webp) center / 26px no-repeat; transform: rotate(9deg); }
.ic-quiz { background: var(--gold); border: 3px solid var(--ink); border-radius: 50% 50% 50% 8px; box-shadow: 0 3px 0 var(--ink); }
.ic-quiz::after { content: '?'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--f-num); font-weight: 700; font-size: 38px; color: var(--ink); }
.ic-catch::before { content: ''; position: absolute; left: 21px; top: 2px; width: 26px; height: 26px; background: url(../assets/art/heart.webp) center / contain no-repeat; animation: icfall 2.4s ease-in infinite; }
.ic-catch::after { content: ''; position: absolute; left: 7px; right: 7px; bottom: 6px; height: 28px; border: 3px solid var(--ink); border-radius: 4px 4px 18px 18px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .55) 0 3px, transparent 3px 9px), linear-gradient(#ffb3d1, #ff7fb0); box-shadow: inset 0 5px 0 #ffe1ec; }
@keyframes icfall { 0% { transform: translateY(-6px); opacity: 0; } 20% { opacity: 1; } 70% { transform: translateY(19px); opacity: 1; } 85%, 100% { transform: translateY(23px); opacity: 0; } }
.ga-txt { flex: 1; display: flex; flex-direction: column; line-height: 1.4; }
.ga-txt b { font-weight: normal; font-size: 20px; }
.ga-txt span { font-size: 14px; color: var(--ink2); }
.ga-st { position: absolute; right: 12px; top: -12px; font-size: 12px; background: var(--pink3); border: 2px solid var(--ink); border-radius: 99px; padding: 1px 10px; max-width: 72%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ga-card.won .ga-st { background: #9ee28f; }
.ga-tip { font-size: 13.5px; color: var(--txt2); text-align: center; }

/* overlay */
.game-ov { position: fixed; inset: 0; z-index: 110; display: flex; flex-direction: column; background: rgba(22, 16, 70, .96) url(../assets/art/sky/rose-p.webp) center / cover; opacity: 0; transform: scale(1.04); transition: opacity .35s, transform .35s; }
.game-ov.on { opacity: 1; transform: none; }
.go-top { display: flex; align-items: center; gap: 10px; padding: calc(12px + var(--st)) 14px 10px; }
.go-top b { font-weight: normal; font-size: 20px; color: #fff2c4; flex: 1; }
.go-x { width: 40px; height: 40px; border-radius: 50%; background: var(--cream); border: 2.5px solid var(--ink); color: var(--ink); font-size: 24px; line-height: 1; font-family: var(--f-num); box-shadow: 0 3px 0 var(--ink); }
.go-stat { font-size: 15px; color: var(--gold3); font-weight: 500; }
.go-body { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 14px calc(20px + var(--sb)); overflow: hidden; }
.go-hint { margin-top: 14px; font-size: 14px; color: var(--txt2); text-align: center; }
.go-panel { position: absolute; left: 50%; top: 50%; width: min(86vw, 380px); padding: 24px 20px 20px; text-align: center; transform: translate(-50%, -40%) scale(.9); opacity: 0; transition: all .45s var(--ease-pop); z-index: 3; }
.go-panel.on { transform: translate(-50%, -50%); opacity: 1; }
.go-panel h3 { font-size: 24px; margin-bottom: 8px; }
.go-panel h3 b { color: var(--rose); font-size: 32px; }
.go-panel p { font-size: 16px; line-height: 1.7; }
.gp-small { font-size: 13px !important; color: var(--ink2); margin-top: 6px; }
.gp-btns { display: flex; justify-content: center; gap: 10px; margin-top: 16px; }

/* memory */
.mm-grid { width: min(100%, 420px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; perspective: 900px; }
.mm-card { aspect-ratio: 3 / 4; position: relative; }
.mm-in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .45s var(--ease-pop); }
.mm-card.up .mm-in, .mm-card.ok .mm-in { transform: rotateY(180deg); }
.mm-back, .mm-front { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 2.5px solid var(--ink); border-radius: 10px; overflow: hidden; box-shadow: 0 3px 0 rgba(42, 26, 18, .45); }
.mm-back { background: var(--pink) url(../assets/art/strokes.webp) center / 120px; display: flex; align-items: center; justify-content: center; }
.mm-back i { width: 52%; aspect-ratio: 1; background: url(../assets/art/heart.webp) center / contain no-repeat; opacity: .9; }
.mm-front { transform: rotateY(180deg); background: #fff6e8; padding: 3px; }
.mm-front img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.mm-card.ok .mm-front { box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(255, 211, 107, .8); }

/* quiz */
.qz { width: min(100%, 430px); display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.qz-dots { display: flex; gap: 6px; justify-content: center; }
.qz-dots i { width: 26px; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .25); }
.qz-dots i.done { background: var(--pink); } .qz-dots i.on { background: var(--gold); }
.qz-q { padding: 16px 18px; }
.qz-n { font-size: 13px; color: var(--rose); }
.qz-q p { font-size: 19px; line-height: 1.6; margin-top: 4px; }
.qz-opts { display: flex; flex-direction: column; gap: 10px; }
.qz-o { display: flex; align-items: center; gap: 12px; padding: 11px 14px; text-align: left; background: var(--cream); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: 0 3px 0 var(--ink); font-size: 16px; transition: transform .12s, background .2s; }
.qz-o:active { transform: translateY(2px); }
.qz-o i { width: 28px; height: 28px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-style: normal; background: var(--pink3); border: 2px solid var(--ink); font-size: 14px; }
.qz-o.right { background: #b8efa8; }
.qz-o.wrong { background: #ffb3b8; animation: nope .45s; }
.qz-o.locked { pointer-events: none; }
.qz-fb { min-height: 26px; text-align: center; font-size: 17px; color: #fff2c4; }
.qz-next { align-self: center; }

/* catcher */
.ct-game { position: absolute; inset: 0; touch-action: none; overflow: hidden; }
.ct-cv { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.ct-hud { position: absolute; left: 12px; right: 12px; top: 2px; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.ct-hearts { display: grid; grid-template-columns: repeat(11, 1fr); gap: 3px 4px; width: min(100%, 360px); }
.ct-hearts i { aspect-ratio: 1; background: url(../assets/art/heart.webp) center / contain no-repeat; opacity: .22; filter: grayscale(1) brightness(1.6); transition: opacity .3s, filter .3s; }
.ct-hearts i.on { opacity: 1; filter: none; animation: ctheart .45s var(--ease-pop); }
@keyframes ctheart { 0% { scale: .3; } 70% { scale: 1.3; } 100% { scale: 1; } }
.ct-num { font-size: 15px; color: var(--gold3); }
.ct-num b { font-size: 20px; color: var(--pink); }
.ct-start { position: absolute; left: 20px; right: 20px; top: 36%; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; transition: opacity .3s, transform .3s; }
.ct-start p { font-size: 18px; color: #fff2c4; }
.ct-start .ct-sub { font-size: 14px; color: var(--txt2); margin-bottom: 8px; }
.ct-start.gone { opacity: 0; transform: scale(.9); pointer-events: none; }
.ct-count { position: absolute; left: 0; right: 0; top: 38%; text-align: center; font-size: 64px; color: #fff2c4; opacity: 0; pointer-events: none;
  text-shadow: 2.4px 0 var(--ink), -2.4px 0 var(--ink), 0 2.4px var(--ink), 0 -2.4px var(--ink), 1.7px 1.7px var(--ink), -1.7px -1.7px var(--ink), 1.7px -1.7px var(--ink), -1.7px 1.7px var(--ink), 0 6px 0 rgba(20, 10, 60, .45); }
.ct-count.pop { animation: ctcount .6s var(--ease-pop) forwards; }
@keyframes ctcount { 0% { opacity: 0; scale: .4; } 40% { opacity: 1; scale: 1.08; } 100% { opacity: 0; scale: 1; } }
.sc-text, .mc-text, .lb-story, .tk-desc, .go-panel p { text-wrap: pretty; }
