* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
body { font-family: "Songti TC", "Noto Serif CJK TC", "Noto Serif TC", Georgia, serif; color: #e8dcc4; }
#stage { position: fixed; inset: 0; overflow: hidden; }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#c.mirror { transform: scaleX(-1); filter: sepia(0.55) saturate(0.8) brightness(0.92); }
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }

#vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 48%, rgba(0,0,0,0) 45%, rgba(0,0,0,0.55) 80%, rgba(0,0,0,0.92) 100%); }
#mirrorRing { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s; background: radial-gradient(circle at 50% 46%, rgba(0,0,0,0) 38%, rgba(70,44,14,0.85) 41%, #1a0f05 43%, #000 60%); }
#mirrorRing.on { opacity: 1; }

/* ---------- hotspot marks ---------- */
#marks { position: absolute; inset: 0; pointer-events: none; }
.mark { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 1.5px solid rgba(255,214,150,0.55); box-shadow: 0 0 8px rgba(255,170,80,0.5); animation: markPulse 2.4s ease-in-out infinite; }
.mark::after { content: ""; position: absolute; left: 4px; top: 4px; width: 3px; height: 3px; border-radius: 50%; background: rgba(255,226,170,0.9); }
.mark.sel { border-color: #ffd890; transform: scale(1.5); animation: none; box-shadow: 0 0 14px rgba(255,190,90,0.9); }
@keyframes markPulse { 0%,100% { opacity: .35; transform: scale(.85); } 50% { opacity: .9; transform: scale(1.1); } }
#markLabel { position: absolute; transform: translate(-50%, -150%); padding: 3px 10px; border-radius: 4px; background: rgba(20,6,4,0.75); border: 1px solid rgba(217,163,90,0.5); font-size: 15px; font-weight: 700; color: #f2dfb8; white-space: nowrap; text-shadow: 0 1px 2px #000; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
#lampBox { position: absolute; left: calc(10px + env(safe-area-inset-left)); top: 10px; height: 44px; display: flex; align-items: center; gap: 6px; padding: 0 12px 0 4px; border-radius: 24px; background: rgba(20,6,4,0.55); border: 1px solid rgba(217,163,90,0.35); }
#lampBox img { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 0 6px rgba(255,160,60,0.7)); }
#oilBar { width: 92px; height: 10px; border-radius: 5px; background: rgba(0,0,0,0.7); border: 1px solid rgba(217,163,90,0.6); overflow: hidden; }
#oilFill { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #a0260f, #e8862a 60%, #ffd27a); box-shadow: 0 0 8px #ff9a40; transition: width .3s; }
#oilBar.low #oilFill { animation: lowOil 0.9s infinite; }
@keyframes lowOil { 50% { opacity: .35; } }
#goldBox { position: absolute; left: calc(10px + env(safe-area-inset-left)); top: 60px; height: 34px; display: flex; align-items: center; gap: 4px; padding: 0 12px 0 4px; border-radius: 18px; background: rgba(20,6,4,0.55); border: 1px solid rgba(217,163,90,0.35); font-weight: 900; font-size: 17px; color: #ffe2a0; text-shadow: 0 1px 0 #000, 0 0 3px #000; }
#goldBox img { width: 28px; height: 28px; object-fit: contain; }
.hud-btn { position: absolute; top: 8px; width: 48px; height: 48px; padding: 4px; border-radius: 50%; background: rgba(30,8,6,0.62); border: 1.5px solid rgba(217,163,90,0.6); box-shadow: 0 2px 8px rgba(0,0,0,0.6); transition: transform .12s; }
.hud-btn img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.hud-btn:active { transform: scale(0.88); }
#btnBag { right: calc(66px + env(safe-area-inset-right)); }
#btnThink { right: calc(122px + env(safe-area-inset-right)); }
#bagDot { position: absolute; right: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #d8261a; box-shadow: 0 0 6px #f44; }

/* ---------- navigation ---------- */
#nav { position: absolute; inset: 0; pointer-events: none; }
.nav-btn { position: absolute; pointer-events: auto; width: 52px; height: 64px; border: none; border-radius: 12px; background: rgba(20,6,4,0.35); display: flex; align-items: center; justify-content: center; gap: 8px; transition: transform .12s, background .2s; }
.nav-btn:active { transform: scale(0.9); background: rgba(80,20,10,0.55); }
.nav-btn.wide { left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: auto; min-width: 130px; height: 50px; padding: 0 20px; background: rgba(30,8,6,0.6); border: 1.5px solid rgba(217,163,90,0.55); border-radius: 26px; }
.nav-btn.wide:active { transform: translateX(-50%) scale(0.92); }
#nav.mirror #navB { left: 28%; min-width: 120px; }
#nav.mirror #navFlip { left: 72%; min-width: 120px; }
.nav-btn em { font-style: normal; font-weight: 900; font-size: 18px; letter-spacing: 2px; color: #f2dfb8; text-shadow: 0 2px 0 #000, 0 0 4px #000; }
.chev { display: block; width: 18px; height: 18px; border: solid #e8c890; border-width: 0 4px 4px 0; filter: drop-shadow(0 0 3px #000); }
.chev.l { transform: rotate(135deg); margin-left: 8px; }
.chev.r { transform: rotate(-45deg); margin-right: 8px; }
.chev.u { transform: rotate(-135deg); margin-top: 8px; width: 14px; height: 14px; }
.chev.d { transform: rotate(45deg); margin-bottom: 8px; width: 14px; height: 14px; }

/* ---------- subtitles / toast / flash ---------- */
#subtitle, #toast { z-index: 48; }
#subtitle { position: absolute; left: 6%; right: 6%; bottom: calc(158px + env(safe-area-inset-bottom)); text-align: center; font-size: 18px; line-height: 1.5; font-weight: 700; color: #f4e6cc; text-shadow: 0 0 4px #000, 0 2px 2px #000, 0 0 12px #000; opacity: 0; transform: translateY(8px); transition: opacity .35s, transform .35s; pointer-events: none; white-space: pre-line; }
#subtitle.show { opacity: 1; transform: none; }
#toast { position: absolute; left: 50%; top: 64px; transform: translate(-50%, -12px); display: flex; align-items: center; gap: 8px; padding: 6px 16px 6px 8px; border-radius: 26px; background: rgba(24,6,4,0.85); border: 1px solid rgba(217,163,90,0.6); font-size: 16px; font-weight: 700; color: #ffe2a8; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; white-space: nowrap; max-width: 92%; }
#toast img { width: 36px; height: 36px; object-fit: contain; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#flash, #fade { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
#fade { background: #000; z-index: 60; }
#scare { position: absolute; inset: 0; z-index: 55; pointer-events: none; opacity: 0; background: #000; }
#scare img { width: 100%; height: 100%; object-fit: cover; }
#scare.on { animation: scare 1s ease-out forwards; }
@keyframes scare { 0% { opacity: 1; transform: scale(1.25); } 12% { transform: scale(1); } 20% { opacity: 1; filter: brightness(1.6) contrast(1.4); } 30% { opacity: 0.3; } 38% { opacity: 1; filter: none; } 100% { opacity: 0; transform: scale(1.05); } }

/* ---------- panels ---------- */
#overlay { position: absolute; inset: 0; pointer-events: none; z-index: 30; }
.ov-back { position: absolute; inset: 0; pointer-events: auto; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); animation: fadeIn .2s ease-out; padding: 12px; }
.ov-back.out { animation: fadeOut .2s ease-in forwards; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.panel { width: min(94%, 400px); max-height: 92%; display: flex; border-style: solid; border-width: 30px; border-image: url(../assets/ui-panel.webp) 120 fill / 30px stretch; animation: pop .28s cubic-bezier(.3,1.6,.5,1); filter: drop-shadow(0 8px 20px rgba(0,0,0,0.8)); }
@keyframes pop { from { transform: scale(0.7); opacity: 0; } }
.panel.shake { animation: shakeX .45s; }
@keyframes shakeX { 20%,60% { transform: translateX(-10px); } 40%,80% { transform: translateX(10px); } }
.panel.solved { animation: solved .7s ease-out; }
@keyframes solved { 40% { filter: drop-shadow(0 0 30px rgba(255,200,100,0.9)) brightness(1.3); } }
.p-inner { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 6px 4px; overflow: hidden; }
.p-title { text-align: center; font-size: 22px; font-weight: 900; letter-spacing: 3px; color: #f0c878; text-shadow: 0 2px 0 #2a0804, 0 0 6px #000; }
.p-body { overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 0; scrollbar-width: none; }
.p-body::-webkit-scrollbar { display: none; }
.p-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding-top: 4px; }
.p-icon { width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(255,190,100,0.5)); }
.p-text { width: 100%; font-size: 16px; line-height: 1.65; white-space: pre-line; color: #eadcc0; text-shadow: 0 1px 2px #000; }
.p-text.center { text-align: center; }
.p-text.dim { color: #9c8c74; font-size: 14px; }
.p-text.accent { color: #f0b860; text-align: center; font-weight: 700; }
.panel.paper .p-text { background: linear-gradient(170deg, #d9c9a3, #c4ad80 70%, #a88f62); color: #2a1a0c; text-shadow: none; padding: 14px 16px; border-radius: 3px; box-shadow: inset 0 0 24px rgba(80,40,10,0.45), 0 3px 8px rgba(0,0,0,0.6); font-size: 16px; }
.p-help { font-size: 14px; color: #b8a080; }
#stage:has(#overlay .panel) #subtitle { bottom: auto; top: calc(70px + env(safe-area-inset-top)); }
html[lang="en"] .poem { font-size: 20px; letter-spacing: 1px; }
.poem { font-size: 24px; font-weight: 900; letter-spacing: 6px; color: #f4dca8; text-shadow: 0 2px 0 #2a0804; text-align: center; }
.btn { min-height: 48px; min-width: 96px; padding: 6px 20px; border-style: solid; border-width: 14px 18px; border-image: url(../assets/ui-button.webp) 40% 22% fill / 14px 18px stretch; background: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 900; font-size: 17px; color: #f4e2bc; text-shadow: 0 2px 0 #1a0402, 0 0 3px #000; transition: transform .1s, filter .15s; }
.btn span { margin: -10px -6px; }
.btn.primary { filter: brightness(1.15) saturate(1.2); color: #ffe6a0; }
.btn:active { transform: scale(0.92); }
.btn:hover, .btn.kb { filter: brightness(1.35) drop-shadow(0 0 8px rgba(255,190,90,0.8)); }
.btn[disabled] { filter: grayscale(0.8) brightness(0.6); cursor: default; }
.btn-ic { width: 26px; height: 26px; object-fit: contain; margin: -10px 0; }
.kb:not(.btn) { outline: 2px solid #ffd890; outline-offset: 2px; box-shadow: 0 0 12px rgba(255,200,100,0.8); }

/* trigrams */
.tri { display: flex; flex-direction: column; gap: 5px; width: 44px; }
.bar { display: block; height: 7px; background: #1a120c; box-shadow: 0 1px 0 rgba(255,230,190,0.35); border-radius: 1px; }
.bar.broken { background: linear-gradient(90deg, #1a120c 42%, transparent 42%, transparent 58%, #1a120c 58%); box-shadow: none; }
.tri-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 30px; padding: 12px 18px; background: #8a8478; border-radius: 4px; box-shadow: inset 0 0 18px rgba(0,0,0,0.6); }
.tri-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tri-name { font-size: 20px; font-weight: 900; color: #1a120c; }
.mural-img { width: 100%; border-radius: 3px; box-shadow: 0 0 12px #000; }
.ring { position: relative; flex: none; width: min(62vw, 270px); height: min(62vw, 270px); margin: 30px auto; border-radius: 50%; background: radial-gradient(circle, #6e685e 0 30%, #57524a 31% 62%, #48433c 63%); box-shadow: inset 0 0 30px rgba(0,0,0,0.8), 0 0 0 4px #2a2620; }
.ring .bar { background: #d8ccb0; box-shadow: none; }
.ring .bar.broken { background: linear-gradient(90deg, #d8ccb0 42%, transparent 42%, transparent 58%, #d8ccb0 58%); }
.slots { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.slot { width: 40px; height: 40px; border-radius: 4px; background: rgba(0,0,0,0.35); display: flex; align-items: center; justify-content: center; }
.slot .tri { width: 28px; gap: 3px; }
.slot .bar { height: 5px; }
.tri-btn { position: absolute; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; border: 2px solid rgba(20,16,12,0.8); background: radial-gradient(circle, #5a544a, #3a362f); display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 6px rgba(0,0,0,0.6); transition: transform .1s; }
.tri-btn .tri { width: 34px; gap: 4px; }
.tri-btn .bar { height: 6px; }
.tri-btn:active { transform: scale(0.88); }
.tri-btn.hit { animation: triHit .4s; }
@keyframes triHit { 30% { box-shadow: 0 0 18px #ffc060; transform: scale(0.9); } }

/* zodiac wheels */
.wheels { display: flex; gap: 8px; justify-content: center; }
.wheel { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.w-label { font-size: 15px; font-weight: 700; color: #d9b070; }
.w-val { width: 62px; height: 62px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 900; color: #ffd890; background: radial-gradient(circle, #8a6a2a, #4a3410 70%, #2a1c08); box-shadow: 0 0 0 3px #1a0a04, inset 0 0 10px #000; text-shadow: 0 2px 0 #000; }
.w-val.spin { animation: spin .25s ease-out; }
@keyframes spin { from { transform: rotate(-30deg) scale(0.85); } }
.w-arrow { width: 52px; height: 44px; border-radius: 8px; border: 1px solid rgba(217,163,90,0.5); background: rgba(40,10,6,0.7); font-size: 16px; color: #e8c890; }
.w-arrow:active { transform: scale(0.9); }
.star-canvas { width: 300px; max-width: 100%; height: auto; aspect-ratio: 5/3; border-radius: 3px; box-shadow: 0 0 10px #000; }

/* tablet */
.tablet-vis { width: 90px; height: 210px; background: linear-gradient(90deg, #120a08, #24140e 50%, #120a08); border: 4px solid #8a6a2a; box-shadow: inset 0 0 0 3px #3a2810, 0 4px 12px #000; display: flex; align-items: center; justify-content: center; position: relative; }
.tablet-vis::before { content: ""; position: absolute; left: 30%; right: 30%; top: 22%; bottom: 22%; background: repeating-linear-gradient(170deg, transparent 0 9px, rgba(160,140,110,0.35) 9px 11px); }
.tablet-vis.written::before { display: none; }
.tablet-name { white-space: pre-line; font-size: 44px; line-height: 1.25; font-weight: 900; color: #d22c1c; text-align: center; text-shadow: 0 0 8px rgba(255,60,30,0.5); position: relative; }
.tiles { display: flex; gap: 8px; justify-content: center; }
.tile { width: 54px; height: 54px; border-radius: 6px; border: 2px solid #5a4020; background: linear-gradient(#3a2414, #24140a); font-size: 22px; font-weight: 900; color: #e8d0a0; transition: transform .1s; }
.tile.on { border-color: #ffc860; background: linear-gradient(#7a2414, #4a140a); color: #ffe0a0; box-shadow: 0 0 10px rgba(255,160,60,0.7); }
.tile:active { transform: scale(0.9); }

/* bag */
.bag-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.bag-item { aspect-ratio: 1; border-radius: 8px; border: 1px solid rgba(217,163,90,0.45); background: radial-gradient(circle, rgba(90,40,20,0.6), rgba(20,6,4,0.8)); padding: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; }
.bag-item img { width: 70%; height: 60%; object-fit: contain; pointer-events: none; }
.bag-item span { font-size: 12px; line-height: 1.1; color: #e8d4ac; text-align: center; pointer-events: none; }
.bag-item:active { transform: scale(0.92); }
.frag-row { font-size: 15px; color: #d9b070; font-weight: 700; }

/* revive */
.revive-btns { display: flex; flex-direction: column; gap: 8px; width: 100%; align-items: stretch; }
.revive-btns .btn { width: 100%; }

/* ---------- title ---------- */
#title { position: absolute; inset: 0; z-index: 40; overflow: hidden; cursor: pointer; }
#titleBg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: titleZoom 24s ease-in-out infinite alternate; }
@keyframes titleZoom { to { transform: scale(1.08) translateY(-1%); } }
#titleShade { position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0) 35%, rgba(0,0,0,0) 65%, rgba(0,0,0,0.75)); }
#titleLogo { position: absolute; left: 50%; top: 7%; width: 80%; max-height: 30%; object-fit: contain; transform: translateX(-50%); filter: drop-shadow(0 4px 12px rgba(0,0,0,0.9)); animation: logoIn .7s cubic-bezier(.3,1.5,.5,1) both, logoFloat 5s ease-in-out .7s infinite; }
@keyframes logoIn { from { transform: translateX(-50%) scale(1.4); opacity: 0; filter: blur(6px); } }
@keyframes logoFloat { 50% { transform: translateX(-50%) translateY(-6px); } }
#titlePrompt { position: absolute; left: 0; right: 0; bottom: 11%; text-align: center; font-size: 20px; font-weight: 900; letter-spacing: 3px; color: #f4dca8; text-shadow: 0 2px 0 #3a0804, 0 0 10px #000, 0 0 3px #000; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }
#titleInfo { position: absolute; left: 0; right: 0; bottom: 6.5%; text-align: center; font-size: 14px; color: #c8a878; text-shadow: 0 1px 3px #000; }
#trophy { position: absolute; right: calc(10px + env(safe-area-inset-right)); top: 10px; width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid rgba(217,163,90,0.5); background: rgba(30,8,6,0.5); display: flex; align-items: center; justify-content: center; padding: 0; }
#trophy svg { width: 26px; height: 26px; fill: #e8c078; }
#trophy:active { transform: scale(0.9); }

/* ---------- intro ---------- */
#intro { position: absolute; inset: 0; z-index: 50; background: #000 url(../assets/cover-bg.webp) center/cover; }
#introVid { width: 100%; height: 100%; object-fit: cover; background: #000; }
#introSkip { position: absolute; right: calc(12px + env(safe-area-inset-right)); top: 12px; min-width: 72px; height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid rgba(217,163,90,0.6); background: rgba(20,6,4,0.6); font-weight: 700; font-size: 16px; color: #f2dfb8; }

/* ---------- ending ---------- */
#ending { position: absolute; inset: 0; z-index: 45; background: #000; }
#endImg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: endZoom 20s ease-out forwards; }
@keyframes endZoom { from { transform: scale(1.12); } }
#endShade { position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0) 30%, rgba(0,0,0,0.75) 55%, rgba(0,0,0,0.95)); }
#endBox { position: absolute; left: 7%; right: 7%; bottom: calc(5% + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
#endNum { font-size: 15px; letter-spacing: 4px; color: #c89858; font-weight: 700; text-shadow: 0 1px 3px #000; }
#endTitle { font-size: 54px; font-weight: 900; letter-spacing: 10px; color: #e8341e; text-shadow: 0 3px 0 #2a0402, 0 0 24px rgba(200,20,0,0.6), 0 0 4px #000; animation: slam .6s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes slam { from { transform: scale(2.2); opacity: 0; } }
#endText { font-size: 16px; line-height: 1.7; white-space: pre-line; color: #eadcc0; text-shadow: 0 1px 3px #000; opacity: 0; animation: fadeIn 1.2s ease-out .6s forwards; }
#endText.typed { opacity: 1; }
#endTime { font-size: 18px; font-weight: 900; color: #ffd890; text-shadow: 0 2px 0 #000; }
#endMore { font-size: 14px; color: #b89868; font-style: italic; }
#endBtns { display: flex; gap: 12px; margin-top: 6px; flex-wrap: wrap; justify-content: center; }

/* ---------- free walking: the touch move stick ---------- */
#stick { position: absolute; left: calc(66px + env(safe-area-inset-left)); top: 80%; width: 104px; height: 104px; margin: -52px 0 0 -52px; border-radius: 50%; border: 2px solid rgba(217,163,90,0.45); background: radial-gradient(circle, rgba(60,16,10,0.45), rgba(30,8,6,0.2) 70%); box-shadow: inset 0 0 16px rgba(0,0,0,0.6); pointer-events: none; z-index: 12; opacity: 0.6; transition: opacity .2s; }
#stick.on { opacity: 1; }
#stick i { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f0c878, #8a4a1c 70%); border: 2px solid #2a0804; box-shadow: 0 0 10px rgba(255,170,80,0.5); }
@keyframes sealIn { from { transform: translate(-50%, -50%) rotate(-30deg) scale(2.4); opacity: 0; } }
@keyframes sealFloat { 0%, 100% { transform: translate(-50%, -50%) rotate(-8deg); } 50% { transform: translate(-50%, calc(-50% - 6px)) rotate(-8deg); } }
.mark.far { opacity: 0.38; transform: scale(0.7); animation: none; box-shadow: none; }

/* ---------- text always inside its frame (every language) ---------- */
.nav-btn em { white-space: nowrap; }
.nav-btn.wide { max-width: 64%; }
#nav.mirror .nav-btn.wide { height: auto; min-height: 50px; padding: 6px 14px; min-width: 0; transform: none; }
#nav.mirror .nav-btn.wide:active { transform: scale(0.92); }
#nav.mirror #navB { left: calc(14px + env(safe-area-inset-left)); max-width: 40%; }
#nav.mirror #navFlip { left: auto; right: calc(14px + env(safe-area-inset-right)); max-width: 54%; }
#nav.mirror .nav-btn em { white-space: normal; font-size: 16px; line-height: 1.2; letter-spacing: 1px; text-align: center; }
.bag-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bag-item { aspect-ratio: auto; height: auto; min-height: 100px; justify-content: flex-start; gap: 5px; padding: 8px 4px; overflow: visible; }
.bag-item img { width: 50px; height: 50px; flex: none; }
.bag-item span { font-size: 12.5px; line-height: 1.2; white-space: normal; overflow: visible; overflow-wrap: anywhere; max-width: 100%; }
.btn { white-space: normal; overflow-wrap: anywhere; max-width: 100%; line-height: 1.2; height: auto; padding: 0 16px; text-align: center; }
.btn span { margin: 0 -6px; }
.btn-ic { width: 22px; height: 22px; margin: 0; flex: none; }
#markLabel { max-width: 62vw; white-space: normal; text-align: center; }
#subtitle, #endText, .p-text, .p-title, .p-help, #endTitle { overflow-wrap: anywhere; }
html[lang="en"] #endTitle { font-size: 40px; letter-spacing: 3px; }
#subtitle { bottom: calc(27% + env(safe-area-inset-bottom)); }
#approach { position: absolute; transform: translate(-50%, 0); z-index: 14; min-width: 120px; max-width: 70%; min-height: 52px; font-size: 18px; animation: apIn .22s cubic-bezier(.3,1.6,.5,1) both; }
#approach:active { transform: translate(-50%, 0) scale(0.92); }
@keyframes apIn { from { opacity: 0; transform: translate(-50%, 0) scale(0.6); } }
#titleNum { position: absolute; left: 70%; top: 22%; width: 60px; height: 60px; margin: -0px; display: flex; align-items: center; justify-content: center; font-family: Georgia, "Times New Roman", serif; font-weight: 900; font-size: 38px; color: #fbe6c0; background: radial-gradient(circle at 40% 35%, #c8281a, #7a0c06 75%); border: 3px solid #3a0402; border-radius: 10px; transform: translate(-50%, -50%) rotate(-8deg); animation: sealIn .45s cubic-bezier(.3,1.6,.5,1) .55s both, sealFloat 5s ease-in-out .7s infinite; box-shadow: 0 4px 10px rgba(0,0,0,0.8), inset 0 0 8px rgba(0,0,0,0.5); text-shadow: 0 2px 0 #3a0402; }
