/* 친구 원정대 — on top of style.css */

.teambar { display: flex; align-items: center; gap: 8px; margin: 10px 0 8px; background: var(--paper); border-radius: 16px; padding: 7px 12px; box-shadow: var(--shadow); }
.teambar .faces { display: flex; }
.teambar .faces img { width: 30px; height: 30px; object-fit: cover; object-position: 50% 18%; border-radius: 50%; border: 2px solid var(--paper); margin-left: -8px; background: #f1e6cf; }
.teambar .faces img:first-child { margin-left: 0; }
.hpbar { position: relative; flex: 1; height: 16px; border-radius: 8px; background: #efe1cf; overflow: hidden; box-shadow: inset 0 1px 3px rgba(92,66,40,.2); }
.hpbar .fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #8fd08a, #5fae5a); border-radius: 8px; transition: width .35s ease; }
.hpbar .fill.low { background: linear-gradient(180deg, #f39a86, #d9604a); }
.hpbar .shield { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(45deg, rgba(120,170,220,.85) 0 5px, rgba(160,200,240,.85) 5px 10px); border-radius: 8px; transition: width .35s ease; mix-blend-mode: multiply; }
.teambar b { font: 17px var(--head); min-width: 64px; text-align: right; }
.teambar .sh { font: 14px var(--head); color: #4f7392; min-width: 38px; }
.teambar.hurt { animation: hurt .45s ease; }

.arena { position: relative; height: 31%; min-height: 190px; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); flex: none; }
.arena-bg { position: absolute; inset: -6px; background: center 70% / cover no-repeat; filter: blur(1.5px) saturate(.95); transform: scale(1.04); }
.arena::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,250,243,.05), rgba(60,40,25,.28)); pointer-events: none; }
.mons { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; gap: 2%; padding: 0 3% 6%; z-index: 2; }
.mon { position: relative; display: flex; flex-direction: column; align-items: center; width: 32%; max-width: 128px; cursor: pointer; }
.mon.boss { width: 62%; max-width: 230px; }
.mon .body { position: relative; width: 100%; aspect-ratio: 1; display: grid; place-items: end center; }
.mon .body img { width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 8px 6px rgba(40,25,15,.35)); transform-origin: 50% 100%; }
.mon .shadow { position: absolute; bottom: 2%; width: 60%; height: 10%; border-radius: 50%; background: rgba(40,25,15,.25); filter: blur(3px); z-index: -1; }
.mon .hp { width: 82%; height: 9px; border-radius: 5px; background: rgba(255,255,255,.75); overflow: hidden; margin-top: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.mon .hp i { display: block; height: 100%; background: linear-gradient(180deg, #ff9f87, #e0644c); transition: width .3s ease; }
.mon .cd { position: absolute; top: 2%; right: 4%; min-width: 30px; height: 30px; border-radius: 15px; background: var(--paper); font: 18px/30px var(--head); text-align: center; box-shadow: 0 2px 6px rgba(0,0,0,.25); z-index: 3; }
.mon .cd.soon { background: #e0644c; color: #fff; animation: pulse .7s ease-in-out infinite; }
.mon .name { position: absolute; top: -2px; left: 50%; transform: translateX(-50%); font: 12px var(--head); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.55); white-space: nowrap; opacity: .9; }
.mon.focus .body::after { content: ""; position: absolute; bottom: -2%; width: 74%; height: 16%; border-radius: 50%; border: 3px solid #fff4b8; box-shadow: 0 0 10px #ffe27a; }
.mon.raged .body img { filter: drop-shadow(0 8px 6px rgba(40,25,15,.35)) saturate(1.4) hue-rotate(-25deg); }

/* idle motion per monster kind */
.mon .body img { animation: mon-bob 1.8s ease-in-out infinite; animation-delay: var(--dl, 0s); }
.mon.k-bug .body img { animation: mon-wiggle 1.2s ease-in-out infinite; }
.mon.k-spam .body img { animation: mon-fly 2.2s ease-in-out infinite; }
.mon.k-popup .body img { animation: mon-spring 1.4s cubic-bezier(.3,1.6,.5,1) infinite; }
.mon.k-knot .body img { animation: mon-breathe 2.6s ease-in-out infinite; }
.mon.hit .body img { animation: mon-hit .32s ease; }
.mon.lunge .body { animation: mon-lunge .42s ease; }
.mon.dead { pointer-events: none; animation: mon-dead .55s ease-in forwards; }

.party { display: flex; justify-content: center; gap: 10px; margin: -24px 0 6px; position: relative; z-index: 4; }
.pm { width: 66px; display: flex; flex-direction: column; align-items: center; }
.pm .face { width: 54px; height: 54px; border-radius: 50%; background: var(--c) var(--img) 50% 22% / 168% auto no-repeat; border: 3px solid var(--paper); box-shadow: var(--shadow); }
.pm small { font: 12px var(--head); color: var(--muted); background: var(--paper); border-radius: 8px; padding: 0 6px; margin-top: -6px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.pm.act .face { animation: act .45s ease; }

.fight-shake { animation: shake .35s ease; }

/* fixed effects layer (projectiles, numbers) */
.fxlayer { position: fixed; inset: 0; pointer-events: none; z-index: 25; }
.num { position: absolute; font: 26px var(--head); color: #fff; text-shadow: 0 2px 0 #b8432f, 0 3px 8px rgba(0,0,0,.3); transform: translate(-50%, -50%); white-space: nowrap; }
.num.heal { text-shadow: 0 2px 0 #3f8a3a, 0 3px 8px rgba(0,0,0,.3); }
.num.shield { text-shadow: 0 2px 0 #3e6488, 0 3px 8px rgba(0,0,0,.3); }
.num.ouch { color: #ffe1db; font-size: 22px; }
.proj { position: absolute; width: 34px; height: 34px; transform: translate(-50%, -50%); }
.proj img { width: 100%; height: 100%; }
.star { position: absolute; width: 22px; height: 22px; background: #fff7c9; clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%); filter: drop-shadow(0 0 6px #ffe27a); transform: translate(-50%, -50%); }
.bubble { position: absolute; border-radius: 50%; border: 3px solid rgba(150,200,245,.9); background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.65), rgba(170,210,245,.25) 60%, rgba(120,170,220,.15)); transform: translate(-50%, -50%); }

/* map */
.trail-wrap { flex: 1; min-height: 0; border-radius: 26px; overflow: hidden; position: relative; box-shadow: var(--shadow); background: url(assets/bg/env_plaza.jpg) center 55% / cover; }
.trail-wrap::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,250,243,.15), rgba(255,250,243,.55)); }
.trail { position: absolute; inset: 0; z-index: 2; }
.trail svg.path { position: absolute; inset: 0; width: 100%; height: 100%; }
.node { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.node .disc { width: 64px; height: 64px; border-radius: 50%; background: var(--paper); box-shadow: var(--shadow); display: grid; place-items: center; border: 3px solid #fff; }
.node .disc img { width: 82%; height: 82%; object-fit: contain; }
.node small { font: 13px var(--head); background: rgba(255,250,243,.92); padding: 1px 8px; border-radius: 8px; white-space: nowrap; }
.node.done .disc { opacity: .55; filter: grayscale(.4); }
.node.done .disc::after { content: "✓"; position: absolute; font: 26px var(--head); color: #5d8a46; }
.node.now .disc { border-color: var(--coral); animation: ready 1.2s ease-in-out infinite; }
.node.boss .disc { width: 84px; height: 84px; }
.walker { position: absolute; transform: translate(-50%, -100%); z-index: 3; display: flex; transition: left .8s ease, top .8s ease; }
.walker img { height: 52px; margin-left: -12px; filter: drop-shadow(0 4px 4px rgba(60,40,25,.3)); }
.walker img:first-child { margin-left: 0; }
.perks { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0 0; min-height: 26px; }
.perks span { background: var(--paper); border-radius: 10px; padding: 2px 9px; font: 13px var(--head); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* upgrade cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 4px; }
.card { background: #fff3e2; border-radius: 16px; padding: 10px 6px 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: 0 3px 0 #ead3b6; }
.card img { height: 74px; }
.card b { font: 16px var(--head); }
.card small { font-size: 12.5px; color: #7a5a3c; line-height: 1.3; }
.card:active { transform: translateY(2px); box-shadow: 0 1px 0 #ead3b6; }

@keyframes mon-bob { 0%,100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-5%) scale(1.03, .97); } }
@keyframes mon-wiggle { 0%,100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-4%) rotate(-4deg); } 75% { transform: translateX(4%) rotate(4deg); } }
@keyframes mon-fly { 0%,100% { transform: translateY(-4%) rotate(-3deg); } 50% { transform: translateY(-14%) rotate(3deg); } }
@keyframes mon-spring { 0%,100% { transform: scale(1, 1); } 30% { transform: scale(1.06, .9); } 60% { transform: scale(.95, 1.08) translateY(-6%); } }
@keyframes mon-breathe { 0%,100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.05) rotate(2deg); } }
@keyframes mon-hit { 0% { transform: translateX(0); filter: brightness(2.2) saturate(.2); } 25% { transform: translateX(-7%) rotate(-6deg); } 60% { transform: translateX(6%) rotate(5deg); filter: brightness(1.3); } 100% { transform: translateX(0); } }
@keyframes mon-lunge { 0%,100% { transform: translateY(0) scale(1); } 45% { transform: translateY(16%) scale(1.14); } }
@keyframes mon-dead { 0% { transform: scale(1) rotate(0); opacity: 1; } 40% { transform: scale(1.15) rotate(-10deg); opacity: 1; } 100% { transform: scale(.1) rotate(40deg); opacity: 0; } }
@keyframes act { 0%,100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-10px) scale(1.12); } }
@keyframes hurt { 0%,100% { background: var(--paper); } 30% { background: #ffd9d1; } }

.dex { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 8px; font: 13px var(--head); color: var(--muted); }
.dex img { width: 34px; height: 34px; object-fit: contain; border-radius: 50%; background: var(--paper); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.dex img.off { filter: grayscale(1) brightness(1.2); opacity: .35; }
.rescue { display: flex; align-items: center; gap: 12px; background: #eef6e7; border-radius: 18px; padding: 8px 12px; margin: 8px 0; text-align: left; }
.rescue img { width: 76px; height: 76px; object-fit: contain; flex: none; animation: ready 1.6s ease-in-out infinite; }
.rescue b { font: 18px var(--head); display: block; }
.rescue small { color: #5d6b4f; font-size: 13px; }
.mon .tangled { position: absolute; }
.captive { position: absolute; left: 3%; top: 6%; width: 22%; max-width: 92px; z-index: 1; filter: saturate(.55); }
.captive img { width: 100%; display: block; }
.captive .wrap { position: absolute; inset: 18% 4% auto; width: 92%; opacity: .92; animation: wobble 2.4s ease-in-out infinite; }
.captive span { position: absolute; top: -6px; left: 70%; background: var(--paper); border-radius: 10px; padding: 1px 7px; font: 11px var(--head); white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.captive.freed { filter: none; animation: act .5s ease 2; }
.captive.freed .wrap { animation: unravel .8s ease-in forwards; }
.captive.freed span { display: none; }
