/* 魔物獵獺 — clay UI: chunky outlines, soft shadows, glossy droplets */
:root {
  --font: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --ink: #4a2a12; --ink2: #6b3d1c; --cream: #fff3dc; --cream2: #f6e2bd;
  --orange: #f08a3c; --teal: #2fa6a0; --teal2: #1f7c78; --red: #e8503a; --green: #74c043; --gold: #ffd25a;
  --ol: -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink), 0 -2px 0 var(--ink), 0 2px 0 var(--ink), -2px 0 0 var(--ink), 2px 0 0 var(--ink), 0 4px 0 var(--ink);
  --ol-s: -1.5px -1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink), -1.5px 1.5px 0 var(--ink), 1.5px 1.5px 0 var(--ink), 0 -1.5px 0 var(--ink), 0 1.5px 0 var(--ink), 0 3px 0 var(--ink);
  --fs: clamp(14px, 2.5vh, 21px);
  --pb: clamp(16px, 3.6vh, 30px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2b1b10; font-family: var(--font); font-weight: 900;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#ui { position: fixed; inset: 0; pointer-events: none; overflow: hidden; font-size: var(--fs); color: var(--ink); }
#ui > * { position: absolute; }
.hidden { display: none !important; }
.ol { color: #fff8ea; text-shadow: var(--ol); }
.ols { color: #fff8ea; text-shadow: var(--ol-s); }
img { -webkit-user-drag: none; user-select: none; }

/* ---------- screens ---------- */
.screen { inset: 0; display: none; pointer-events: auto; overflow: hidden; }
.screen.active { display: block; animation: screenIn .35s ease-out both; }
.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@keyframes screenIn { from { opacity: 0; } to { opacity: 1; } }

/* title */
#title { cursor: pointer; background: #f3d9a8 url("assets/title-bg.webp") center / cover; }
#title .bg { animation: kenburns 24s ease-in-out infinite alternate; transform-origin: 70% 60%; }
#logo { position: absolute; left: 3vw; top: 4vh; width: 56vw; height: 33vh; object-fit: contain; object-position: center;
  filter: drop-shadow(0 6px 0 rgba(74, 42, 18, .35)); animation: logoIn .7s cubic-bezier(.2, 1.5, .4, 1) both, floaty 3.4s ease-in-out .8s infinite; }
#logoText { position: absolute; left: 3vw; top: 6vh; width: 56vw; text-align: center; font-size: 12vh; transform: rotate(-5deg); animation: logoIn .7s cubic-bezier(.2, 1.5, .4, 1) both; }
#startPrompt { position: absolute; left: 50%; bottom: 8vh; transform: translateX(-50%); white-space: nowrap; font-size: clamp(16px, 3.6vh, 30px);
  padding: .35em 1.2em; border-radius: 99px; background: rgba(74, 42, 18, .45); animation: pulse 1.6s ease-in-out infinite; }
@keyframes logoIn { 0% { transform: translateY(-40vh) scale(.6); opacity: 0; } 70% { opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes floaty { 0%, 100% { translate: 0 0; } 50% { translate: 0 -1.2vh; } }
@keyframes pulse { 0%, 100% { opacity: 1; scale: 1; } 50% { opacity: .65; scale: .96; } }
@keyframes kenburns { from { transform: scale(1.02); } to { transform: scale(1.1) translate(-1%, 1%); } }

.iconbtn { position: absolute; width: 50px; height: 50px; border-radius: 50%; border: 3px solid var(--ink); pointer-events: auto; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 45%), rgba(47, 166, 160, .78);
  box-shadow: 0 4px 0 var(--ink); display: grid; place-items: center; padding: 0; transition: transform .12s; }
.iconbtn:active, .iconbtn.press { transform: translateY(3px) scale(.92); box-shadow: 0 1px 0 var(--ink); }
.iconbtn svg { width: 60%; height: 60%; }
.corner-tr { top: 10px; right: calc(10px + var(--safe-r)); }
.keytag { position: absolute; right: calc(66px + var(--safe-r)); top: 22px; font-size: 13px; padding: 2px 7px; border-radius: 6px; background: rgba(74, 42, 18, .55); color: #fff3dc; pointer-events: none; }

/* intro */
#intro { background: #000 url("assets/title-bg.webp") center / cover; z-index: 70; }
#intro video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: transparent; }
#btnSkip { position: absolute; top: 12px; right: calc(12px + var(--safe-r)); }

/* village */
#village { background: #7cc4b8 url("assets/village-bg.webp") center / cover; }
#village .bg { animation: kenburns 30s ease-in-out infinite alternate; transform-origin: 50% 50%; }
#vHero { position: absolute; left: calc(5vw + var(--safe-l)); bottom: 21vh; height: 46vh; transform-origin: 50% 100%; animation: heroBob 2.4s ease-in-out infinite;
  filter: drop-shadow(0 8px 0 rgba(40, 24, 10, .35)); }
#vHero.fur-gold { filter: drop-shadow(0 8px 0 rgba(40, 24, 10, .35)) sepia(.9) saturate(2.6) hue-rotate(-12deg) brightness(1.12); }
#vHero.fur-sakura { filter: drop-shadow(0 8px 0 rgba(40, 24, 10, .35)) sepia(.4) hue-rotate(290deg) saturate(1.6) brightness(1.18); }
@keyframes heroBob { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.03, .97) translateY(1%); } }
.plaque { position: absolute; left: 50%; top: 2.2vh; transform: translateX(-50%); padding: .2em 1.4em; font-size: clamp(18px, 4.6vh, 38px); white-space: nowrap;
  background: linear-gradient(#f9a65a, #e57a2e); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 5px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, .45); }
.goldchip { position: absolute; left: calc(12px + var(--safe-l)); top: 10px; display: flex; align-items: center; gap: 6px; padding: 4px 14px 4px 6px;
  background: rgba(74, 42, 18, .62); border: 3px solid var(--ink); border-radius: 99px; font-size: clamp(16px, 3.4vh, 26px); pointer-events: auto; }
.goldchip img { width: clamp(28px, 6vh, 44px); height: clamp(28px, 6vh, 44px); object-fit: contain; }
.buffchip { position: absolute; left: calc(12px + var(--safe-l)); top: calc(18px + clamp(30px, 6.5vh, 48px)); padding: 4px 12px 4px 4px; display: flex; align-items: center; gap: 6px;
  background: rgba(255, 243, 220, .9); border: 3px solid var(--ink); border-radius: 14px; font-size: clamp(13px, 2.3vh, 18px); color: var(--ink); max-width: 40vw; }
.buffchip img { width: clamp(26px, 5vh, 40px); height: clamp(26px, 5vh, 40px); object-fit: contain; }
.vmenu { position: absolute; left: 50%; bottom: 4vh; transform: translateX(-50%); display: flex; gap: clamp(8px, 1.6vw, 22px); align-items: flex-end; }
.vbtn { pointer-events: auto; cursor: pointer; width: clamp(74px, 17vh, 138px); display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: 0; padding: 0; font-family: inherit; font-weight: 900; transition: transform .15s; }
.vbtn .ring { width: clamp(64px, 14.5vh, 118px); height: clamp(64px, 14.5vh, 118px); border-radius: 50%; display: grid; place-items: center; border: 4px solid var(--ink);
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0) 40%), var(--c, #3fb7b0); box-shadow: 0 6px 0 var(--ink), inset 0 -6px 0 rgba(0, 0, 0, .15); }
.vbtn img { width: 78%; height: 78%; object-fit: contain; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .25)); }
.vbtn span { font-size: clamp(14px, 2.6vh, 22px); white-space: nowrap; color: #fff8ea; text-shadow: var(--ol-s); }
.vbtn:hover .ring, .vbtn.focus .ring { transform: scale(1.08); filter: brightness(1.08); }
.vbtn:active .ring, .vbtn.press .ring { transform: translateY(4px) scale(.94); box-shadow: 0 2px 0 var(--ink); }
.vbtn .ring { transition: transform .15s, filter .15s; }
.vbtn .badge { position: absolute; margin-left: 9vh; margin-top: -1vh; min-width: 24px; height: 24px; border-radius: 12px; background: var(--red); border: 2px solid var(--ink); color: #fff; font-size: 14px; display: grid; place-items: center; }

/* meal */
#meal { background: #f2b46a url("assets/meal-bg.webp") center / cover; cursor: pointer; }
#meal .bg { animation: drift 5s ease-in-out infinite; transform-origin: 50% 60%; }
@keyframes drift { 0%, 100% { transform: scale(1.06) translateY(0) rotate(0); } 50% { transform: scale(1.08) translateY(-1.2%) rotate(.6deg); } }
#mealText { position: absolute; left: 50%; top: 7vh; transform: translateX(-50%); text-align: center; width: 90vw; font-size: clamp(20px, 5vh, 40px); }
#mealBuff { position: absolute; left: 50%; top: 18vh; transform: translateX(-50%); padding: .3em 1em; border-radius: 14px; background: rgba(255, 243, 220, .92); border: 3px solid var(--ink);
  font-size: clamp(15px, 3vh, 24px); white-space: nowrap; animation: popIn .4s cubic-bezier(.2, 1.6, .4, 1) .6s both; }
#mealTap { position: absolute; left: 50%; bottom: 7vh; transform: translateX(-50%); font-size: clamp(15px, 3vh, 24px); white-space: nowrap; animation: pulse 1.6s infinite; }
.zzz { position: absolute; font-size: 5vh; animation: zz 3s ease-in infinite; opacity: 0; }
@keyframes zz { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(4vh, -14vh) scale(1.3); } }

/* ---------- clay panel & buttons ---------- */
.panelbox { border-style: solid; border-color: transparent; border-width: var(--pb); border-image: url("assets/ui-panel.webp") 96 fill / var(--pb) / 0 stretch; color: var(--ink); }
.btn { pointer-events: auto; cursor: pointer; font-family: inherit; font-weight: 900; font-size: clamp(14px, 2.6vh, 21px); color: #fff8ea; text-shadow: var(--ol-s);
  min-height: 44px; min-width: 64px; padding: 0 .9em; border-style: solid; border-color: transparent; border-width: 16px 22px;
  border-image: url("assets/ui-button.webp") 168 120 fill / 16px 22px / 9px 0 stretch; background: none; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: .3em; transition: transform .12s, filter .12s; line-height: 1.1; }
.btn:hover, .btn.focus { filter: brightness(1.1) saturate(1.1); transform: scale(1.05); }
.btn:active, .btn.press { transform: scale(.93, .88); }
.btn[disabled] { filter: grayscale(.85) brightness(.9); cursor: default; transform: none; opacity: .75; }
.btn.teal { filter: hue-rotate(150deg) saturate(.8); }
.btn.teal:hover, .btn.teal.focus { filter: hue-rotate(150deg) saturate(.9) brightness(1.1); }
.btn.small { font-size: clamp(13px, 2.2vh, 17px); }
.btn img { width: 1.5em; height: 1.5em; object-fit: contain; }
.focus { outline: none; }
.navfocus .focus { box-shadow: 0 0 0 3px #fff8ea, 0 0 0 6px var(--teal); border-radius: 14px; }

/* modal panel (village pages) */
.modal { inset: 0; display: none; pointer-events: auto; background: rgba(40, 22, 10, .45); z-index: 40; }
.modal.open { display: block; }
.modal .panelbox { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(94vw, 156vh); height: min(92vh, 660px); display: flex; flex-direction: column;
  animation: popIn .28s cubic-bezier(.2, 1.5, .4, 1) both; }
.modal.small .panelbox { width: min(80vw, 110vh); height: auto; max-height: 92vh; }
@keyframes popIn { from { transform: translate(-50%, -50%) scale(.6); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.ptitle { text-align: center; font-size: clamp(18px, 4.4vh, 34px); margin: -.3em 0 .25em; color: #fff8ea; text-shadow: var(--ol); }
.pclose { position: absolute; right: calc(-1 * var(--pb) + 6px); top: calc(-1 * var(--pb) + 6px); width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--ink);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0) 45%), var(--red); color: #fff; font-size: 24px; font-family: inherit; font-weight: 900;
  box-shadow: 0 3px 0 var(--ink); cursor: pointer; pointer-events: auto; display: grid; place-items: center; padding: 0; text-shadow: var(--ol-s); z-index: 2; }
.pclose:active { transform: translateY(2px) scale(.92); }
.pbody { flex: 1; min-height: 0; overflow: hidden; display: flex; gap: 2vh; }

/* quests */
.qcard { flex: 1; min-width: 0; display: flex; flex-direction: column; background: rgba(255, 255, 255, .55); border: 3px solid var(--ink2); border-radius: 18px; padding: 1.4vh 1.6vh; position: relative; overflow: hidden; }
.qhead { display: flex; gap: 1.4vh; align-items: center; }
.qart { width: 19vh; height: 19vh; object-fit: contain; flex: none; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .2)); }
.qname { font-size: clamp(16px, 3.3vh, 27px); line-height: 1.15; }
.qarea { font-size: clamp(12px, 2.1vh, 16px); color: var(--teal2); margin-top: .2em; }
.qdesc { font-size: clamp(12px, 2.15vh, 17px); line-height: 1.35; font-weight: 700; margin: .8vh 0; flex: 1; min-height: 0; overflow: hidden; }
.qrow { display: flex; align-items: center; gap: .5em; flex-wrap: wrap; font-size: clamp(12px, 2.2vh, 17px); }
.qrow img { width: 4.4vh; height: 4.4vh; min-width: 22px; min-height: 22px; object-fit: contain; }
.qfoot { display: flex; align-items: center; justify-content: space-between; gap: 1vh; margin-top: .8vh; }
.qstat { font-size: clamp(12px, 2vh, 16px); line-height: 1.3; color: var(--ink2); }
.qlock { position: absolute; inset: 0; background: rgba(60, 40, 25, .55); display: grid; place-items: center; text-align: center; padding: 2vh; font-size: clamp(15px, 3vh, 24px); }
.qlock span { color: #fff8ea; text-shadow: var(--ol-s); }
.trophy { width: 44px; height: 44px; position: relative; }

/* forge */
.tabs { display: flex; flex-direction: column; gap: 1.2vh; flex: none; width: clamp(96px, 20vh, 170px); }
.tab { width: 100%; }
.tab.on { filter: hue-rotate(150deg) saturate(.85) brightness(1.05); }
.fmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1vh; }
.wlist { display: flex; gap: 1vh; flex: none; }
.wcell { flex: 1; min-width: 0; aspect-ratio: 1; max-height: 13vh; border-radius: 14px; border: 3px solid var(--ink2); background: rgba(255, 255, 255, .5); position: relative; cursor: pointer;
  pointer-events: auto; padding: 4px; display: grid; place-items: center; font-family: inherit; }
.wcell img { width: 100%; height: 100%; object-fit: contain; }
.wcell.sel { background: #ffe9a8; border-color: var(--ink); box-shadow: 0 0 0 3px var(--orange); }
.wcell.locked img { filter: grayscale(1) brightness(.75) opacity(.75); }
.wcell .lv { position: absolute; right: 3px; bottom: 2px; font-size: 13px; color: #fff8ea; text-shadow: var(--ol-s); }
.wcell .eq { position: absolute; left: 3px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--green); border: 2px solid var(--ink); }
.wdetail { flex: 1; min-height: 0; display: flex; gap: 2vh; background: rgba(255, 255, 255, .5); border: 3px solid var(--ink2); border-radius: 18px; padding: 1.4vh 1.8vh; }
.wbig { width: 24vh; height: 24vh; object-fit: contain; flex: none; align-self: center; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .2)); }
.winfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .6vh; }
.wname { font-size: clamp(16px, 3.3vh, 27px); }
.wdesc { font-size: clamp(12px, 2.1vh, 16px); font-weight: 700; line-height: 1.3; }
.stats { display: grid; grid-template-columns: auto 1fr; gap: .4vh 1vh; align-items: center; font-size: clamp(12px, 2vh, 15px); }
.bar { height: 1.6vh; min-height: 9px; border-radius: 99px; background: rgba(74, 42, 18, .2); border: 2px solid var(--ink2); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(#ffd27a, #f08a3c); border-radius: 99px; }
.cost { display: flex; flex-wrap: wrap; gap: .5vh 1.2vh; align-items: center; font-size: clamp(12px, 2.1vh, 16px); }
.cost .c { display: flex; align-items: center; gap: 3px; }
.cost img { width: 4.2vh; height: 4.2vh; min-width: 22px; min-height: 22px; object-fit: contain; }
.cost .short { color: var(--red); }
.wact { display: flex; gap: 1.2vh; margin-top: auto; flex-wrap: wrap; }

/* feast */
.meals { display: flex; gap: 1.8vh; flex: 1; min-height: 0; }
.mcard { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .6vh; background: rgba(255, 255, 255, .55); border: 3px solid var(--ink2); border-radius: 18px; padding: 1.4vh; }
.mcard img { width: 100%; height: 20vh; object-fit: contain; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .2)); }
.mcard.on { background: #ffe9a8; box-shadow: 0 0 0 3px var(--orange); }
.mname { font-size: clamp(15px, 3vh, 24px); }
.mbuff { font-size: clamp(12px, 2.2vh, 17px); color: var(--teal2); flex: 1; }
.pnote { text-align: center; font-size: clamp(12px, 2.2vh, 17px); font-weight: 700; margin-bottom: 1vh; }

/* bag */
.bagcol { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .8vh; min-height: 0; }
.sect { font-size: clamp(14px, 2.6vh, 20px); color: #fff8ea; text-shadow: var(--ol-s); }
.matgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1vh; }
.mat { background: rgba(255, 255, 255, .55); border: 3px solid var(--ink2); border-radius: 14px; padding: .6vh; display: flex; flex-direction: column; align-items: center; font-size: clamp(11px, 1.9vh, 15px); text-align: center; }
.mat img { width: 8.5vh; height: 8.5vh; object-fit: contain; }
.mat b { font-size: clamp(14px, 2.6vh, 20px); }
.item { display: flex; align-items: center; gap: 1vh; background: rgba(255, 255, 255, .55); border: 3px solid var(--ink2); border-radius: 14px; padding: .5vh 1vh; }
.item img { width: 8vh; height: 8vh; min-width: 34px; min-height: 34px; object-fit: contain; flex: none; }
.item .it { flex: 1; min-width: 0; font-size: clamp(12px, 2.1vh, 16px); }
.item .it small { display: block; font-weight: 700; font-size: clamp(11px, 1.8vh, 14px); color: var(--ink2); }
.item .n { font-size: clamp(15px, 2.8vh, 22px); }
.furs { display: flex; gap: 1vh; }
.fur { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: .4vh; background: rgba(255, 255, 255, .55); border: 3px solid var(--ink2); border-radius: 14px; padding: .6vh; font-size: clamp(11px, 1.9vh, 15px); text-align: center; }
.fur img { width: 10vh; height: 10vh; object-fit: contain; }
.fur.on { background: #ffe9a8; box-shadow: 0 0 0 3px var(--orange); }

/* ---------- hunt HUD ---------- */
#hud { inset: 0; display: none; z-index: 20; }
#hud.on { display: block; }
.hudl { position: absolute; left: calc(10px + var(--safe-l)); top: 8px; display: flex; flex-direction: column; gap: 5px; }
.bars { display: flex; align-items: center; gap: 6px; padding: 5px 10px 5px 5px; background: rgba(74, 42, 18, .55); border: 3px solid var(--ink); border-radius: 16px; }
.face { width: clamp(40px, 9vh, 62px); height: clamp(40px, 9vh, 62px); border-radius: 50%; border: 3px solid var(--ink); background: #ffe2b0 url("assets/otter-art.webp") 50% 12% / 170% no-repeat; flex: none; }
.barcol { display: flex; flex-direction: column; gap: 4px; }
.hbar { width: clamp(120px, 30vh, 240px); height: clamp(12px, 2.6vh, 20px); border-radius: 99px; border: 2.5px solid var(--ink); background: #5a3a22; overflow: hidden; position: relative; }
.hbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; transition: width .12s; }
.hbar i::after { content: ""; position: absolute; left: 6%; right: 6%; top: 18%; height: 28%; border-radius: 99px; background: rgba(255, 255, 255, .45); }
#hpBar i { background: linear-gradient(#9be36a, #4fa836); }
#hpBar i.low { background: linear-gradient(#ff8a6a, #d8432c); }
#hpLag { background: #ffd0a0 !important; transition: width .6s .25s; }
#stBar { width: clamp(90px, 22vh, 180px); height: clamp(9px, 1.8vh, 14px); }
#stBar i { background: linear-gradient(#ffe27a, #f0a83c); }
.hudrow { display: flex; gap: 8px; align-items: center; }
.slot { position: relative; width: clamp(44px, 9vh, 58px); height: clamp(44px, 9vh, 58px); border-radius: 14px; border: 3px solid var(--ink); background: rgba(255, 243, 220, .88); display: grid; place-items: center; padding: 0; font-family: inherit; }
.slot img { width: 84%; height: 84%; object-fit: contain; }
.slot .cnt { position: absolute; right: -4px; bottom: -6px; font-size: clamp(14px, 2.6vh, 19px); color: #fff8ea; text-shadow: var(--ol-s); }
.slot .key { position: absolute; left: -5px; top: -7px; font-size: 11px; padding: 1px 4px; border-radius: 5px; background: var(--ink); color: #fff3dc; }
.slot .cd { position: absolute; inset: 0; border-radius: 11px; background: conic-gradient(rgba(40, 20, 8, .72) var(--p, 0%), transparent 0); }
#potionBtn { pointer-events: auto; cursor: pointer; }
#potionBtn:active { transform: scale(.9); }
.hudgold { display: flex; align-items: center; gap: 3px; font-size: clamp(14px, 2.6vh, 19px); padding: 2px 10px 2px 3px; border-radius: 99px; background: rgba(74, 42, 18, .5); }
.hudgold img { width: clamp(22px, 4.4vh, 30px); height: clamp(22px, 4.4vh, 30px); }
.hudm { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.mname2 { font-size: clamp(14px, 2.7vh, 21px); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.mname2 .rage { color: #ff6a4a; display: none; }
.mname2 .rage.on { display: inline; animation: pulse .6s infinite; }
#monBar { width: clamp(150px, 40vh, 320px); height: clamp(11px, 2.2vh, 17px); }
#monBar i { background: linear-gradient(#ff9a6a, #d8432c); }
.parts { display: flex; gap: 6px; }
.part { font-size: clamp(11px, 1.9vh, 14px); padding: 1px 7px; border-radius: 99px; background: rgba(74, 42, 18, .5); color: #fff3dc; border: 2px solid var(--ink); white-space: nowrap; }
.part.broken { background: var(--gold); color: var(--ink); }
.part.broken::before { content: "✦ "; }
.timer { font-size: clamp(15px, 2.8vh, 22px); padding: 1px 12px; border-radius: 99px; background: rgba(74, 42, 18, .5); }
.timer.low { color: #ff8a6a; }

#arrow { width: 54px; height: 54px; margin: -27px 0 0 -27px; z-index: 21; display: none; pointer-events: none; }
#arrow.on { display: block; }
#arrow .ic { position: absolute; inset: 6px; border-radius: 50%; background: rgba(255, 243, 220, .9) center / 120% no-repeat; border: 3px solid var(--ink); }
#arrow .tri { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-origin: 0 0; }
#arrow .tri::after { content: ""; position: absolute; left: 24px; top: -10px; border-left: 16px solid var(--red); border-top: 10px solid transparent; border-bottom: 10px solid transparent; filter: drop-shadow(0 0 1px var(--ink)); }

#prompt { left: 50%; top: 60%; transform: translateX(-50%); z-index: 30; display: none; white-space: nowrap; padding: .3em 1em .3em .4em; border-radius: 99px;
  background: rgba(255, 243, 220, .94); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); font-size: clamp(15px, 2.9vh, 22px); align-items: center; gap: .5em; }
#prompt.on { display: flex; animation: promptIn .2s cubic-bezier(.2, 1.6, .4, 1) both; }
#prompt .k { min-width: 1.8em; height: 1.8em; padding: 0 .35em; border-radius: 10px; background: var(--ink); color: #fff3dc; display: grid; place-items: center; font-size: .85em; }
#prompt img { width: 1.9em; height: 1.9em; border-radius: 50%; background: rgba(70, 40, 20, .8); padding: 3px; }
@keyframes promptIn { from { transform: translateX(-50%) scale(.6); } to { transform: translateX(-50%) scale(1); } }

#banner { left: 0; right: 0; top: 24%; text-align: center; z-index: 31; pointer-events: none; }
#banner .b { display: inline-block; font-size: clamp(26px, 7.5vh, 64px); white-space: nowrap; padding: .05em .6em; color: #fff8ea; text-shadow: var(--ol); animation: slam .45s cubic-bezier(.2, 1.7, .4, 1) both; }
#banner .b.out { animation: bannerOut .35s ease-in both; }
#banner .b.big { font-size: clamp(34px, 11vh, 96px); color: var(--gold); }
#banner .b.bad { color: #ffb0a0; }
#banner .b.small { font-size: clamp(18px, 4.4vh, 36px); }
@keyframes slam { 0% { transform: scale(2.4) rotate(-6deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1) rotate(-3deg); opacity: 1; } }
@keyframes bannerOut { to { transform: scale(.7) rotate(-3deg); opacity: 0; } }

#subtitle { left: 50%; bottom: 23%; transform: translateX(-50%); z-index: 30; display: none; max-width: 56vw; text-align: center; pointer-events: none; }
#subtitle.on { display: block; animation: fadeUp .25s ease-out both; }
#subtitle .sp { display: inline-block; font-size: clamp(12px, 2vh, 15px); padding: 1px 9px; border-radius: 99px; background: var(--teal); color: #fff; border: 2px solid var(--ink); margin-bottom: 3px; }
#subtitle .sp.elder { background: #c46aa0; }
#subtitle .tx { font-size: clamp(15px, 2.9vh, 23px); color: #fff8ea; text-shadow: var(--ol-s); line-height: 1.3; }
@keyframes fadeUp { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

#toasts { left: 50%; top: 21%; transform: translateX(-50%); z-index: 32; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; width: 80vw; }
.toast { display: flex; align-items: center; gap: 8px; padding: 4px 16px 4px 6px; border-radius: 99px; background: rgba(255, 243, 220, .95); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink);
  font-size: clamp(14px, 2.6vh, 20px); white-space: nowrap; animation: toastIn .3s cubic-bezier(.2, 1.6, .4, 1) both; }
.toast.noicon { padding-left: 16px; }
.toast img { width: clamp(28px, 5.4vh, 40px); height: clamp(28px, 5.4vh, 40px); object-fit: contain; }
.toast.out { animation: toastOut .3s ease-in both; }
@keyframes toastIn { from { transform: translateY(-12px) scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(-10px); opacity: 0; } }

#dmg { inset: 0; z-index: 22; pointer-events: none; }
.dnum { position: absolute; transform: translate(-50%, -50%); font-size: clamp(18px, 3.8vh, 32px); color: #fff8ea; text-shadow: var(--ol-s); white-space: nowrap; }
.dnum.off { display: none; }
.dnum.show { animation: dnum .9s cubic-bezier(.2, .9, .3, 1) both; }
.dnum.weak { color: #ffb43a; font-size: clamp(22px, 4.6vh, 40px); }
.dnum.hard { color: #cfc3b0; font-size: clamp(15px, 3vh, 24px); }
.dnum.ambush { color: #ffe14a; font-size: clamp(30px, 7vh, 60px); }
.dnum.heal { color: #8cf06a; }
@keyframes dnum { 0% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; } 15% { transform: translate(-50%, -80%) scale(1); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx, 0px)), -260%) scale(.85); opacity: 0; } }

#flash { inset: 0; z-index: 19; pointer-events: none; opacity: 0; }
#flash.hurt { animation: hurtFlash .45s ease-out both; background: radial-gradient(ellipse at center, rgba(255, 60, 40, 0) 40%, rgba(255, 50, 30, .55) 100%); }
#flash.heal { animation: hurtFlash .6s ease-out both; background: radial-gradient(ellipse at center, rgba(120, 255, 120, 0) 45%, rgba(120, 255, 120, .4) 100%); }
#flash.white { animation: hurtFlash .35s ease-out both; background: rgba(255, 250, 235, .7); }
@keyframes hurtFlash { from { opacity: 1; } to { opacity: 0; } }
#diveFx { inset: 0; z-index: 18; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(ellipse at 50% 45%, rgba(20, 110, 130, 0) 45%, rgba(10, 70, 95, .55) 100%), linear-gradient(rgba(60, 170, 190, .12), rgba(10, 60, 90, .3)); }
#diveFx.on { opacity: 1; }
#lowHp { inset: 0; z-index: 18; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, rgba(255, 0, 0, 0) 55%, rgba(200, 20, 10, .4) 100%); }
#lowHp.on { animation: pulse 1s infinite; opacity: 1; }

/* faint / rewards / help */
#faint .panelbox, #rewards .panelbox, #help .panelbox { text-align: center; }
.fbtns { display: flex; flex-direction: column; gap: 1.2vh; align-items: center; margin-top: 1.4vh; }
.fbtns .btn { min-width: 60%; }
.fnote { font-size: clamp(14px, 2.6vh, 20px); margin: .4em 0; }
.rlist { display: flex; flex-wrap: wrap; justify-content: center; gap: 1vh; margin: 1vh 0; }
.ritem { display: flex; flex-direction: column; align-items: center; font-size: clamp(12px, 2vh, 15px); background: rgba(255, 255, 255, .55); border: 3px solid var(--ink2); border-radius: 14px; padding: .5vh 1vh; animation: popItem .35s cubic-bezier(.2, 1.6, .4, 1) both; }
.ritem img { width: 9vh; height: 9vh; object-fit: contain; }
@keyframes popItem { from { transform: scale(0); } to { transform: scale(1); } }
.rtime { font-size: clamp(16px, 3.4vh, 28px); }
.hrows { display: grid; grid-template-columns: auto 1fr auto; gap: .7vh 1.4vh; align-items: center; text-align: left; font-size: clamp(12px, 2.2vh, 17px); margin: .4vh 0 1vh; }
.hrows img { width: 5vh; height: 5vh; min-width: 26px; min-height: 26px; object-fit: contain; border-radius: 50%; background: rgba(70, 40, 20, .85); padding: 3px; }
.hrows .k { padding: 2px 9px; border-radius: 8px; background: var(--ink); color: #fff3dc; white-space: nowrap; font-size: clamp(11px, 1.9vh, 15px); }
.tips { text-align: left; font-size: clamp(12px, 2.1vh, 16px); font-weight: 700; line-height: 1.35; background: rgba(255, 255, 255, .5); border-radius: 14px; padding: .8vh 1.4vh; border: 3px solid var(--ink2); }
.tips p { margin: .3em 0; }
.scroll { overflow-y: auto; min-height: 0; flex: 1; }

#fade { inset: 0; z-index: 60; pointer-events: none; background: #f2a65a; clip-path: circle(0% at 50% 50%); transition: clip-path .45s ease-in-out; }
#fade.on { clip-path: circle(80% at 50% 50%); pointer-events: auto; }
#fade .ld { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: clamp(18px, 4vh, 32px); opacity: 0; transition: opacity .3s; }
#fade.on .ld { opacity: 1; }
