:root {
  --cream: #fff8ec;
  --brown: #6b4423;
  --brown2: #8a5a32;
  --line: #d9b98a;
  --accent: #ff9b3d;
  --accent2: #ff7a2a;
  --green: #4caf50;
  --red: #e5484d;
  --ink: #3a2a1c;
  --evo: #3f9f45;
  --mix: #3b82f6;
  --shadow: 0 6px 18px rgba(60, 35, 10, .28);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1e2a1e; color: var(--ink);
  font-family: 'Gowun Dodum', 'Malgun Gothic', sans-serif; }
button, input { font-family: inherit; }
.hidden { display: none !important; }
h1, h2, h3, h4, .btn, .menu b, .logo, .me-name, .fac b, .gitem b, .qt, .cmd-head b, .bt-top { font-family: 'Jua', 'Malgun Gothic', sans-serif; font-weight: 400; }
.screen { position: fixed; inset: 0; }
.bg-cover { background-size: cover; background-position: center; }

/* ---------- 공통 ---------- */
.card { background: var(--cream); border: 3px solid var(--brown2); border-radius: 16px; box-shadow: var(--shadow); padding: 18px; }
label { display: block; font-size: 14px; margin: 8px 0; }
input { width: 100%; padding: 9px 12px; margin-top: 4px; border: 2px solid var(--line); border-radius: 10px; font-size: 15px; background: #fff; outline: none; }
input:focus { border-color: var(--accent); }
.btn { border: 2px solid var(--brown2); background: #fff3dc; color: var(--brown); border-radius: 12px; padding: 8px 14px;
  font-size: 16px; cursor: pointer; transition: transform .08s, filter .15s; }
.btn:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: linear-gradient(#ffb25e, var(--accent2)); color: #fff; border-color: #c75a12; text-shadow: 0 1px 0 rgba(0,0,0,.25); }
.btn.green { background: linear-gradient(#7fd27f, #3f9f45); color: #fff; border-color: #2c7a32; }
.btn.red { background: linear-gradient(#ff8a8a, #d9434a); color: #fff; border-color: #a52a30; }
.btn.small { font-size: 13px; padding: 4px 9px; border-radius: 9px; }
.btn.big { font-size: 22px; padding: 12px 26px; }
.btn.wide { width: 100%; margin-top: 10px; }
.btn small { opacity: .7; font-size: 11px; }
.row { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.row > * { flex: 1; }
.msg { min-height: 18px; color: var(--red); font-size: 14px; white-space: pre-line; margin: 8px 0 0; }
.msg.small, .small-note { color: #8a6a4a; font-size: 12px; }
.small-note { margin: 6px 0; }
.center { text-align: center; }
.tc { text-align: center; }
.empty { color: #a08060; font-size: 13px; text-align: center; padding: 10px; }
.bar { height: 9px; background: rgba(0,0,0,.25); border-radius: 6px; overflow: hidden; border: 1px solid rgba(0,0,0,.2); }
.bar i { display: block; height: 100%; width: 0; transition: width .35s; }
.bar.exp i { background: linear-gradient(90deg, #6ec6ff, #3b82f6); }
.bar.hp i { background: linear-gradient(90deg, #7be07b, #3fae45); }
.bar.hp i.mid { background: linear-gradient(90deg, #ffd25e, #f5a623); }
.bar.hp i.low { background: linear-gradient(90deg, #ff8a8a, #e5484d); }
.el { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 8px; color: #fff; vertical-align: middle; line-height: 17px; font-family: 'Gowun Dodum'; }
.el-불 { background: #f0642a; } .el-물 { background: #3b8de0; } .el-풀 { background: #48a84a; }
.el-땅 { background: #a87a45; } .el-바람 { background: #3fa89c; } .el-빛 { background: #d9a61b; } .el-어둠 { background: #6d4aa8; }
.grade { font-size: 11px; padding: 0 6px; border-radius: 8px; font-weight: bold; }
.g-명품 { background: #ffe066; color: #8a5a00; } .g-우수 { background: #c8f0c8; color: #24702a; }
.g-보통 { background: #e8e0d0; color: #6b5a40; } .g-평범 { background: #eee; color: #888; } .g-하급 { background: #f3d0d0; color: #a33; }
.mut { font-size: 10px; padding: 1px 6px; border-radius: 8px; color: #fff; background: linear-gradient(90deg,#ff5ac8,#7a5aff,#3ad0ff); }
img.mutant { filter: hue-rotate(var(--hue)) saturate(1.3) drop-shadow(0 0 6px rgba(255,120,240,.9)); transform: scale(1.08); }
img.flip { transform: scaleX(-1); }
img.mutant.flip { transform: scaleX(-1) scale(1.08); }
.fbadge { font-size: 12px; padding: 1px 8px; border-radius: 8px; color: #fff; vertical-align: middle; font-family: 'Gowun Dodum'; }
.f-evo.fbadge, .fdot.f-evo { background: var(--evo); }
.f-mix.fbadge, .fdot.f-mix { background: var(--mix); }
.fdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; }
.fdot.hidden-f { background: #888; color: #fff; font-size: 9px; text-align: center; line-height: 12px; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.tabs button { border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: 3px 10px; cursor: pointer; font-family: 'Jua'; font-size: 14px; color: var(--brown); }
.tabs button.on { background: var(--accent); border-color: var(--accent2); color: #fff; }
.tabs.small button { font-size: 12px; padding: 1px 8px; }

/* ---------- 로그인 / 생성 / 스토리 ---------- */
#scr-login { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.title-wrap { text-align: center; }
.logo { margin: 0; font-size: 66px; color: #fff; letter-spacing: 2px;
  text-shadow: 0 4px 0 #c75a12, 0 8px 0 #7a3a0a, 0 10px 18px rgba(0,0,0,.4); -webkit-text-stroke: 2px #7a3a0a; }
.sub { margin: 10px 0 0; color: #fff; font-size: 19px; text-shadow: 0 2px 4px rgba(0,0,0,.6); }
.login-card { width: min(360px, 92vw); }
#scr-create { display: flex; align-items: center; justify-content: center; }
.create-card { width: min(640px, 95vw); max-height: 95vh; overflow: auto; }
.create-card h2 { margin: 0 0 4px; color: var(--brown); }
.pick-title { font-size: 14px; color: var(--brown2); margin: 12px 0 6px; font-weight: bold; }
.faction-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.faction { text-align: left; border: 3px solid var(--line); border-radius: 14px; padding: 10px 12px; background: #fff; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.faction b { font-family: 'Jua'; font-size: 20px; }
.faction.f-evo b { color: var(--evo); } .faction.f-mix b { color: var(--mix); }
.faction small { color: #6b5a40; font-size: 12px; }
.faction span { font-size: 12px; font-weight: bold; color: var(--accent2); }
.gender-pick, .starter-pick { display: flex; gap: 10px; }
.gender, .starter { flex: 1; background: #fff; border: 3px solid var(--line); border-radius: 14px; padding: 6px; cursor: pointer; text-align: center; }
.gender img { height: 140px; object-fit: contain; display: block; margin: 0 auto; }
.gender span, .starter div { font-family: 'Jua'; font-size: 17px; color: var(--brown); }
.starter img { width: 84px; height: 84px; object-fit: contain; }
.gender.sel, .starter.sel, .faction.sel { border-color: var(--accent2); background: #fff1df; box-shadow: 0 0 0 3px rgba(255,155,61,.35); }
.story { background: radial-gradient(circle at 50% 30%, #2a3a5a, #070a12 75%); display: flex; align-items: center; justify-content: center; }
.story-box { width: min(720px, 92vw); text-align: center; color: #f2ead8; }
.story-box p { font-size: 22px; line-height: 1.8; min-height: 120px; }
.story-box p.fade { animation: fadein 1.1s; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* ---------- 게임 화면 레이아웃 ---------- */
.scene { position: absolute; inset: 0; transition: background-image .4s; }
.scene::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,0) 20%, rgba(0,0,0,0) 70%, rgba(0,0,0,.35)); }
.topbar { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 14px; padding: 8px 12px; z-index: 5; }
.me { display: flex; align-items: center; gap: 8px; background: rgba(255,248,236,.94); border: 2px solid var(--brown2); border-radius: 14px; padding: 4px 12px 4px 4px; box-shadow: var(--shadow); min-width: 260px; }
.me img { width: 44px; height: 44px; object-fit: cover; object-position: top; border-radius: 10px; background: #fff; }
.me-name { font-size: 17px; color: var(--brown); }
.me-name .lv { color: var(--accent2); font-size: 14px; }
.me .bar { height: 7px; margin-top: 3px; }
.where { flex: 1; text-align: center; color: #fff; font-family: 'Jua'; font-size: 26px; text-shadow: 0 2px 0 #4a2a10, 0 3px 10px rgba(0,0,0,.6); }
.where small { font-size: 15px; opacity: .85; }
.gold { background: rgba(255,248,236,.94); border: 2px solid var(--brown2); border-radius: 14px; padding: 6px 14px; font-size: 16px; box-shadow: var(--shadow); }

.center { position: absolute; left: 230px; right: 300px; top: 70px; bottom: 80px; display: flex; align-items: center; justify-content: center; z-index: 2; }
.town-card, .ground-card { background: rgba(255,248,236,.93); border: 3px solid var(--brown2); border-radius: 18px; box-shadow: var(--shadow); padding: 16px 20px; width: min(640px, 100%); text-align: center; }
.town-card h2, .ground-card h2 { margin: 0; color: var(--brown); font-size: 30px; }
.town-card p, .ground-card p { margin: 6px 0; color: #6b5a40; }
.neutral-note { background: #eef3ff; border-radius: 10px; padding: 6px 10px; font-size: 13px; }
.facs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.fac { background: linear-gradient(#fffaf0, #f4e2c4); border: 2px solid var(--brown2); border-radius: 14px; padding: 10px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .1s; }
.fac:hover { transform: translateY(-2px); filter: brightness(1.05); }
.fac .ic { font-size: 26px; }
.fac b { font-size: 17px; color: var(--brown); }
.fac small { font-size: 11px; color: #8a6a4a; }
.appear { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.appear div { display: flex; flex-direction: column; align-items: center; font-size: 12px; }
.appear img { width: 76px; height: 76px; object-fit: contain; }
.ground-card .btn.big { display: block; margin: 10px auto; min-width: 240px; }

.party { position: absolute; left: 12px; top: 74px; width: 210px; z-index: 3; display: flex; flex-direction: column; gap: 6px; }
.side-title { font-family: 'Jua'; color: #fff; font-size: 15px; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.pslot { display: flex; align-items: center; gap: 6px; background: rgba(255,248,236,.93); border: 2px solid var(--brown2); border-radius: 12px; padding: 4px 8px 4px 4px; cursor: pointer; font-size: 13px; }
.pslot img { width: 50px; height: 50px; object-fit: contain; }
.pslot.empty { color: #8a6a4a; padding: 14px; cursor: default; justify-content: center; }

.side { position: absolute; right: 12px; top: 74px; bottom: 80px; width: 280px; z-index: 3; display: flex; flex-direction: column; gap: 8px; }
.here { background: rgba(30,22,14,.7); border-radius: 12px; padding: 8px; max-height: 40%; overflow: auto; }
.here-list { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.hp-row { display: flex; align-items: center; gap: 6px; color: #fff; font-size: 13px; cursor: pointer; padding: 2px 4px; border-radius: 8px; }
.hp-row:hover { background: rgba(255,255,255,.12); }
.hp-row img { width: 26px; height: 26px; object-fit: cover; object-position: top; border-radius: 6px; background: rgba(255,255,255,.8); }
.hp-row span:nth-child(2) { flex: 1; }
.hp-row .busy { font-size: 10px; background: var(--red); padding: 0 5px; border-radius: 6px; }
.chat { flex: 1; display: flex; flex-direction: column; background: rgba(30,22,14,.72); border-radius: 12px; padding: 8px; color: #fff; min-height: 0; }
.chat .tabs { margin-bottom: 4px; }
.chat-log { flex: 1; overflow-y: auto; font-size: 13px; line-height: 1.45; min-height: 60px; }
.chat-log .sys { color: #9fe08a; }
.chat-log b { color: #ffd28a; }
.chat-log .ch-room .tag { color: #8ad0ff; }
.chat input { margin-top: 6px; padding: 6px 8px; font-size: 13px; background: rgba(255,255,255,.92); border: none; }

.menu { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 8px; z-index: 4; }
.menu button { background: linear-gradient(#fffaf0, #f4e2c4); border: 2px solid var(--brown2); border-radius: 14px; padding: 6px 14px; cursor: pointer; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; min-width: 70px; }
.menu b { font-size: 17px; color: var(--brown); font-weight: 400; }
.menu small { font-size: 10px; color: #a07a50; }

/* ---------- 패널 ---------- */
.panel { position: absolute; left: 50%; top: 70px; bottom: 76px; transform: translateX(-50%); width: min(760px, calc(100vw - 24px)); background: var(--cream);
  border: 3px solid var(--brown2); border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.45); display: flex; flex-direction: column; z-index: 10; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; border-bottom: 2px solid var(--line); }
.panel-head h3 { margin: 0; color: var(--brown); font-size: 22px; }
.x { border: none; background: none; font-size: 20px; cursor: pointer; color: var(--brown2); }
.panel-body { flex: 1; overflow-y: auto; padding: 12px 14px; }
.hlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.hlist.small { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); margin-bottom: 8px; }
.hcard { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 6px 4px; text-align: center; cursor: pointer; position: relative; }
.hcard img { width: 66px; height: 66px; object-fit: contain; }
.hlist.small .hcard img { width: 52px; height: 52px; }
.hcard .nm { font-family: 'Jua'; font-size: 14px; }
.hcard .lv { font-size: 11px; color: #8a6a4a; }
.hcard.sel { border-color: var(--accent2); background: #fff1df; }
.hcard.trade { opacity: .5; }
.hcard .badges { position: absolute; left: 3px; right: 3px; top: 3px; display: flex; justify-content: space-between; pointer-events: none; }
.slotb { background: var(--accent2); color: #fff; font-size: 11px; border-radius: 50%; width: 18px; height: 18px; line-height: 18px; margin-left: auto; }
.hdetail { display: flex; gap: 14px; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 12px; }
.hdetail img.big { width: 170px; height: 170px; object-fit: contain; flex-shrink: 0; }
.hdetail .info { flex: 1; min-width: 0; }
.hdetail h4 { margin: 0; font-size: 22px; color: var(--brown); }
.hdetail .sub { font-size: 12px; color: #8a6a4a; margin: 2px 0 4px; }
.stats { display: grid; grid-template-columns: auto auto 1fr; gap: 1px 10px; font-size: 13px; margin: 6px 0; }
.stats .g { color: #3f9f45; font-size: 12px; }
.skills-line { font-size: 12px; color: #6b5a40; margin: 4px 0; }
.acts { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.rows { display: flex; flex-direction: column; gap: 4px; }
.rowi { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 5px 8px; font-size: 14px; flex-wrap: wrap; }
.rowi > span:nth-child(2), .rowi > b:first-child + * { flex: 1; }
.rowi .ic { font-size: 20px; }
.rowi img.mini { width: 36px; height: 36px; object-fit: contain; }
.rowi img.gray { filter: grayscale(1) brightness(.75); }
.rowi .cnt { color: #6b5a40; min-width: 54px; }
.rowi .cnt.ok, .rowi .ready { color: var(--green); font-weight: bold; font-size: 12px; }
.rowi .price { color: var(--accent2); font-weight: bold; min-width: 56px; text-align: right; }
.rowi small { color: #8a6a4a; }
.rowi.dim { opacity: .55; }
.t2 { color: #3b82f6; } .t3 { color: #c03ad0; }
.q-sec { font-family: 'Jua'; font-size: 16px; color: var(--brown2); margin: 12px 0 6px; }
.quest { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 6px; }
.quest.story { border-color: var(--accent); background: #fffaf2; }
.qt { font-size: 17px; color: var(--brown); }
.qtext { font-size: 13px; color: #6b5a40; margin: 4px 0; font-style: italic; }
.qobj { font-size: 13px; }
.qfoot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; font-size: 13px; color: var(--accent2); }
.dexgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; }
.dex { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; text-align: center; font-size: 12px; opacity: .55; }
.dex.own { opacity: 1; border-color: var(--accent); }
.dex img { width: 62px; height: 62px; object-fit: contain; }
.dex .st { font-size: 10px; color: #a08060; }
.recipe { display: flex; align-items: center; gap: 4px; font-size: 13px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 3px 8px; margin-bottom: 4px; flex-wrap: wrap; }
.recipe img { width: 34px; height: 34px; object-fit: contain; }
.recipe .rt { margin-left: auto; color: #8a6a4a; font-size: 12px; }
.glist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.gitem { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 6px 10px; cursor: pointer; text-align: left; }
.gitem.rec { border-color: var(--accent); background: #fffaf2; }
.gitem .glv { font-size: 12px; color: #8a6a4a; }
.gitem b { font-size: 17px; color: var(--brown); }
.gitem .gmons img { width: 30px; height: 30px; object-fit: contain; }
.gitem .recb { position: absolute; right: 8px; top: 6px; font-size: 11px; background: var(--accent2); color: #fff; border-radius: 6px; padding: 0 5px; }
.gitem .fdot { position: absolute; right: 8px; bottom: 8px; }
.travel-btn { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 10px 14px; cursor: pointer; font-size: 15px; text-align: left; }
.travel-btn b { font-family: 'Jua'; font-size: 20px; color: var(--brown); }
.route-mons { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.route-mons img { width: 34px; height: 34px; object-fit: contain; filter: brightness(.25); }
.mixbox { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 10px; }
.mixslot { width: 130px; height: 140px; border: 2px dashed var(--line); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; color: #a08060; text-align: center; cursor: pointer; }
.mixslot img { width: 84px; height: 84px; object-fit: contain; }
.mixop { font-family: 'Jua'; font-size: 30px; color: var(--accent2); }
.mixinfo { text-align: center; margin: 8px 0; font-size: 14px; min-height: 36px; }
.room-code { font-family: 'Jua'; font-size: 42px; letter-spacing: 6px; color: var(--accent2); text-align: center; background: #fff; border: 2px dashed var(--accent); border-radius: 14px; padding: 6px; }
.member { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 5px 8px; margin-bottom: 5px; }
.member img { width: 40px; height: 40px; object-fit: cover; object-position: top; border-radius: 8px; }
.member .host { font-size: 11px; background: var(--accent2); color: #fff; border-radius: 6px; padding: 0 5px; }
.member .sp { margin-left: auto; }
.raid-intro { display: flex; gap: 14px; align-items: center; }
.raid-intro img { width: 240px; max-width: 40%; }
.raid-intro h3 { margin: 0; font-size: 28px; color: #a5281a; }

/* ---------- 전투 ---------- */
.overlay { position: absolute; inset: 0; z-index: 20; }
.overlay.dim { background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; }
.battle { background-size: cover; background-position: center; display: flex; flex-direction: column; animation: fadein .25s; }
.battle::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.18); pointer-events: none; }
.bt-top { position: relative; display: flex; gap: 14px; align-items: center; justify-content: center; padding: 8px; color: #fff; font-size: 20px; text-shadow: 0 2px 4px rgba(0,0,0,.7); }
.bt-timer { background: rgba(0,0,0,.45); border-radius: 10px; padding: 0 10px; }
.bt-timer.hurry { color: #ff8a8a; }
.bt-field { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 6px 20px; min-height: 0; }
.bt-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; align-content: center; }
.bt-row.enemy { flex: 1.1; }
.bt-row.ally { flex: 1; align-content: flex-end; }
.unit { position: relative; width: 150px; display: flex; flex-direction: column; align-items: center; cursor: default; transition: transform .15s, opacity .5s; }
.unit .u-img { position: relative; height: 120px; display: flex; align-items: flex-end; }
.unit .u-img img { width: 120px; height: 120px; object-fit: contain; filter: drop-shadow(0 6px 4px rgba(0,0,0,.35)); }
.unit.boss { width: 300px; }
.unit.boss .u-img { height: 260px; }
.unit.boss .u-img img { width: 280px; height: 260px; }
.bt-row.ally.many .unit { width: 112px; }
.bt-row.ally.many .unit .u-img { height: 84px; }
.bt-row.ally.many .unit .u-img img { width: 84px; height: 84px; }
.u-info { background: rgba(255,248,236,.93); border: 2px solid var(--brown2); border-radius: 10px; padding: 3px 7px; width: 100%; font-size: 12px; text-align: left; }
.u-info b { font-family: 'Jua'; font-size: 14px; font-weight: 400; }
.u-info .owner { font-size: 10px; color: var(--accent2); }
.u-info .bar { height: 7px; margin-top: 2px; }
.u-info .hpt { font-size: 10px; color: #6b5a40; }
.unit.mine .u-info { border-color: var(--accent2); }
.unit.down { opacity: .35; filter: grayscale(1); }
.unit.captured { opacity: 0; transform: scale(.3); }
.unit.acting { transform: translateY(-10px) scale(1.06); }
.unit.hit .u-img { animation: hit .35s; }
@keyframes hit { 25% { transform: translateX(8px); filter: brightness(2.2); } 75% { transform: translateX(-6px); } }
.unit.cur .u-info { box-shadow: 0 0 0 3px #ffd25e; }
.unit.targetable { cursor: pointer; }
.unit.targetable .u-info { box-shadow: 0 0 0 3px #ff5a5a; animation: pulse .8s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(255,90,90,.4); } }
.fx { position: absolute; left: 0; right: 0; top: 20%; text-align: center; pointer-events: none; }
.dmg { position: absolute; left: 50%; transform: translateX(-50%); font-family: 'Jua'; font-size: 30px; color: #fff; -webkit-text-stroke: 2px #b02020; animation: dmg 1s forwards; white-space: nowrap; }
.dmg.super { color: #ffd84a; font-size: 36px; }
.dmg.weak { color: #ddd; font-size: 24px; }
.dmg.heal { -webkit-text-stroke: 2px #1f7a2a; color: #b8ffb8; }
.dmg.eff { -webkit-text-stroke: 2px #5a2a8a; color: #f0d8ff; font-size: 22px; }
@keyframes dmg { from { transform: translate(-50%, 0); opacity: 1; } to { transform: translate(-50%, -50px); opacity: 0; } }
.bt-bottom { position: relative; display: flex; gap: 10px; padding: 10px; background: rgba(40,28,16,.88); }
.bt-log { flex: 1; height: 130px; overflow-y: auto; color: #fff; font-size: 14px; line-height: 1.5; background: rgba(0,0,0,.25); border-radius: 10px; padding: 6px 10px; }
.bt-cmd { width: 470px; color: #fff; }
.cmd-head { font-size: 15px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.cmd-head b { font-size: 18px; color: #ffd28a; }
.cmd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cmd-grid .btn { font-size: 15px; padding: 7px 6px; }
.cmd-grid .btn i { font-style: normal; font-size: 12px; }
.wait { padding: 16px; text-align: center; color: #ffe8c8; }
.bt-result { position: absolute; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 5; }
.bt-result .card { width: min(520px, 92vw); text-align: center; max-height: 90vh; overflow: auto; }
.bt-result h2 { margin: 0 0 8px; font-size: 40px; }
.bt-result h2.win { color: var(--accent2); }
.bt-result h2.lose { color: #6b5a8a; }
.bt-result .rw { margin: 6px 0; font-size: 14px; }
.bt-result .pen { color: var(--red); }
.bt-result .btn { margin: 10px 4px 0; }

/* ---------- 교환 / 토스트 / 확인 ---------- */
.trade-card { width: min(640px, 94vw); max-height: 92vh; overflow: auto; }
.trade-card h3 { margin: 0 0 10px; color: var(--brown); }
.trade-cols { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; }
.trade-arrow { font-size: 30px; color: var(--accent2); align-self: center; }
.trade-who { font-family: 'Jua'; font-size: 16px; margin-bottom: 4px; }
.trade-who .ok { color: var(--green); font-size: 13px; }
.trade-offer { min-height: 120px; background: #fff; border: 2px dashed var(--line); border-radius: 12px; padding: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.trade-offer .hcard { width: 96px; cursor: default; }
.trade-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; max-height: 210px; overflow-y: auto; }
.trade-pick .hcard img { width: 52px; height: 52px; }
.toast { position: absolute; left: 50%; top: 80px; transform: translateX(-50%); background: rgba(40,28,16,.92); color: #fff; padding: 10px 18px;
  border-radius: 12px; font-size: 15px; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 60; white-space: pre-line; text-align: center; }
.toast.show { opacity: 1; }
.ask { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); z-index: 70; background: var(--cream); border: 3px solid var(--brown2);
  border-radius: 16px; padding: 18px 20px; box-shadow: 0 10px 40px rgba(0,0,0,.5); min-width: 320px; max-width: 92vw; text-align: center; font-size: 16px; }
.ask img.pop { width: 180px; height: 180px; object-fit: contain; animation: pop .6s; }
@keyframes pop { from { transform: scale(.2) rotate(-20deg); opacity: 0; } }

@media (max-width: 1100px) {
  .party { display: none; }
  .center { left: 12px; }
  .facs { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .side { display: none; }
  .center { right: 12px; }
  .bt-cmd { width: 100%; }
  .bt-bottom { flex-direction: column; }
  .bt-log { height: 70px; }
  .unit { width: 110px; } .unit .u-img img { width: 84px; height: 84px; } .unit .u-img { height: 84px; }
  .me { min-width: 0; }
  .where { font-size: 18px; }
}

/* ===================== 추가: 이펙트 / 연출 / 신규 UI ===================== */
.menu button { white-space: nowrap; }
.mute { background: rgba(255,248,236,.94); border: 2px solid var(--brown2); border-radius: 12px; font-size: 18px; padding: 4px 8px; cursor: pointer; box-shadow: var(--shadow); }
.scene { background-color: #3d6b3a; background-image: linear-gradient(#7cc4ff, #bfe6a8 55%, #6aa84f); }
.battle { background-color: #2e4a2c; }
.town-card.hostile { border-color: #a52a30; }
.hostile-note { background: #ffe8e8; color: #a52a30; border-radius: 10px; padding: 6px 10px; font-size: 13px; }
.fac.off { opacity: .45; filter: grayscale(.6); }
.appear .unknown { width: 76px; justify-content: center; }
.appear .unknown span { width: 64px; height: 64px; border-radius: 50%; background: rgba(0,0,0,.12); display: flex; align-items: center; justify-content: center; font-family: 'Jua'; font-size: 34px; color: #8a6a4a; }
.gitem .q, .route-mons .q { color: #a08060; font-family: 'Jua'; letter-spacing: 3px; }
.route-mons img { filter: none; }
.travel-btn.hostile { border-color: #e5a0a0; }
.travel-btn .hs { color: #a52a30; }

/* 헨치 카드: HP, 기절 */
.bar.hp.mini { height: 5px; margin: 2px 6px 0; }
.hcard.fainted img { filter: grayscale(1) brightness(.7); }
.hcard .ko { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%) rotate(-12deg); background: var(--red); color: #fff; font-family: 'Jua'; font-size: 13px; padding: 1px 8px; border-radius: 6px; }
.hcard .lv.over { color: var(--red); font-weight: bold; }
.ko-t { color: var(--red); }
.bond { font-size: 11px; }
.reb { color: #c08a00; font-size: 12px; margin-left: 2px; }
.hpline { font-size: 13px; margin: 4px 0; }
.hpline .bar { height: 8px; margin-top: 2px; }
.warn { color: var(--red); font-size: 12px; margin: 4px 0; }
.ult-t { color: #c03ad0; }
.pslot.down { opacity: .6; }
img.stone { filter: grayscale(1) sepia(.35) brightness(.85) contrast(1.1); }
.hatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.hatch-cell { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 6px; text-align: center; font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hatch-cell img { width: 70px; height: 70px; object-fit: contain; }
.dex.unknown img.shadow { filter: brightness(0) opacity(.25); }
.dex.seen { opacity: .85; }
.egg-crack { font-size: 40px; animation: crack .6s; }
@keyframes crack { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-15deg); } 75% { transform: rotate(15deg); } }
.ask img.pop.evo { filter: drop-shadow(0 0 18px #ffd84a); }
.rw.stones .stone-get { display: inline-flex; align-items: center; gap: 2px; margin: 2px 4px; }
.rw.stones img { width: 34px; height: 34px; object-fit: contain; }

/* 수색 중 */
.searching { position: absolute; inset: 0; z-index: 15; background: rgba(20,35,15,.55); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; animation: fadein .2s; }
.searching .bushes { font-size: 54px; display: flex; gap: 6px; }
.searching .bushes span { display: inline-block; animation: rustle .5s ease-in-out infinite alternate; }
.searching .bushes span:nth-child(2n) { animation-delay: .2s; }
.searching .bushes span:nth-child(3n) { animation-delay: .35s; }
@keyframes rustle { from { transform: rotate(-8deg) translateY(0); } to { transform: rotate(8deg) translateY(-4px); } }
.search-txt { font-family: 'Jua'; font-size: 34px; color: #fff; text-shadow: 0 3px 8px rgba(0,0,0,.6); }
.dots::after { content: ''; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
.searcher { height: 150px; animation: walk .45s ease-in-out infinite alternate; }
@keyframes walk { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-6px) rotate(2deg); } }
.searching.found .search-txt, .travel.found .tr-info small { color: #ffd84a; font-size: 40px; animation: pop .4s; }
.searching.found { background: rgba(255,255,255,.35); }

/* 이동 연출 */
.travel { position: absolute; inset: 0; z-index: 15; overflow: hidden; animation: fadein .25s; }
.tr-sky { position: absolute; inset: 0; background: linear-gradient(#8fd0ff, #d8f1ff 60%); }
.tr-hills { position: absolute; left: 0; right: 0; bottom: 22%; height: 40%; background:
  radial-gradient(ellipse 30% 60% at 15% 100%, #6fbf5a 98%, transparent 100%),
  radial-gradient(ellipse 35% 70% at 55% 100%, #5aae48 98%, transparent 100%),
  radial-gradient(ellipse 30% 55% at 90% 100%, #6fbf5a 98%, transparent 100%);
  background-size: 1200px 100%; background-repeat: repeat-x; animation: scroll 6s linear infinite; }
.tr-road { position: absolute; left: 0; right: 0; bottom: 0; height: 24%; background:
  repeating-linear-gradient(90deg, #d9b97c 0 80px, #cfae72 80px 160px); border-top: 6px solid #5aae48; animation: scroll2 1.2s linear infinite; }
@keyframes scroll { to { background-position: -1200px 0; } }
@keyframes scroll2 { to { background-position: -160px 0; } }
.tr-walker { position: absolute; left: 50%; bottom: 14%; height: 200px; translate: -50% 0; animation: walk .35s ease-in-out infinite alternate; }
.tr-info { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); background: rgba(255,248,236,.95); border: 3px solid var(--brown2); border-radius: 16px; padding: 12px 20px; text-align: center; min-width: 320px; font-size: 18px; }
.tr-info b { font-family: 'Jua'; font-size: 22px; color: var(--brown); }
.tr-info .bar { height: 12px; margin: 8px 0 4px; }
.tr-info .bar i { transition: width .2s linear; }

/* 전투 이펙트 */
.battle.intro { animation: btintro .6s; }
@keyframes btintro { 0% { filter: brightness(3) blur(6px); transform: scale(1.1); } 100% { filter: none; transform: none; } }
.battle.shake { animation: shake .3s; }
.battle.shake2 { animation: shake2 .45s; }
@keyframes shake { 25% { transform: translate(-5px, 3px); } 50% { transform: translate(5px, -3px); } 75% { transform: translate(-3px, -2px); } }
@keyframes shake2 { 15% { transform: translate(-12px, 6px); } 30% { transform: translate(10px, -8px); } 45% { transform: translate(-8px, 4px); } 60% { transform: translate(6px, -3px); } 80% { transform: translate(-3px, 2px); } }
.u-img { position: relative; }
.burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 3; }
.burst .flash { position: absolute; left: -60px; top: -60px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, #fff 0%, var(--c) 35%, transparent 70%); animation: flash .45s forwards; }
.burst .ring { position: absolute; left: -20px; top: -20px; width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--c); animation: ring .55s forwards; }
.burst b { position: absolute; left: -12px; top: -14px; font-size: 24px; animation: particle .7s ease-out forwards; }
.burst.big .flash { left: -100px; top: -100px; width: 200px; height: 200px; }
.burst.big b { font-size: 32px; }
@keyframes flash { from { opacity: 1; transform: scale(.3); } to { opacity: 0; transform: scale(1.3); } }
@keyframes ring { from { opacity: 1; transform: scale(.4); } to { opacity: 0; transform: scale(3.2); } }
@keyframes particle { from { transform: translate(0,0) rotate(0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(.4); opacity: 0; } }
.dmg { font-size: 38px; z-index: 4; text-shadow: 0 3px 0 rgba(0,0,0,.4); }
.dmg.super { font-size: 46px; }
.sk-banner { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); white-space: nowrap; font-family: 'Jua'; font-size: 20px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.55);
  background: var(--c); border: 2px solid #fff; border-radius: 12px; padding: 1px 12px; box-shadow: 0 4px 12px rgba(0,0,0,.4); animation: banner .9s forwards; z-index: 5; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -14px); } }
.cmd-grid .btn.ult { background: linear-gradient(90deg, #ff5ac8, #7a5aff); color: #fff; border-color: #5a2a8a; animation: pulse 1.2s infinite; }
.cmd-grid .btn.ult:disabled { animation: none; }

/* 필살기 컷신 */
.cutscene { position: absolute; inset: 0; z-index: 30; background: rgba(0,0,0,.85); overflow: hidden; display: flex; align-items: center; justify-content: center; animation: fadein .15s; }
.cutscene.out { animation: csout .25s forwards; }
@keyframes csout { to { opacity: 0; filter: brightness(4); } }
.cs-lines { position: absolute; inset: -50%; background: repeating-conic-gradient(from 0deg, transparent 0deg 4deg, rgba(255,255,255,.18) 4deg 5deg); animation: spin 1.8s linear; }
@keyframes spin { to { transform: rotate(25deg) scale(1.1); } }
.cs-band { position: absolute; left: 0; right: 0; top: 50%; height: 46%; transform: translateY(-50%) skewY(-6deg); background: linear-gradient(90deg, transparent, var(--c) 20%, var(--c) 80%, transparent); opacity: .55; animation: band .5s ease-out; }
@keyframes band { from { transform: translateY(-50%) skewY(-6deg) scaleX(0); } }
.cs-img { position: relative; height: 70%; max-width: 60%; object-fit: contain; filter: drop-shadow(0 0 30px var(--c)) drop-shadow(0 0 60px var(--c)); animation: csimg 1.7s ease-out; }
.cs-img.mutant { filter: hue-rotate(var(--hue)) drop-shadow(0 0 30px var(--c)); }
@keyframes csimg { 0% { transform: translateX(-60%) scale(.6); opacity: 0; } 25% { transform: translateX(0) scale(1.15); opacity: 1; } 70% { transform: scale(1.05); } 100% { transform: scale(1.3); } }
.cs-img.flip { animation-name: csimgf; }
@keyframes csimgf { 0% { transform: scaleX(-1) translateX(-60%) scale(.6); opacity: 0; } 25% { transform: scaleX(-1) scale(1.15); opacity: 1; } 100% { transform: scaleX(-1) scale(1.3); } }
.cs-name { position: absolute; bottom: 12%; left: 0; right: 0; text-align: center; font-family: 'Jua'; font-size: 64px; color: #fff;
  text-shadow: 0 0 20px var(--c), 0 4px 0 #000; animation: csname 1.7s ease-out; letter-spacing: 4px; }
.cs-name small { display: block; font-size: 22px; letter-spacing: 1px; opacity: .85; }
@keyframes csname { 0%, 20% { opacity: 0; transform: scale(2.5); } 35% { opacity: 1; transform: scale(1); } 100% { opacity: 1; } }

/* ===================== 모바일 (폰 세로) ===================== */
.m-only { display: none !important; }
@media (max-width: 760px) {
  .m-only { display: flex !important; }
  /* 상단바: 한 줄로 압축 */
  .topbar { gap: 6px; padding: 6px; }
  .me { flex: 1; min-width: 0; padding: 3px 8px 3px 3px; gap: 6px; border-radius: 12px; }
  .me img { width: 36px; height: 36px; }
  .me > div { min-width: 0; flex: 1; }
  .me-name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .me-name .lv { font-size: 12px; }
  .me .fbadge { display: none; }
  .where { display: none; }
  .gold { padding: 5px 9px; font-size: 14px; border-radius: 12px; }
  .mute { padding: 3px 6px; font-size: 16px; }

  /* 가운데 화면: 위아래 바 사이에서 스크롤 */
  .center { left: 6px; right: 6px; top: 58px; bottom: 62px; align-items: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .town-card, .ground-card { padding: 10px; border-radius: 14px; }
  .town-card h2, .ground-card h2 { font-size: 22px; }
  .town-card p, .ground-card p { font-size: 13px; }
  .facs { grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 8px; }
  .fac { padding: 7px 2px; border-radius: 12px; }
  .fac .ic { font-size: 20px; }
  .fac b { font-size: 15px; }
  .fac small { font-size: 10px; }
  .appear img { width: 56px; height: 56px; }
  .ground-card .btn.big { min-width: 0; width: 100%; }

  /* 하단 메뉴: 화면 폭에 꽉 차게 */
  .menu { left: 4px; right: 4px; bottom: 6px; transform: none; gap: 4px; }
  .menu button { flex: 1; min-width: 0; padding: 7px 2px; border-radius: 10px; }
  .menu b { font-size: 14px; }
  .menu small { display: none; }

  /* 채팅/접속자: 버튼으로 열고 닫는 시트 */
  body.show-side .side { display: flex; left: 6px; right: 6px; width: auto; top: 58px; bottom: 62px; z-index: 12; background: rgba(30,22,14,.9); border-radius: 14px; padding: 8px; }
  #btn-logout b { font-size: 12px; }
  #btn-chat.on { filter: brightness(.9); border-color: var(--accent2); }

  /* 패널 */
  .panel { top: 56px; bottom: 60px; width: calc(100vw - 8px); border-radius: 12px; }
  .panel-body { padding: 8px; }
  .hlist { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
  .dexgrid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
  .glist { grid-template-columns: 1fr; }
  .hatch-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }

  /* 전투 */
  .bt-top { font-size: 15px; gap: 8px; padding: 6px; }
  .bt-field { padding: 4px 4px; }
  .bt-row { gap: 4px; }
  .unit, .bt-row.ally.many .unit { width: 31vw; max-width: 112px; }
  .unit .u-img, .bt-row.ally.many .unit .u-img { height: 72px; }
  .unit .u-img img, .bt-row.ally.many .unit .u-img img { width: 72px; height: 72px; }
  .unit.boss { width: 70vw; max-width: 260px; }
  .unit.boss .u-img { height: 170px; }
  .unit.boss .u-img img { width: 190px; height: 170px; }
  .u-info { padding: 2px 4px; font-size: 10px; }
  .u-info b { font-size: 12px; }
  .u-info .el { display: none; }
  .dmg { font-size: 24px; } .dmg.super { font-size: 28px; }
  .bt-bottom { padding: 6px; gap: 6px; }
  .bt-log { height: 64px; font-size: 12px; }
  .cmd-grid { grid-template-columns: repeat(2, 1fr); gap: 5px; }
  .cmd-grid .btn { font-size: 14px; padding: 9px 4px; }
  .cmd-head { font-size: 13px; }

  /* 카드/창 */
  .trade-cols { grid-template-columns: 1fr; }
  .trade-arrow { text-align: center; }
  .create-card { padding: 12px; }
  .faction-pick small { display: none; }
  .tr-walker { height: 150px; }
  .tr-info { min-width: 0; width: 88vw; font-size: 15px; }
  .ask { width: 90vw; }
  input, select, textarea { font-size: 16px; } /* iOS 입력 시 자동 확대 방지 */
}

/* ===================== 추가 기능 (탑/월드보스/거래소/소셜/일일/회복약/자동전투) ===================== */
.tracker { position: absolute; left: 12px; bottom: 80px; width: 210px; z-index: 3; background: rgba(30,22,14,.72); color: #fff; border-radius: 12px; padding: 7px 9px; font-size: 12px; cursor: pointer; }
.tracker.hidden, .tracker:empty { display: none; }
.tr-head { font-family: 'Jua'; font-size: 14px; color: #ffd28a; margin-bottom: 2px; }
.tr-q { line-height: 1.5; }
.tr-q i { font-style: normal; color: #ffd28a; }
.tr-q.done { color: #9fe08a; }
.tr-q.story b { color: #ffb070; }
.mini-btn { background: rgba(255,248,236,.9); border: 1px solid var(--brown2); border-radius: 8px; font-size: 13px; padding: 0 5px; cursor: pointer; margin-left: 4px; }
.elem-hint { font-size: 13px; }
.ground-card .row { justify-content: center; gap: 8px; }

.bt-auto { margin-left: auto; position: absolute; right: 10px; top: 6px; background: rgba(0,0,0,.45); color: #fff; border: 2px solid rgba(255,255,255,.4); border-radius: 10px; padding: 3px 10px; font-size: 14px; cursor: pointer; font-family: inherit; }
.bt-auto.on { background: #e8a33a; border-color: #ffe0a0; color: #3a2008; box-shadow: 0 0 12px #ffbf4a; }
.auto-next { margin-top: 10px; font-size: 14px; color: #8a5a10; }

.attend-pop h3 { margin: 0 0 8px; color: var(--brown); font-size: 24px; }
.att-days { display: flex; gap: 6px; justify-content: center; margin: 8px 0; }
.att-days span { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #eee3cf; color: #8a6a4a; font-weight: bold; }
.att-days span.on { background: #ffcf6a; color: #5a3a10; }
.att-days span.today { box-shadow: 0 0 0 3px #e8742a; transform: scale(1.12); }
.att-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.att { background: #fff; border: 2px solid #e5d4b5; border-radius: 10px; padding: 6px 2px; text-align: center; font-size: 12px; }
.att.on { background: #fff1c9; border-color: #e8a33a; }
.att small { display: block; font-size: 10px; color: #6b5a40; }
.quest.claimed { opacity: .55; }
.ok { color: #2c7a32; font-weight: bold; }

.pot-have { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; font-size: 14px; }
.rowi .bar.mini { width: 120px; margin: 2px 0; }

.tower-intro { display: flex; gap: 16px; align-items: flex-start; }
.tower-ic { font-size: 90px; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); }
.tower-intro h3 { margin: 0; font-size: 28px; color: var(--brown); }
.tower-stats { display: flex; gap: 14px; margin: 8px 0; font-size: 15px; }
.tower-stats b { color: #c0541a; font-size: 20px; }
.tower-intro .row { gap: 8px; flex-wrap: wrap; }

.wb { display: flex; gap: 16px; align-items: flex-start; }
.wb-img { width: 200px; filter: hue-rotate(170deg) drop-shadow(0 6px 8px rgba(0,0,0,.4)); }
.wb h3 { margin: 0 0 6px; font-size: 24px; color: #2a4a8a; }
.bar.hp.big { height: 16px; }
.wb-hp { font-size: 13px; text-align: right; color: #6b5a40; margin-bottom: 8px; }
.wb-top { margin: 4px 0; padding-left: 22px; font-size: 14px; }
.wb-top b { color: #c0541a; margin-left: 6px; }

.msell { display: grid; grid-template-columns: 110px 1fr 80px 120px auto; gap: 6px; align-items: center; }
.msell select, .msell input { padding: 6px; border: 2px solid #e5d4b5; border-radius: 8px; font-size: 14px; font-family: inherit; }

.rank { list-style: none; padding: 0; margin: 6px 0; }
.rank li { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 10px; background: #fff; margin-bottom: 4px; border: 1px solid #eee0c8; }
.rank li.me { background: #fff1c9; border-color: #e8a33a; }
.rank img { width: 30px; height: 30px; object-fit: cover; object-position: top; border-radius: 8px; }
.rank .rk { width: 26px; text-align: center; font-family: 'Jua'; font-size: 18px; color: #8a6a4a; }
.rank .r1 { color: #e0a800; } .rank .r2 { color: #8a9aa8; } .rank .r3 { color: #b0703a; }
.rank .rv { margin-left: auto; font-weight: bold; color: #c0541a; }
.tabs.small button { font-size: 13px; padding: 4px 8px; }
.friend .face { width: 36px; height: 36px; object-fit: cover; object-position: top; border-radius: 8px; background: #fff; }
.friend.on { border-left: 4px solid #4cc35a; }
.chat-log b[data-nick] { cursor: pointer; }
.chat-log .ch-whisper, .chat-log .ch-whisper-to { color: #ffb0e0; }

.dex-reward { background: #fff8e6; border: 2px solid #e8c98a; border-radius: 12px; padding: 8px 10px; margin-bottom: 8px; font-size: 14px; }
.dr-next { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }

@media (max-width: 1100px) {
  .tracker { left: 12px; bottom: 80px; }
}
@media (max-width: 760px) {
  /* 출전 헨치: 상단바 아래 가로 줄 */
  .party { display: flex !important; flex-direction: row; left: 6px; right: 6px; top: 54px; width: auto; gap: 4px; }
  .party .side-title { display: flex; align-items: center; font-size: 0; }
  .party .side-title .mini-btn { font-size: 18px; padding: 4px 6px; margin: 0; }
  .party .pslot { flex: 1; min-width: 0; padding: 2px 4px; gap: 3px; font-size: 11px; }
  .party .pslot img { width: 30px; height: 30px; }
  .party .pslot small, .party .pslot .el { display: none; }
  .party .pslot b { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .party .pslot.empty { padding: 8px 2px; font-size: 10px; }
  .center { top: 104px; bottom: 92px; }
  .tracker { left: 6px; right: 6px; bottom: 58px; width: auto; padding: 4px 8px; display: flex; gap: 10px; overflow: hidden; white-space: nowrap; }
  .tracker .tr-head { display: none; }
  .tracker .tr-q:nth-child(n+4) { display: none; }
  .tower-intro, .wb { flex-direction: column; align-items: center; }
  .tower-ic { font-size: 60px; }
  .wb-img { width: 140px; }
  .msell { grid-template-columns: 1fr 1fr; }
  .att-grid { grid-template-columns: repeat(4, 1fr); }
  .bt-auto { top: 34px; right: 6px; font-size: 12px; padding: 2px 8px; }
  .rowi .bar.mini { width: 80px; }
}

/* ===================== 고유기 / 장비 / 허가서 ===================== */
.sig-t { color: #b0541a; cursor: help; }
.cmd-grid .btn.sig { background: linear-gradient(#fff3d6, #ffd99a); border-color: #d08a2a; }
.equip-line { margin: 4px 0; font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ask .row { flex-wrap: wrap; justify-content: center; }
.ask .row .btn small { display: block; font-size: 11px; color: #6b5a40; font-weight: normal; }
.gitem { position: relative; }
.gitem.locked { opacity: .55; filter: grayscale(.6); }
.gitem .lock { position: absolute; right: 8px; top: 6px; font-size: 16px; }
.portal { position: absolute; inset: 0; z-index: 16; display: grid; place-items: center; background: radial-gradient(circle, rgba(120,220,140,.35), rgba(0,0,0,.65)); animation: fadein .2s; }
.portal.gate { background: radial-gradient(circle, rgba(160,120,255,.5), rgba(10,0,30,.8)); }
.portal.out { opacity: 0; transition: opacity .3s; }
.pt-ring { position: absolute; width: 260px; height: 260px; border-radius: 50%; border: 8px solid rgba(255,255,255,.7); box-shadow: 0 0 40px #b08aff, inset 0 0 40px #b08aff; animation: ptspin 1.1s ease-in forwards; }
.portal:not(.gate) .pt-ring { border-color: rgba(200,255,200,.7); box-shadow: 0 0 40px #7fe07f, inset 0 0 30px #7fe07f; }
@keyframes ptspin { from { transform: scale(.2) rotate(0); opacity: 0; } 50% { opacity: 1; } to { transform: scale(1.6) rotate(360deg); opacity: 0; } }
.pt-txt { position: relative; color: #fff; font-family: 'Jua'; font-size: 20px; text-align: center; text-shadow: 0 2px 6px rgba(0,0,0,.8); }
.pt-txt b { display: block; font-size: 34px; color: #ffe08a; }
.btn.red small { color: #ffe; }

/* ===================== 다이아 / 다이아 상점 ===================== */
.gold.dia { cursor: pointer; font-family: inherit; color: #2a5ab0; }
.cash-top { background: linear-gradient(90deg, #e8f0ff, #f6eaff); border: 2px solid #b8c8f0; border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
.cash-top b { font-size: 22px; color: #2a5ab0; margin: 0 6px; }
.cash-top small { display: block; color: #5a6a8a; }
.cash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.cash-item { background: #fff; border: 2px solid #d8e0f5; border-radius: 12px; padding: 8px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.cash-item.stone { border-color: #e8c98a; background: linear-gradient(#fffbea, #fff); }
.ci-ic { font-size: 34px; height: 76px; display: grid; place-items: center; }
.ci-ic img { width: 76px; height: 76px; object-fit: contain; }
.cash-item small { color: #6b5a40; font-size: 11px; flex: 1; }
.btn.red, button.red { background: #e5484d; color: #fff; border-color: #b0282d; }
@media (max-width: 760px) { .gold.dia { padding: 5px 7px; } .cash-grid { grid-template-columns: repeat(2, 1fr); } }

/* 모바일 전투 로그: 최근 2줄만 (누르면 펼침) → 화면 안 가리게 */
@media (max-width: 760px) {
  .bt-log { flex: none; height: 38px; font-size: 11px; line-height: 1.45; padding: 3px 8px; transition: height .2s; position: relative; }
  .bt-log.open { height: 150px; }
  .bt-log::after { content: '▲ 로그'; position: sticky; float: right; bottom: 0; font-size: 10px; opacity: .6; }
  .bt-log.open::after { content: '▼ 접기'; }
  .bt-bottom { gap: 4px; padding: 4px 6px 6px; }
  .cmd-grid .btn { padding: 7px 4px; font-size: 13px; }
  .cmd-head { margin-bottom: 4px; }
}
@media (max-width: 760px) and (max-height: 700px) {
  .unit .u-img, .bt-row.ally.many .unit .u-img { height: 56px; }
  .unit .u-img img, .bt-row.ally.many .unit .u-img img { width: 56px; height: 56px; }
  .bt-top { padding: 3px; font-size: 13px; }
}

/* ===================== 모바일 채팅 (아래쪽 시트) ===================== */
#btn-chat { position: relative; }
#btn-chat .badge { position: absolute; top: -6px; right: -4px; background: #e5484d; color: #fff; border-radius: 10px; font-size: 11px; min-width: 18px; padding: 0 4px; line-height: 18px; text-align: center; }
#btn-chat .badge.hidden { display: none; }
.chat-close { margin-left: auto; }
@media (max-width: 760px) {
  /* 채팅을 화면 아래 절반만 차지하는 시트로 → 게임 화면 위쪽은 보이게 */
  body.show-side .side { top: auto; height: 46%; bottom: 58px; padding: 6px; gap: 4px; background: rgba(20,14,8,.94); box-shadow: 0 -6px 20px rgba(0,0,0,.4); }
  body.show-side .here { max-height: 26px; overflow: hidden; padding: 4px 8px; flex: none; }
  body.show-side.here-open .here { max-height: 40%; overflow: auto; }
  body.here-open .here-arrow { display: inline-block; transform: rotate(180deg); }
  body.show-side .chat { padding: 4px 6px; }
  body.show-side .chat .tabs button { padding: 3px 8px; font-size: 12px; }
  body.show-side .chat-log { font-size: 13px; }
  body.show-side .chat input { font-size: 16px; padding: 8px; margin-top: 4px; }
  /* 입력 중(키보드 올라옴): 채팅창을 위쪽까지, 메뉴는 숨김 */
  body.typing.show-side .side { top: 6px; height: auto; bottom: 6px; }
  body.typing .menu, body.typing .tracker { display: none; }
}

/* 기술 분류 / 위력 / 버프 표시 */
.cat { display: inline-block; font-size: 10px; padding: 0 5px; border-radius: 6px; color: #fff; background: var(--c); vertical-align: middle; }
.pw { font-size: 11px; color: #b0541a; font-weight: bold; }
.sk-sub { display: block; font-size: 10px; opacity: .75; font-weight: normal; }
.bf { display: inline-block; font-size: 9px; padding: 0 3px; border-radius: 4px; margin-left: 1px; color: #fff; vertical-align: middle; }
.bf.up { background: #2c8a3a; } .bf.down { background: #a0283a; }
.hcard .gr { font-size: 10px; }
.formula { background: #fff8e6; border: 1px solid #e8c98a; border-radius: 10px; padding: 6px 10px; margin: 8px 0; font-size: 13px; }
.formula summary { cursor: pointer; font-weight: bold; color: #8a5a10; }
.formula p { margin: 6px 0; } .formula ul { margin: 2px 0; padding-left: 18px; }
.recipe .tag { display: inline-block; font-size: 10px; background: #f0e2c4; border-radius: 6px; padding: 0 5px; margin-right: 4px; color: #6b4a2a; }
.invite-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; } .invite-list small { opacity: .7; }
.trade-money { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.trade-money input { width: 120px; padding: 6px; font-size: 15px; }
.tr-money { font-weight: bold; color: #8a5a10; margin-bottom: 4px; width: 100%; }
.tr-eq-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; max-height: 120px; overflow-y: auto; }
.tr-eq { padding: 6px 10px; border: 1px solid #c9b48a; border-radius: 8px; background: #fffaf0; cursor: pointer; font-size: 14px; user-select: none; }
.tr-eq.sel { background: #ffe9b0; border-color: #d39a1c; font-weight: bold; }
.tr-eq .minus { margin-left: 6px; padding: 0 6px; border-radius: 6px; background: #d9534f; color: #fff; }
/* 도감 상세 */
.dex[data-dex] { cursor: pointer; }
.dex[data-dex]:hover { transform: translateY(-2px); box-shadow: 0 3px 8px rgba(0,0,0,.12); }
.dexinfo { text-align: left; max-height: 66vh; overflow-y: auto; min-width: min(420px, 82vw); }
.di-head { display: flex; gap: 12px; align-items: center; }
.di-head img { width: 96px; height: 96px; object-fit: contain; }
.di-head h3 { margin: 0 0 4px; }
.di-own { font-size: 12px; background: var(--accent); color: #fff; border-radius: 8px; padding: 1px 6px; vertical-align: middle; }
.di-st { display: grid; grid-template-columns: 44px 44px 1fr 92px 70px; align-items: center; gap: 6px; font-size: 13px; margin: 3px 0; }
.di-st .bar { height: 8px; background: #eee3cf; border-radius: 4px; overflow: hidden; }
.di-st .bar i { display: block; height: 100%; background: #e0a43a; }
.di-st .bar.g i { background: #6cb86a; }
.di-st small { color: #8a7050; text-align: right; }
.di-sig { background: #fff8e6; border-radius: 8px; padding: 6px 8px; font-size: 14px; }
.di-src div { padding: 5px 0; border-bottom: 1px dashed #e6d8bd; font-size: 14px; }
.di-src small { color: #8a7050; }
.di-evo { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.di-evo span { display: flex; flex-direction: column; align-items: center; opacity: .6; }
.di-evo span.cur { opacity: 1; font-weight: bold; }
.di-evo img { width: 52px; height: 52px; object-fit: contain; }
@media (max-width: 700px) {
  .di-st { grid-template-columns: 38px 36px 1fr 78px; font-size: 12px; }
  .di-st .bar.g { display: none; }
  .di-head img { width: 72px; height: 72px; }
}
.di-evo img.shadow { filter: brightness(0) opacity(.25); }
/* 버프·디버프·상태이상 연출 */
.aura { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.aura .glow { position: absolute; left: 50%; bottom: 4%; width: 110%; height: 34%; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(ellipse, var(--c) 0%, transparent 70%); opacity: 0; animation: aura-glow 1.1s ease-out; }
.aura b { position: absolute; left: calc(50% + var(--x)); bottom: 10%; font-size: 22px; font-weight: bold; color: var(--c);
  text-shadow: 0 0 6px var(--c), 0 2px 0 rgba(0,0,0,.35); opacity: 0; animation: aura-up 1s ease-out var(--d) forwards; }
.aura-down b, .aura-miss b { animation-name: aura-down; bottom: auto; top: 6%; }
.aura-guard .glow { bottom: 0; height: 100%; border-radius: 40%; background: radial-gradient(circle, transparent 45%, var(--c) 70%, transparent 75%); }
.aura-sleep b { font-family: 'Jua', sans-serif; }
@keyframes aura-glow { 0% { opacity: 0; transform: translateX(-50%) scale(.6); } 30% { opacity: .85; } 100% { opacity: 0; transform: translateX(-50%) scale(1.15); } }
@keyframes aura-up { 0% { opacity: 0; transform: translateY(0) scale(.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-90px) scale(1.1); } }
@keyframes aura-down { 0% { opacity: 0; transform: translateY(0) scale(1.1); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(80px) scale(.7); } }
/* 목록 필터 */
.fbar { background: #fff8ea; border: 1px solid #ead9b8; border-radius: 10px; padding: 6px 8px; margin-bottom: 8px; }
.frow { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 3px 0; }
.fchip { border: 1px solid #d8c39b; background: #fff; border-radius: 14px; padding: 3px 10px; font-size: 13px; cursor: pointer; font-family: inherit; }
.fchip.on { background: #e8a33a; color: #fff; border-color: #d18a1d; font-weight: bold; }
.fsearch { flex: 1; min-width: 120px; padding: 5px 8px; border: 1px solid #d8c39b; border-radius: 8px; font-size: 14px; }
.ftog { font-size: 13px; display: flex; align-items: center; gap: 3px; cursor: pointer; white-space: nowrap; }
.mixhint { margin-top: 6px; padding: 8px 10px; background: #f3ecff; border: 1px dashed #b9a2e6; border-radius: 8px; font-size: 14px; line-height: 1.5; }
.mixhint small { color: #7a64a8; }
.evo-rule { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 6px; background: #fff8ea; border-radius: 8px; }
.evo-rule th, .evo-rule td { padding: 4px 6px; text-align: center; border-bottom: 1px solid #ead9b8; }
b.ok, .cnt.ok { color: #2c8a3a; }
/* 상점 */
.shop-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.shop-mode button { padding: 12px; font-size: 18px; font-family: inherit; border: 2px solid #d8c39b; background: #fff; border-radius: 12px; cursor: pointer; }
.shop-mode button.on { background: linear-gradient(#ffcf6b, #f0a63a); border-color: #c9851b; color: #fff; font-weight: bold; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.sellrow { cursor: pointer; }
.sellrow.incart { background: #fff1c9; outline: 2px solid #f0b443; }
.cbadge { background: #e2563b; color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; }
.cartbar { position: sticky; bottom: -12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end;
  background: #fffaf0; border-top: 2px solid #ead9b8; padding: 10px 6px; margin-top: 10px; z-index: 2; }
.cartbar > span { margin-right: auto; font-size: 15px; }
.cartbar .sumg { color: #b5781a; font-size: 17px; }
[data-act=allloot] { margin-bottom: 6px; }
/* 부화 수량 */
.qty { display: flex; gap: 4px; justify-content: center; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.qty input { width: 64px; text-align: center; font-size: 16px; padding: 4px; }
.hatch-many { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; max-height: 40vh; overflow-y: auto; margin: 6px 0; }
.hatch-many span { display: flex; flex-direction: column; align-items: center; font-size: 11px; }
/* 프리셋 */
.presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; padding: 6px 8px; background: #eef6ff; border-radius: 10px; }
.presets .pl { font-weight: bold; font-size: 13px; margin-right: 2px; }
.pset { display: inline-flex; border: 1px solid #9cbbe0; border-radius: 8px; overflow: hidden; background: #fff; }
.pset button { border: 0; background: transparent; padding: 4px 8px; font-family: inherit; cursor: pointer; font-size: 13px; }
.pset .pload { font-weight: bold; color: #2a5a9a; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pset.empty .pload { color: #aaa; }
.pset .psave { border-left: 1px solid #c9dbf0; }
.presets .btn { margin-left: auto; }
/* ===== 스킬 이펙트 개편: 단계별 강도 + 속성 고유 모양 ===== */
.burst b { font-size: calc(22px * var(--s, 1)); }
.burst .ring.r2 { animation-delay: .08s; border-width: 2px; }
.burst.lv3 .flash { left: -80px; top: -80px; width: 160px; height: 160px; }
.burst.lv4 .flash { left: -110px; top: -110px; width: 220px; height: 220px; }
.burst .shape { position: absolute; pointer-events: none; }
/* 불: 불기둥 */
.burst .shape.pillar { left: -26px; bottom: -40px; width: 52px; height: 150px; border-radius: 40% 40% 20% 20%;
  background: linear-gradient(to top, #fff6c0, #ffb02a 30%, #ff4a1a 65%, transparent); filter: blur(2px); transform-origin: bottom; animation: pillar .6s ease-out forwards; }
.burst .shape.pillar.s2 { left: -44px; width: 88px; opacity: .6; animation-delay: .08s; }
@keyframes pillar { 0% { transform: scaleY(0) scaleX(.6); opacity: 1; } 40% { transform: scaleY(1.1) scaleX(1); } 100% { transform: scaleY(1.2) scaleX(.3); opacity: 0; } }
/* 물: 물보라 */
.burst .shape.splash { left: -70px; top: -10px; width: 140px; height: 60px; border-radius: 50% 50% 0 0;
  border-top: 8px solid #bfe6ff; border-left: 6px solid transparent; border-right: 6px solid transparent; animation: splash .6s ease-out forwards; }
.burst .shape.splash.s2 { left: -100px; width: 200px; animation-delay: .1s; border-top-color: #3ba7ff; }
@keyframes splash { 0% { transform: scale(.2, .2) translateY(30px); opacity: 1; } 60% { transform: scale(1, 1.3) translateY(-20px); opacity: .9; } 100% { transform: scale(1.2, 1.5) translateY(-34px); opacity: 0; } }
/* 풀: 덩굴 고리 */
.burst .shape.vine { left: -55px; top: -55px; width: 110px; height: 110px; border-radius: 50%;
  border: 6px dashed #52c44a; animation: vine .7s ease-out forwards; }
.burst .shape.vine.s2 { left: -75px; top: -75px; width: 150px; height: 150px; border-color: #9be36a; animation-direction: normal; animation-delay: .06s; }
@keyframes vine { 0% { transform: rotate(0) scale(.3); opacity: 1; } 100% { transform: rotate(270deg) scale(1.1); opacity: 0; } }
/* 땅: 균열 + 바위 */
.burst .shape.crack { left: -80px; top: 20px; width: 160px; height: 24px;
  background: repeating-linear-gradient(115deg, transparent 0 10px, #5a3a1a 10px 13px, transparent 13px 22px); animation: crack .7s ease-out forwards; }
.burst .shape.crack.s2 { top: 34px; left: -110px; width: 220px; animation-delay: .05s; }
@keyframes crack { 0% { transform: scaleX(0); opacity: 1; } 30% { transform: scaleX(1); } 100% { transform: scaleX(1.05); opacity: 0; } }
/* 바람: 참격 */
.burst .shape.slash { left: -70px; top: -4px; width: 140px; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, transparent, #fff, #7fe0d0, transparent); transform: rotate(-30deg); animation: slash .45s ease-out forwards; }
.burst .shape.slash.s2 { transform: rotate(30deg); animation-delay: .1s; }
@keyframes slash { 0% { clip-path: inset(0 100% 0 0); opacity: 1; } 60% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 0 100%); opacity: .2; } }
/* 빛: 빛기둥 */
.burst .shape.beam { left: -22px; top: -220px; width: 44px; height: 300px;
  background: linear-gradient(to bottom, transparent, #fffbe0 30%, #ffd84a 70%, transparent); filter: blur(1px); animation: beam .6s ease-out forwards; }
.burst .shape.beam.s2 { left: -40px; width: 80px; opacity: .5; }
@keyframes beam { 0% { transform: scaleX(0); opacity: 1; } 30% { transform: scaleX(1.2); } 100% { transform: scaleX(.1); opacity: 0; } }
/* 어둠: 소용돌이 */
.burst .shape.vortex { left: -60px; top: -60px; width: 120px; height: 120px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, #2a0a4a, #9a5aff, transparent, #2a0a4a, transparent); animation: vortex .7s ease-in forwards; }
.burst .shape.vortex.s2 { left: -85px; top: -85px; width: 170px; height: 170px; opacity: .55; }
@keyframes vortex { 0% { transform: rotate(0) scale(1.2); opacity: 0; } 30% { opacity: 1; } 100% { transform: rotate(-540deg) scale(.1); opacity: 0; } }
/* 완전체 타격: 화면 속성 색 번쩍 */
#battle.tint::after { content: ''; position: absolute; inset: 0; background: var(--tint); mix-blend-mode: screen; pointer-events: none; z-index: 20; animation: tint .35s ease-out forwards; }
@keyframes tint { from { opacity: .45; } to { opacity: 0; } }
/* 날아가는 속성 탄 */
.proj { position: absolute; width: 0; height: 0; z-index: 15; pointer-events: none; animation: proj .23s ease-in forwards; }
.proj i { position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle, #fff 0%, var(--c) 45%, transparent 72%);
  box-shadow: 0 0 12px var(--c), 0 0 24px var(--c); }
.proj b { position: absolute; left: -12px; top: -14px; font-size: 22px; }
.proj.lv2 i { transform: scale(1.3); } .proj.lv3 i { transform: scale(1.7); } .proj.lv4 i { transform: scale(2.2); }
@keyframes proj { from { transform: translate(0, 0) scale(.6); } to { transform: translate(var(--tx), var(--ty)) scale(1.2); } }
/* 필살기 전장 연출 */
.ult-fx { position: absolute; inset: 0; z-index: 25; pointer-events: none; overflow: hidden; }
.ult-fx .veil { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, var(--c), transparent 75%); opacity: 0; animation: veil 1.2s ease-out forwards; }
.ult-fx .sweep { position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); transform: skewX(-20deg); animation: sweep .7s ease-in .1s forwards; }
.ult-fx b { position: absolute; top: -40px; font-size: calc(30px * var(--s)); animation: rain .75s ease-in var(--d) forwards; filter: drop-shadow(0 0 8px var(--c)); }
.ult-fx .boom { position: absolute; left: 50%; top: 32%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: #fff; box-shadow: 0 0 80px 40px var(--c); animation: boom .9s ease-out .5s forwards; opacity: 0; }
@keyframes veil { 0% { opacity: 0; } 25% { opacity: .75; } 100% { opacity: 0; } }
@keyframes sweep { to { left: 120%; } }
@keyframes rain { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(70vh) rotate(200deg); opacity: 0; } }
@keyframes boom { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(60); } }
/* 필살기 컷신 파티클 */
.cs-p { position: absolute; left: 50%; top: 50%; font-size: 34px; transform: rotate(var(--a)) translateY(-40px); opacity: 0; animation: csp 1.5s ease-out var(--d) forwards; z-index: 2; }
@keyframes csp { 0% { opacity: 0; transform: rotate(var(--a)) translateY(-30px) scale(.5); } 30% { opacity: 1; } 100% { opacity: 0; transform: rotate(calc(var(--a) + 60deg)) translateY(-46vh) scale(1.4); } }
.cs-name { animation: csname 1.6s ease-out; }
@keyframes csname { 0% { transform: scale(2.4); opacity: 0; letter-spacing: 20px; } 25% { transform: scale(1); opacity: 1; letter-spacing: 2px; } 90% { opacity: 1; } 100% { opacity: 1; } }
/* 수문장 스토리 컷신 */
.gate-scene { position: fixed; inset: 0; z-index: 90; background: radial-gradient(ellipse at 50% 35%, rgba(60,40,20,.75), rgba(0,0,0,.92)); display: flex; flex-direction: column; justify-content: space-between; padding: 6vh 16px; animation: fadein .4s; cursor: pointer; }
.gate-scene.out { animation: csout .3s forwards; }
.gs-top { text-align: center; color: #ffe2a0; font-family: 'Jua', sans-serif; }
.gs-top small { display: block; color: #c9b28a; font-size: 14px; letter-spacing: 2px; }
.gs-top b { font-size: clamp(22px, 5vw, 38px); text-shadow: 0 0 18px #ffb02a; animation: csname 1.4s ease-out; display: inline-block; }
.gs-box { max-width: 760px; width: 100%; margin: 0 auto; background: rgba(255,250,235,.96); border: 3px solid #c9963a; border-radius: 14px; padding: 16px 18px 26px; position: relative; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.gs-who { position: absolute; top: -16px; left: 16px; background: #6b4a1e; color: #fff; padding: 3px 14px; border-radius: 10px; font-family: 'Jua', sans-serif; font-size: 16px; }
.gs-who.boss { background: #8a2a1a; }
.gs-who.ancient { background: linear-gradient(90deg, #2a6a8a, #6a3a9a); }
.gs-text { font-size: clamp(16px, 3.6vw, 20px); line-height: 1.6; min-height: 3.2em; color: #3a2a12; }
.gs-next { position: absolute; right: 14px; bottom: 6px; font-size: 12px; color: #a08050; animation: pulse 1.2s infinite; }
.pset button, .pset button:disabled { height: 28px; min-height: 0; line-height: 1; margin: 0; box-shadow: none; transform: none; opacity: 1; }
/* 완전체별 필살기 변주 */
.ult-fx .veil { background: radial-gradient(ellipse at 50% 30%, var(--c), var(--c2) 45%, transparent 78%); }
.ult-fx.rev .sweep { left: auto; right: -40%; transform: skewX(20deg); animation-name: sweeprev; }
@keyframes sweeprev { to { right: 120%; } }
.ult-fx .halo { position: absolute; left: 50%; top: 30%; width: 60vmin; height: 60vmin; margin: -30vmin; border-radius: 50%;
  border: 6px solid var(--c2); box-shadow: 0 0 40px var(--c2), inset 0 0 40px var(--c); animation: halo 1.1s ease-out forwards; opacity: 0; }
@keyframes halo { 0% { transform: scale(.2) rotate(0); opacity: 1; } 100% { transform: scale(1.8) rotate(90deg); opacity: 0; } }
.cutscene .cs-band { background: linear-gradient(90deg, transparent, var(--c) 20%, var(--c2) 50%, var(--c) 80%, transparent); }
.cutscene.grand .cs-lines { background: repeating-conic-gradient(from 0deg, transparent 0deg 3deg, rgba(255,240,180,.3) 3deg 4deg); }
.cutscene.grand .cs-name { color: #fff6d0; text-shadow: 0 0 20px var(--c2), 0 0 40px var(--c); }
/* 신수 */
.raid-pick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.raid-pick .rp { display: flex; flex-direction: column; align-items: center; width: 92px; padding: 6px 4px; border: 2px solid #d8c39b; border-radius: 10px; background: #fff; cursor: pointer; font-family: inherit; }
.raid-pick .rp img { width: 56px; height: 56px; object-fit: contain; }
.raid-pick .rp.on { border-color: #d9534f; background: #fff1ec; }
.raid-pick .rp small { font-size: 11px; color: #8a7050; }
.divine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.divine-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; border-radius: 12px; background: linear-gradient(#fffaf0, #fff1d6); border: 2px solid #e6c788; text-align: center; }
.divine-cell img { width: 110px; height: 110px; object-fit: contain; }
.divine-cell img.dim { filter: grayscale(.6) brightness(.8); }
.divine-cell .bar { width: 100%; }
