@font-face { font-family: "Brush"; src: url("../fonts/brush.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Kai"; src: url("../fonts/kai.woff2") format("woff2"); font-display: swap; }

:root {
  --paper: #efe6d2;
  --paper2: #e4d8bd;
  --ink: #241f1a;
  --ink2: #4a4036;
  --red: #a8322a;
  --gold: #c9a45c;
  --text: #f3ead8;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #14110e; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
body { font-family: "Kai", "KaiTi", "STKaiti", "楷体", serif; color: var(--ink); }
button { font-family: inherit; }

#viewport { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
#stage { position: absolute; left: 50%; top: 50%; width: 1280px; height: 720px; margin: -360px 0 0 -640px; overflow: hidden; background: var(--paper); transform-origin: 50% 50%; }
#scene, #actors, #spots, #fx { position: absolute; inset: 0; }
#scene svg { width: 100%; height: 100%; display: block; }
#scene .scene-layer { position: absolute; inset: 0; transition: opacity .6s; }
#fx { pointer-events: none; z-index: 60; }
.hidden { display: none !important; }

/* ---------- actors ---------- */
#actors { pointer-events: none; z-index: 10; }
.actor { position: absolute; bottom: 20px; width: 240px; height: 480px; margin-left: -120px; transition: left .6s ease, opacity .5s, filter .3s; transform-origin: 50% 100%; }
.actor .pup { width: 100%; height: 100%; transform-origin: 50% 100%; animation: sway 4.5s ease-in-out infinite; }
.actor.flip .pup-wrap { transform: scaleX(-1); }
.actor .pup-wrap { width: 100%; height: 100%; }
.actor.talking .pup { animation: hop .45s ease-in-out 2, sway 4.5s ease-in-out infinite .9s; }
.actor.dim { filter: brightness(.55) saturate(.6); }
.actor.enter { opacity: 0; }
@keyframes sway { 0%,100% { transform: rotate(-.8deg); } 50% { transform: rotate(.8deg); } }
@keyframes hop { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- hotspots ---------- */
#spots { z-index: 20; }
.spot { position: absolute; cursor: pointer; border-radius: 12px; }
.spot .dot { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 2px solid rgba(255,248,230,.95); background: radial-gradient(circle, rgba(168,50,42,.85) 0 30%, rgba(168,50,42,.25) 31% 100%); box-shadow: 0 0 10px rgba(0,0,0,.5); animation: pulse 1.8s ease-in-out infinite; }
.spot.seen .dot { background: radial-gradient(circle, rgba(60,55,50,.7) 0 30%, rgba(60,55,50,.2) 31%); animation: none; opacity: .65; }
.spot .lbl { position: absolute; left: 50%; top: 50%; transform: translate(-50%, 20px); white-space: nowrap; padding: 3px 10px; font-size: 19px; color: var(--text); background: rgba(20,16,12,.78); border-radius: 3px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.spot:hover .lbl, .spot.show-lbl .lbl { opacity: 1; }
.spot:hover { background: rgba(255,240,200,.08); }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.18); } }

/* ---------- nav exits ---------- */
#nav { position: absolute; left: 16px; bottom: 16px; z-index: 25; display: flex; gap: 10px; flex-wrap: wrap; max-width: 900px; }
.nav-btn { padding: 8px 18px 8px 14px; font-size: 21px; color: var(--text); background: rgba(28,22,17,.85); border: 1px solid rgba(201,164,92,.6); border-radius: 3px; cursor: pointer; }
.nav-btn::before { content: "◂ "; color: var(--gold); }
.nav-btn.cur { background: var(--red); border-color: var(--red); }
.nav-btn.cur::before { content: "● "; color: #fff; }
.nav-btn .badge { display: inline-block; width: 9px; height: 9px; margin-left: 6px; border-radius: 50%; background: #e0563f; vertical-align: 3px; }
.nav-btn:hover { background: rgba(60,44,30,.95); }
.nav-btn.cur:hover { background: #b8433a; }

/* ---------- HUD ---------- */
#hud { position: absolute; top: 0; left: 0; right: 0; height: 80px; z-index: 40; pointer-events: none; display: flex; justify-content: space-between; align-items: flex-start; padding: 14px 18px; }
#hud > div { pointer-events: auto; display: flex; align-items: center; gap: 12px; }
.hud-btn { width: 62px; height: 62px; border-radius: 50%; border: 2px solid rgba(201,164,92,.7); background: rgba(28,22,17,.82); color: var(--text); font-family: "Brush", "Kai", serif; font-size: 24px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.hud-btn:hover { background: var(--red); }
.hud-btn.flash { animation: flash 1s ease-in-out 3; }
@keyframes flash { 50% { background: var(--red); transform: scale(1.1); } }
#ink { display: flex; gap: 3px; height: 22px; padding: 3px 8px; background: linear-gradient(90deg, rgba(20,16,12,.85), rgba(20,16,12,.2)); border-radius: 2px 12px 12px 2px; }
#ink i { display: block; width: 46px; height: 16px; background: #4f8a8b; clip-path: polygon(4% 20%, 100% 0, 96% 80%, 0 100%); transition: background .4s, opacity .4s; }
#ink i.gone { background: #3a332c; opacity: .5; }
#ink.hit { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
#hud-time { margin-top: 6px; padding: 6px 22px; color: var(--text); font-size: 20px; background: rgba(20,16,12,.7); border-radius: 2px; letter-spacing: 2px; }
#hud-time:empty { display: none; }
#hud.off { display: none; }

/* ---------- continue ---------- */
.ink-btn { position: absolute; right: 24px; bottom: 22px; z-index: 30; padding: 12px 30px; font-size: 24px; color: var(--text); font-family: "Brush", "Kai", serif; background: var(--red); border-radius: 2px; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.4); clip-path: polygon(3% 0, 100% 6%, 97% 100%, 0 92%); }
.ink-btn:hover { background: #bd4237; }

/* ---------- dialog ---------- */
#dialog { position: absolute; left: 0; right: 0; bottom: 0; height: 190px; z-index: 50; padding: 34px 170px 20px; cursor: pointer; background: linear-gradient(180deg, rgba(18,14,10,0) 0, rgba(18,14,10,.82) 30px, rgba(18,14,10,.92) 100%); color: var(--text); }
#dlg-name { position: absolute; left: 170px; top: 0; padding: 4px 18px; font-family: "Brush", "Kai", serif; font-size: 27px; color: #fff; background: var(--red); clip-path: polygon(0 8%, 100% 0, 96% 100%, 3% 94%); }
#dlg-name:empty { display: none; }
#dlg-text { font-size: 27px; line-height: 1.6; letter-spacing: 1px; min-height: 90px; padding-top: 14px; }
#dialog.narr #dlg-text { color: #d9cfbb; font-style: normal; }
#dialog.think #dlg-text { color: #bcd2cf; }
#dlg-more { position: absolute; right: 150px; bottom: 18px; font-size: 22px; color: var(--gold); animation: bob 1s infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }
#dlg-text .em { color: #f0b85a; }
#dlg-text .clue { color: #ef7d6a; }

/* ---------- choices ---------- */
#choices { position: absolute; inset: 0; z-index: 55; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(10,8,6,.35); padding-bottom: 120px; }
.choice { min-width: 460px; max-width: 820px; padding: 14px 36px; font-size: 25px; text-align: center; color: var(--ink); background: var(--paper); border: 2px solid var(--ink2); cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.35); clip-path: polygon(1% 4%, 99% 0, 100% 94%, 0 100%); transition: transform .15s; }
.choice:hover { background: #fff6e0; transform: scale(1.03); }
.choice.used { color: #8a7f70; }
.choices-title { color: var(--text); font-size: 28px; font-family: "Brush", "Kai", serif; text-shadow: 0 2px 6px #000; margin-bottom: 6px; }

/* ---------- toast ---------- */
#toast { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 9px 26px; font-size: 21px; color: var(--text); background: rgba(20,16,12,.9); border-left: 5px solid var(--red); animation: toastIn .35s ease-out, toastOut .5s ease-in 2.6s forwards; white-space: nowrap; }
.toast.ach { border-left-color: var(--gold); }
.toast b { color: #f0b85a; font-weight: normal; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

/* ---------- overlay / panels ---------- */
#overlay { position: absolute; inset: 0; z-index: 58; background: rgba(10,8,6,.55); }
.panel { position: absolute; inset: 36px 60px; background: var(--paper); box-shadow: 0 10px 40px rgba(0,0,0,.6); display: flex; flex-direction: column; }
.panel::before, .panel::after { content: ""; position: absolute; top: -10px; bottom: -10px; width: 22px; background: linear-gradient(90deg, #5a3b22, #8a5c36 50%, #4a2f1a); border-radius: 6px; }
.panel::before { left: -16px; } .panel::after { right: -16px; }
.panel-head { display: flex; align-items: center; padding: 16px 28px 10px; border-bottom: 2px solid rgba(36,31,26,.25); }
.panel-title { font-family: "Brush", "Kai", serif; font-size: 36px; flex: 1; }
.panel-close { width: 46px; height: 46px; font-size: 28px; border: none; border-radius: 50%; background: var(--ink); color: var(--text); cursor: pointer; }
.panel-body { flex: 1; display: flex; min-height: 0; }

.tabs { width: 130px; padding: 14px 0; border-right: 2px solid rgba(36,31,26,.2); display: flex; flex-direction: column; gap: 6px; }
.tab { padding: 10px 0; font-size: 23px; text-align: center; cursor: pointer; color: var(--ink2); position: relative; }
.tab.on { color: #fff; background: var(--red); }
.tab .n { font-size: 15px; opacity: .7; }
.grid { flex: 1; padding: 16px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; align-content: start; }
.card { height: 150px; padding: 10px; background: #f8f1e1; border: 2px solid rgba(36,31,26,.3); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; position: relative; }
.card svg { width: 84px; height: 84px; }
.card .nm { font-size: 19px; margin-top: 6px; line-height: 1.2; }
.card.sel { border-color: var(--red); box-shadow: 0 0 0 3px rgba(168,50,42,.35); background: #fff8ea; }
.card.new::after { content: "新"; position: absolute; top: 4px; right: 6px; font-size: 14px; color: #fff; background: var(--red); padding: 0 4px; }
.detail { width: 360px; padding: 20px 24px; border-left: 2px solid rgba(36,31,26,.2); overflow-y: auto; }
.detail h3 { margin: 0 0 4px; font-family: "Brush", "Kai", serif; font-size: 32px; font-weight: normal; }
.detail .cat { color: var(--red); font-size: 18px; margin-bottom: 10px; }
.detail p { font-size: 21px; line-height: 1.65; margin: 0 0 10px; }
.detail .big { display: flex; justify-content: center; margin: 4px 0 10px; }
.detail .big svg { width: 140px; height: 140px; }
.empty { color: #8a7f70; font-size: 21px; padding: 30px; grid-column: 1 / -1; }
.present-bar { padding: 12px 28px; display: flex; justify-content: space-between; align-items: center; border-top: 2px solid rgba(36,31,26,.25); }
.present-bar .q { font-size: 23px; color: var(--ink2); flex: 1; padding-right: 20px; }
.btn { padding: 10px 28px; font-size: 23px; color: var(--text); background: var(--ink); border: none; cursor: pointer; font-family: "Brush", "Kai", serif; }
.btn.red { background: var(--red); }
.btn:disabled { opacity: .35; cursor: default; }
.btn + .btn { margin-left: 10px; }

.timeline { flex: 1; padding: 20px 30px; overflow-y: auto; }
.tl-row { display: flex; gap: 18px; padding: 8px 0; border-bottom: 1px dashed rgba(36,31,26,.25); font-size: 21px; }
.tl-row .t { width: 90px; color: var(--red); flex-shrink: 0; }
.people { flex: 1; padding: 16px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; align-content: start; }
.person { display: flex; gap: 12px; padding: 10px; background: #f8f1e1; border: 2px solid rgba(36,31,26,.25); }
.person .ph { width: 80px; height: 120px; flex-shrink: 0; overflow: hidden; }
.person .ph svg { width: 120px; height: 240px; margin-left: -20px; margin-top: -12px; }
.person h4 { margin: 0; font-family: "Brush", "Kai", serif; font-size: 26px; font-weight: normal; }
.person p { margin: 4px 0 0; font-size: 18px; line-height: 1.5; }

/* testimony */
.testi { position: absolute; left: 50%; top: 40px; transform: translateX(-50%); width: 900px; padding: 20px 34px 24px; background: var(--paper); box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.testi h2 { margin: 0 0 4px; font-family: "Brush", "Kai", serif; font-weight: normal; font-size: 34px; text-align: center; }
.testi .sub { text-align: center; color: var(--ink2); font-size: 19px; margin-bottom: 12px; }
.tline { padding: 10px 18px; margin: 7px 0; font-size: 23px; background: #f8f1e1; border-left: 5px solid #8a7f70; cursor: pointer; }
.tline.sel { border-left-color: var(--red); background: #fff3dc; box-shadow: 0 0 0 2px rgba(168,50,42,.35); }
.tline.broken { text-decoration: line-through; color: #8a7f70; border-left-color: #3a332c; cursor: default; }
.tline .press { float: right; font-size: 17px; color: var(--red); }
.testi .ops { display: flex; justify-content: center; gap: 14px; margin-top: 14px; }

/* deduce */
.deduce { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 940px; padding: 28px 40px 30px; background: var(--paper); box-shadow: 0 10px 40px rgba(0,0,0,.6); text-align: center; }
.deduce .tag { font-family: "Brush", "Kai", serif; color: var(--red); font-size: 24px; letter-spacing: 6px; }
.deduce h2 { margin: 8px 0 20px; font-weight: normal; font-size: 29px; line-height: 1.5; }
.deduce .opts { display: flex; flex-direction: column; gap: 12px; }
.deduce .opt { padding: 13px 20px; font-size: 23px; background: #f8f1e1; border: 2px solid rgba(36,31,26,.3); cursor: pointer; text-align: left; }
.deduce .opt:hover { border-color: var(--red); background: #fff6e0; }
.deduce .opt.wrong { opacity: .4; text-decoration: line-through; pointer-events: none; }

/* accuse scroll */
.accuse { position: absolute; left: 40px; right: 40px; top: 50%; height: 560px; margin-top: -270px; }
.accuse h2 { margin: 0 0 14px; text-align: center; color: #fff; font-family: "Brush", "Kai", serif; font-size: 50px; font-weight: normal; letter-spacing: 6px; text-shadow: 0 3px 10px #000; }
.scroll { position: relative; height: 420px; background: var(--paper); box-shadow: 0 10px 40px rgba(0,0,0,.6); overflow-x: auto; overflow-y: hidden; display: flex; align-items: flex-end; padding: 0 40px; animation: unroll .8s ease-out; }
@keyframes unroll { from { clip-path: inset(0 50% 0 50%); } to { clip-path: inset(0 0 0 0); } }
.suspect { position: relative; width: 180px; height: 400px; flex-shrink: 0; cursor: pointer; }
.suspect svg { position: absolute; left: -10px; bottom: -6px; width: 200px; height: 400px; pointer-events: none; }
.suspect .tagname { position: absolute; top: 18px; right: 6px; width: 40px; padding: 8px 0; writing-mode: vertical-rl; font-family: "Brush", "Kai", serif; font-size: 26px; text-align: center; border: 2px solid var(--ink2); background: #f8f1e1; letter-spacing: 4px; }
.suspect.sel .tagname { background: var(--red); color: #fff; border-color: var(--red); }
.suspect.sel::after { content: ""; position: absolute; right: 10px; bottom: 30px; width: 100px; height: 60px; border-left: 12px solid var(--red); border-bottom: 12px solid var(--red); transform: rotate(-45deg); opacity: .85; }
.accuse .ops { text-align: center; margin-top: 18px; }

/* chapter card */
.chapter { position: absolute; inset: 0; z-index: 80; background: var(--paper); display: flex; align-items: center; justify-content: center; animation: fadeIn .8s; }
.chapter svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.chapter .cv { position: relative; display: flex; flex-direction: row-reverse; gap: 30px; align-items: flex-start; }
.chapter .c1 { writing-mode: vertical-rl; font-family: "Brush", "Kai", serif; font-size: 40px; color: var(--red); letter-spacing: 8px; }
.chapter .c2 { writing-mode: vertical-rl; font-family: "Brush", "Kai", serif; font-size: 96px; letter-spacing: 16px; color: var(--ink); animation: brushIn 1.4s ease-out; }
.chapter .c3 { writing-mode: vertical-rl; font-size: 26px; color: var(--ink2); letter-spacing: 6px; margin-top: 120px; }
@keyframes brushIn { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes fadeIn { from { opacity: 0; } }
.fadeout { animation: fadeOut .7s forwards; }
@keyframes fadeOut { to { opacity: 0; } }

/* ink transition */
.ink-wipe { position: absolute; inset: 0; background: #16120e; animation: wipe 1.1s ease-in-out forwards; }
@keyframes wipe { 0% { clip-path: circle(0% at 50% 50%); } 45%,55% { clip-path: circle(80% at 50% 50%); } 100% { clip-path: circle(0% at 50% 50%); opacity: .0; } }
.flash-red { position: absolute; inset: 0; background: radial-gradient(circle, rgba(168,50,42,0), rgba(168,50,42,.55)); animation: fadeOut .6s forwards; }
.objection { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) rotate(-6deg); font-family: "Brush", "Kai", serif; font-size: 150px; color: var(--red); text-shadow: 4px 4px 0 #fff, 0 0 30px rgba(0,0,0,.4); animation: stamp .9s ease-out forwards; }
@keyframes stamp { 0% { transform: translate(-50%,-50%) rotate(-6deg) scale(2.4); opacity: 0; } 20% { transform: translate(-50%,-50%) rotate(-6deg) scale(1); opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* title */
#title-screen { position: absolute; inset: 0; z-index: 90; background: var(--paper); }
#title-screen svg.bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.logo { position: absolute; left: 120px; top: 70px; display: flex; flex-direction: row-reverse; gap: 10px; }
.logo .big { writing-mode: vertical-rl; font-family: "Brush", "Kai", serif; font-size: 132px; line-height: 1; color: var(--ink); letter-spacing: 4px; animation: brushIn 2s ease-out; }
.logo .seal { writing-mode: vertical-rl; align-self: flex-end; margin-bottom: 20px; padding: 6px 4px; font-family: "Brush", "Kai", serif; font-size: 22px; color: #fff; background: var(--red); border-radius: 3px; }
.logo .small { writing-mode: vertical-rl; font-size: 26px; color: var(--ink2); letter-spacing: 8px; margin-top: 40px; }
.menu { position: absolute; right: 120px; bottom: 90px; display: flex; flex-direction: column; gap: 14px; }
.menu button { width: 240px; padding: 12px 0; font-size: 28px; font-family: "Brush", "Kai", serif; color: var(--text); background: rgba(28,22,17,.88); border: 1px solid rgba(201,164,92,.6); cursor: pointer; letter-spacing: 6px; }
.menu button:hover { background: var(--red); }
.menu button:disabled { opacity: .35; cursor: default; background: rgba(28,22,17,.88); }
.credit { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: var(--ink2); font-size: 16px; opacity: .7; }

.ach-list { flex: 1; padding: 16px 28px; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
.ach { display: flex; gap: 14px; align-items: center; padding: 10px; background: #f8f1e1; border: 2px solid rgba(36,31,26,.25); }
.ach .stamp { width: 70px; height: 70px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-family: "Brush", "Kai", serif; font-size: 34px; color: #fff; background: var(--red); border: 4px double #f3ead8; outline: 2px solid var(--red); }
.ach.lock .stamp { background: #9a9083; outline-color: #9a9083; }
.ach.lock { color: #8a7f70; }
.ach h4 { margin: 0; font-size: 24px; font-weight: normal; font-family: "Brush", "Kai", serif; }
.ach p { margin: 2px 0 0; font-size: 18px; }

.menu-panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 420px; padding: 30px; background: var(--paper); box-shadow: 0 10px 40px rgba(0,0,0,.6); display: flex; flex-direction: column; gap: 12px; }
.menu-panel h2 { margin: 0 0 6px; text-align: center; font-family: "Brush", "Kai", serif; font-weight: normal; font-size: 36px; }
.menu-panel .btn { width: 100%; margin: 0; }

/* puzzle */
.puzzle { position: absolute; inset: 0; z-index: 58; background: #1b1713; }
.puzzle svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pz-tip { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); padding: 10px 30px; font-size: 24px; color: var(--text); background: rgba(20,16,12,.85); border-bottom: 3px solid var(--red); white-space: nowrap; }
.pz-tools { position: absolute; left: 24px; top: 100px; display: flex; flex-direction: column; gap: 10px; }
.pz-tool { width: 150px; padding: 10px; font-size: 21px; color: var(--ink); background: var(--paper); border: 2px solid var(--ink2); cursor: pointer; text-align: center; }
.pz-tool.on { background: var(--red); color: #fff; border-color: var(--red); }
.pz-tool.done { opacity: .4; pointer-events: none; }
.pz-slot { cursor: pointer; }
.pz-slot:hover .ring { stroke: #f0b85a; }

/* svg 动效（注意：带 transform 属性的 g 不要挂这些类） */
.spin { animation: rot 1.4s linear infinite; transform-origin: 0 0; }
.spin-slow { animation: rot 7s linear infinite; transform-origin: 0 0; }
@keyframes rot { to { transform: rotate(360deg); } }
.drift { animation: drift 14s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(-30px); } to { transform: translateX(30px); } }
.birds { animation: birds 30s linear infinite; }
@keyframes birds { from { transform: translate(-40px, 10px); } to { transform: translate(140px, -20px); } }
.flick { animation: flick 3s ease-in-out infinite; }
@keyframes flick { 0%,100% { opacity: .85; } 40% { opacity: 1; } 60% { opacity: .7; } }
.flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flame .5s ease-in-out infinite alternate; }
@keyframes flame { to { transform: scale(.85, 1.12); } }
.shake { animation: wshake .3s linear infinite; }
@keyframes wshake { 50% { transform: translate(1.5px, -1px); } }
.leaf { animation: leaf 7s ease-in infinite; }
@keyframes leaf { from { transform: translate(0, 0) rotate(0); opacity: 1; } to { transform: translate(-160px, 300px) rotate(240deg); opacity: 0; } }

.sway-tree { animation: swayT 6s ease-in-out infinite alternate; transform-origin: 0 -300px; }
@keyframes swayT { from { transform: rotate(-1.2deg); } to { transform: rotate(1.6deg); } }
.flutter { animation: flutter 3s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 0 0; }
@keyframes flutter { to { transform: skewY(3deg) scaleX(.96); } }
.dust circle { animation: dust 12s linear infinite; }
@keyframes dust { 0% { transform: translate(0, 0); opacity: 0; } 20% { opacity: .6; } 100% { transform: translate(40px, -80px); opacity: 0; } }

/* rotate tip */
#rotate-tip { display: none; position: fixed; inset: 0; z-index: 999; background: #14110e; color: var(--text); font-size: 26px; text-align: center; align-items: center; justify-content: center; flex-direction: column; line-height: 2; }
@media (orientation: portrait) and (max-width: 900px) {
  #rotate-tip { display: flex; }
  body.ignore-rotate #rotate-tip { display: none; }
}
