html, body { margin: 0; height: 100%; background: #05070a; color: #f4ead2;
  font-family: "Malgun Gothic", Segoe UI, sans-serif; overflow: hidden; }
#app {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 210px;
  height: 100%;
}
#field { position: relative; grid-column: 1; grid-row: 1; overflow: hidden; }
#sky { position: absolute; inset: 0; background-size: cover; background-position: center bottom; }
#actors { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
#fxLayer { position: absolute; inset: 0; pointer-events: none; z-index: 12; overflow: hidden; }
#fxLayer .arrowFx {
  position: absolute; width: 56px; height: 5px; pointer-events: none;
  background: linear-gradient(90deg, #f4ecd8 0 10px, #9a6630 10px 100%);
  border-radius: 2px;
  filter: drop-shadow(0 0 2px #000) drop-shadow(0 0 4px #fff3b0aa);
}
#fxLayer .arrowFx::before {
  content: ""; position: absolute; right: 100%; top: -1px; width: 70px; height: 7px;
  background: linear-gradient(90deg, #fff3b000, #fff3b0aa); border-radius: 4px;
}
#fxLayer .arrowFx::after {
  content: ""; position: absolute; right: -11px; top: -5px;
  border-left: 13px solid #e6ebf2; border-top: 7px solid transparent; border-bottom: 7px solid transparent;
}
#fxLayer .fx {
  position: absolute; pointer-events: none; image-rendering: pixelated;
  transform: translate(-50%, -85%);
}
#orderBar {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
  z-index: 30; pointer-events: auto;
  padding: 6px 10px;
  background: #0a0806cc;
  border: 1px solid #8a6a22;
  border-radius: 8px;
  max-width: 96%;
  overflow-x: auto;
}
.frame {
  width: 46px; height: 46px;
  border: 4px solid #c9a227;
  border-radius: 5px;
  overflow: hidden;
  background: #1a140e;
  box-shadow: 0 2px 8px #0008;
  flex: none;
  position: relative;
  box-sizing: border-box;
}
.frame.ally { border-color: #3d8fff; }
.frame.foe { border-color: #e22b22; }
.frame.now {
  box-shadow: 0 0 0 2px #ffe08a, 0 0 12px #ffe08a88;
}
.frame.picked { box-shadow: 0 0 0 2px #ffd36a; }
.frame.ally.picked { box-shadow: 0 0 0 2px #9ec8ff; }
.head {
  width: 46px; height: 46px;
  background-repeat: no-repeat;
  image-rendering: pixelated;
}
.ord-arr { color: #ffe08a; font-size: 14px; font-weight: 700; padding: 0 2px; flex: none; }
body.mobile .frame, body.mobile .head { width: 36px; height: 36px; }
#stagePick {
  position: absolute; left: 10px; top: 10px; z-index: 31;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 8px 10px;
  background: #0a0806cc;
  border: 1px solid #8a6a22;
  border-radius: 8px;
  max-width: min(320px, 42%);
}
#stagePick label { font-size: 11px; color: #c9a227; letter-spacing: .04em; }
#worldMap { position: fixed; inset: 0; z-index: 50; background: #05070a; overflow-x: hidden; overflow-y: auto; padding-top: 52px; box-sizing: border-box; }
#worldMap[hidden] { display: none; }
#worldMap .wm-frame { cursor: grab; user-select: none; -webkit-user-select: none; }
#worldMap.dragging, #worldMap.dragging * { cursor: grabbing !important; }
#worldMap .wm-frame {
  position: relative; width: 100%; aspect-ratio: 4 / 3;
  background: url("../assets/map/britain.jpg") center / 100% 100% no-repeat;
  box-shadow: 0 0 40px #000 inset;
  font-family: "Palatino Linotype", "Book Antiqua", "바탕", Batang, serif;
}
#worldMap .wm-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#worldMap .wm-lines polyline, #worldMap .wm-lines path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
#worldMap .wm-road { stroke: #3a1405; stroke-width: 3px; stroke-dasharray: 3 6; opacity: .95; }
#worldMap .wm-sea { stroke: #3a2a18; stroke-width: 2px; stroke-dasharray: 8 6; opacity: .55; }
#worldMap .wm-rift { stroke: #7a3ac0; stroke-width: 2px; stroke-dasharray: 6 5; opacity: .7; }
#worldMap .wm-pt {
  position: absolute; transform: translate(-50%, -50%); padding: 0; margin: 0; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center;
}
#worldMap .wm-pt i {
  display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 700;
  width: 26px; height: 26px; border-radius: 50%; font-size: 13px;
  color: #2a1a08; background: radial-gradient(circle at 35% 30%, #fff3c0, #d8b060 60%, #8a6420);
  border: 2px solid #3a2410; box-shadow: 0 2px 4px #0008;
}
#worldMap .wm-pt.stage i { width: auto; min-width: 26px; padding: 0 5px; border-radius: 13px; font-size: 12px; letter-spacing: -.3px; }
#worldMap .wm-pt.town i { width: 36px; height: 36px; font-size: 19px; color: #e8eeff; background: radial-gradient(circle at 35% 30%, #a0c0ff, #3a5aa8 60%, #1a2a58); border-color: #c9a227; }
#worldMap .wm-pt.boss i { width: 32px; height: 32px; font-size: 17px; color: #fff; background: radial-gradient(circle at 35% 30%, #ff9a8a, #b02a20 60%, #500a08); }
#worldMap .wm-pt.void i { width: 34px; height: 34px; font-size: 18px; color: #f0d8ff; background: radial-gradient(circle at 50% 50%, #1a0028 20%, #6a2ab0 60%, #c080ff); border-color: #2a0a40; animation: wmPulse 2s ease-in-out infinite; }
#worldMap .wm-pt.done i { box-shadow: 0 0 0 2px #ffe08a, 0 2px 4px #0008; }
#worldMap .wm-pt.done::after {
  content: "✔"; position: absolute; right: -6px; top: -8px; font-size: 12px; font-weight: 700; color: #3a9a2a; text-shadow: 0 0 2px #fff, 0 0 2px #fff;
}
#worldMap .wm-pt.open:not(.done) i { animation: wmPulse 1.6s ease-in-out infinite; }
#worldMap .wm-pt.lock { cursor: not-allowed; }
#worldMap .wm-pt.lock i { filter: grayscale(1) brightness(.75); opacity: .7; animation: none; }
#worldMap .wm-pt.lock .wm-name { filter: grayscale(1); opacity: .7; }
#worldMap .wm-pt:not(.lock):hover i { transform: scale(1.2); }
#worldMap .wm-pt.here i { outline: 2px solid #fff; outline-offset: 3px; }
#worldMap .wm-name {
  margin-top: 2px; padding: 1px 6px; font-size: 12px; font-weight: 700; white-space: nowrap; color: #ffe08a;
  background: #1a1008d9; border: 1px solid #8a6a22; border-radius: 4px; text-shadow: 0 1px 2px #000;
}
#worldMap .wm-top {
  position: fixed; z-index: 2; left: 12px; right: 24px; top: 10px; display: flex; align-items: center; gap: 14px;
  padding: 6px 12px; background: #120c06d9; border: 1px solid #6b5a3a; color: #e8d8a0;
}
#worldMap .wm-title { font-size: 17px; letter-spacing: .08em; color: #ffe08a; margin-right: auto; }
#worldMap .wm-cur { display: flex; align-items: center; gap: 4px; font-size: 13px; }
#worldMap .wm-cur b { color: #fff; }
#worldMap .coin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3a0, #d4a020 60%, #8a6010); }
#worldMap .ico.frag { width: 16px; height: 16px; background-size: 256px 144px; background-position: -128px -96px; }
#worldMap .wm-test {
  display: flex; align-items: center; gap: 5px; padding: 3px 9px; font-size: 12px; color: #c9b88a; cursor: pointer;
  background: #2a1e10; border: 1px solid #6b5a3a; border-radius: 4px;
}
#worldMap .wm-test b { color: #8a7a5a; }
#worldMap .wm-test.on { background: #3a2a08; border-color: #c9a227; }
#worldMap .wm-test.on b { color: #ffe08a; }
#worldMap .wm-cloud {
  position: absolute; aspect-ratio: 8 / 5; pointer-events: none; background: center / 100% 100% no-repeat;
  opacity: .92; animation: wmDrift 20s ease-in-out infinite alternate;
}
#worldMap .wm-cloud.mist { aspect-ratio: 32 / 11; opacity: .85; }
@keyframes wmDrift {
  from { transform: translate(calc(-50% - var(--dx)), calc(-50% - var(--dy))); }
  to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))); }
}
#worldMap .wm-msg {
  position: fixed; z-index: 2; left: 50%; bottom: 14px; transform: translateX(-50%); min-height: 18px;
  font-size: 14px; color: #ffd0a0; text-shadow: 0 1px 3px #000, 0 0 6px #000;
}
@keyframes wmPulse { 50% { box-shadow: 0 0 10px 3px #ffe08acc, 0 2px 4px #0008; } }
#exitBtn {
  font-size: 12px; font-weight: 700; padding: 4px 10px; cursor: pointer;
  background: #2a1f0e; color: #ffe08a; border: 1px solid #c9a227; border-radius: 6px;
}
#exitBtn:hover { background: #c9a227; color: #120e0a; }
#exitBtn.give { border-color: #b03a2e; color: #ffb0a0; }
#exitBtn.arm { background: #b03a2e; color: #fff; }
#stageSel {
  width: 100%; max-width: 300px;
  font-size: 13px; font-weight: 700;
  padding: 6px 8px;
}
#stageName {
  color: #ffe08a; text-shadow: 0 2px 8px #000; font-size: 12px;
}
#nextStage, #townPanel button {
  font-size: 12px; font-weight: 700; padding: 5px 10px; cursor: pointer;
  background: #2a1f0e; color: #ffe08a; border: 1px solid #c9a227; border-radius: 6px;
}
#townPanel button:disabled { opacity: .45; cursor: default; }
#townLayer { position: absolute; inset: 0; z-index: 5; pointer-events: none; --bh: 180px; }
#townLayer[hidden] { display: none; }
#townLayer .bld {
  position: absolute; top: 62%; transform: translate(-50%, -100%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: auto; cursor: pointer;
}
#townLayer .bld img { height: var(--bh); image-rendering: pixelated; display: block; filter: drop-shadow(0 6px 6px #0008); transition: filter .15s; }
#townLayer .bld.b-well img { height: calc(var(--bh) * 1.14); }
#townLayer .bname {
  padding: 3px 10px; font-size: 13px; font-weight: 700; white-space: nowrap; color: #ffe08a;
  background: #0a0806d9; border: 1px solid #c9a227; border-radius: 6px; text-shadow: 0 1px 2px #000;
  transition: background .15s, color .15s;
}
#townLayer .bld:hover img, #townLayer .bld.on img { filter: drop-shadow(0 0 10px #ffe08acc) brightness(1.15); }
#townLayer .bld:hover .bname, #townLayer .bld.on .bname { background: #c9a227; color: #120e0a; }
#townLayer .tgo {
  position: absolute; top: 80%; transform: translate(-50%, -50%); pointer-events: auto;
  font-size: 13px; font-weight: 700; padding: 7px 14px; margin: 0; cursor: pointer; white-space: nowrap;
  background: #2a1f0ee6; color: #ffe08a; border: 1px solid #c9a227; border-radius: 6px;
}
#townLayer .tgo:hover { background: #c9a227; color: #120e0a; }
#townLayer .tgo.void { border-color: #a070e0; color: #d8c0ff; box-shadow: 0 0 16px #8a50e0aa; }
#townLayer .tgo.void:hover { background: #6a40b0; color: #fff; }
#townPanel .close {
  position: absolute; right: 10px; top: 8px; padding: 2px 8px; font-size: 13px;
}
#resultBox {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 33;
  min-width: 300px; padding: 18px 26px; text-align: center;
  background: #0a0806ee; border: 2px solid #c9a227; border-radius: 12px;
  box-shadow: 0 10px 40px #000c; animation: resultIn .35s ease-out;
}
#resultBox[hidden] { display: none; }
#resultBox h2 { margin: 0 0 6px; font-size: 30px; letter-spacing: .08em; color: #ffe08a; text-shadow: 0 0 14px #c9a22788; }
#resultBox.lose { border-color: #b03a2e; }
#resultBox.lose h2 { color: #ff8a7a; text-shadow: 0 0 14px #b03a2e88; }
#resultBox p { margin: 0 0 12px; font-size: 13px; color: #c9b88a; }
#resultBox .gos { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
#resultBox button {
  font-size: 13px; font-weight: 700; padding: 6px 14px; margin: 0; cursor: pointer;
  background: #2a1f0e; color: #ffe08a; border: 1px solid #c9a227; border-radius: 6px;
}
@keyframes resultIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.85); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
#board.over { filter: grayscale(.6) brightness(.7); }
#townPanel {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 32;
  width: min(520px, 80%); padding: 16px 20px;
  background: #0a0806e6; border: 1px solid #c9a227; border-radius: 10px;
}
#townPanel .act { margin: 0; font-size: 11px; color: #c9a227; letter-spacing: .04em; }
#townPanel h2 { margin: 4px 0 8px; font-size: 20px; color: #ffe08a; }
#townPanel .story { margin: 0 0 12px; font-size: 13px; line-height: 1.55; color: #f4ead2; }
#townPanel .shops, #townPanel .gos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
#townPanel .go.void { border-color: #a070e0; color: #d8c0ff; }
.bagRow { display: flex; justify-content: space-between; font-size: 12px; padding: 2px 0; }
.bagRow b { color: #ffe08a; }
.bar.xp { height: 4px; margin: 2px 0 6px; }
.bar.xp i { background: #c9a227; }
.pots { display: flex; gap: 6px; margin: 2px 0; }
.pots .pot {
  position: relative; width: 48px; height: 48px; padding: 0; margin: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: #2a1f0e; border: 1px solid #8a6a22; border-radius: 6px;
}
.pots .pot b {
  position: absolute; right: 3px; bottom: 1px; font-size: 11px; color: #ffe08a; text-shadow: 0 1px 2px #000;
}
.ico.p-heal, .ico.p-revive, .ico.p-dheal, .ico.p-drevive, .ico.frag {
  display: inline-block; width: 32px; height: 32px; image-rendering: pixelated;
  background-image: url("../assets/icons/items.png"); background-size: 512px 288px;
}
.ico.p-heal { background-position: -64px -192px; }
.ico.p-revive { background-position: -160px -192px; }
.ico.p-dheal { background-position: -128px -192px; }
.ico.p-drevive { background-position: -288px -96px; }
.ico.frag { background-position: -256px -192px; }
.ico.p-tp {
  display: inline-block; width: 32px; height: 32px; image-rendering: pixelated;
  background-image: url("../assets/icons/items.png"); background-size: 512px 288px; background-position: -448px -64px;
}
#townLayer .tgo.back { border-color: #4a8ae0; color: #c0dcff; box-shadow: 0 0 16px #3a7ae0aa; }
#townLayer .tgo.back:hover { background: #2a5ab0; color: #fff; }
#voidPortal {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); z-index: 13;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0; margin: 0; background: none; border: none; cursor: pointer;
}
#voidPortal[hidden] { display: none; }
#voidPortal .vp-swirl {
  position: relative; display: block; width: 96px; height: 140px; border-radius: 50%; overflow: hidden;
  background: radial-gradient(ellipse at center, #1a0000 0 18%, #6a0a0a 40%, #d02020 68%, #ff6a3a 82%, transparent 84%);
  box-shadow: 0 0 24px #ff2a1a, 0 0 60px #b0101088, inset 0 0 20px #000;
  animation: vpPulse 1.6s ease-in-out infinite;
}
#voidPortal .vp-swirl::before {
  content: ""; position: absolute; inset: -30%;
  background: conic-gradient(from 0deg, transparent 0 20%, #ff8a5a66 25%, transparent 35% 55%, #ff4a2a55 60%, transparent 70% 100%);
  animation: vpSpin 1.4s linear infinite;
}
#voidPortal .vp-name {
  padding: 3px 12px; font-size: 13px; font-weight: 700; white-space: nowrap; color: #ffd0c0;
  background: #1a0606e6; border: 1px solid #d02020; border-radius: 6px; text-shadow: 0 1px 2px #000;
}
#voidPortal:hover .vp-swirl { filter: brightness(1.3); }
#voidPortal:hover .vp-name { background: #a01818; color: #fff; }
@keyframes vpSpin { to { transform: rotate(360deg); } }
@keyframes vpPulse { 50% { transform: scale(1.06); box-shadow: 0 0 34px #ff3a2a, 0 0 80px #c0202099, inset 0 0 20px #000; } }
#wallet { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 4px; font-size: 12px; }
#wallet .cur { display: flex; align-items: center; gap: 3px; }
#wallet b { color: #ffe08a; }
#wallet .ico.frag { width: 16px; height: 16px; background-size: 256px 144px; background-position: -128px -96px; }
#wallet .coin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3a0, #d4a020 60%, #8a6010); }
#wallet .xpm { display: inline-block; width: 36px; height: 4px; background: #2a2218; border-radius: 2px; overflow: hidden; margin-left: 2px; }
#wallet .xpm > i { display: block; height: 100%; background: #c9a227; }
.pots .pot:disabled { opacity: .4; cursor: default; }
#townPanel {
  max-height: 86%; overflow-y: auto; width: min(440px, 80%); padding: 0; border-radius: 0;
  background-color: #141210;
  background-image:
    repeating-linear-gradient(45deg, #ffffff04 0 2px, transparent 2px 7px),
    repeating-linear-gradient(-45deg, #00000033 0 1px, transparent 1px 9px),
    linear-gradient(#1d1a16, #0c0a08);
  border: 2px solid #6b5a3a;
  box-shadow: inset 0 0 0 1px #000, inset 0 0 0 4px #2a2318, inset 0 0 24px #000, 0 12px 32px #000d;
  font-family: "Palatino Linotype", "Book Antiqua", "바탕", Batang, serif; color: #c7b377;
}
#townPanel .tbody { padding: 10px 14px 4px; }
#townPanel .tmsg { margin: 0; padding: 2px 10px 10px; min-height: 16px; font-size: 12px; color: #8fd08f; text-align: center; }
#townPanel .sh-top { display: flex; align-items: center; gap: 10px; padding: 8px 10px 6px 14px; border-bottom: 1px solid #3a3022; }
#townPanel .sh-name { font-size: 18px; color: #e8d8a0; letter-spacing: .06em; text-shadow: 0 0 6px #000; }
#townPanel .sh-gold { margin-left: auto; display: flex; align-items: center; gap: 4px; font-size: 14px; color: #fff; }
#townPanel .sh-x {
  width: 28px; height: 28px; padding: 0; margin: 0; font-size: 14px; border-radius: 0;
  background: #1a0806; color: #d0a070; border: 1px solid #6b3a22; font-family: inherit;
}
#townPanel .sh-x:hover { background: #4a140c; color: #fff; }
#townPanel .coin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3a0, #d4a020 60%, #8a6010); }
#townPanel .cw-ico {
  display: block; width: 32px; height: 32px; image-rendering: pixelated;
  background-image: url("../assets/icons/items.png"); background-size: 512px 288px;
}
#townPanel .sh-sec {
  margin: 10px 0 6px; padding-bottom: 2px; font-size: 14px; color: #e8d8a0; border-bottom: 1px solid #3a3022;
}
#townPanel .sh-sec:first-child { margin-top: 0; }
#townPanel .sh-row { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 6px 0; }
#townPanel .sh-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
#townPanel .sh-cell {
  position: relative; width: 52px; height: 52px; padding: 0; margin: 0; border-radius: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: #0a0908; border: 1px solid #4a3e28; box-shadow: inset 0 0 8px #000;
}
#townPanel .sh-cell.big { width: 64px; height: 64px; }
#townPanel .sh-cell.big .cw-ico, #townPanel .sh-cell.big .ico { transform: scale(1.4); }
#townPanel .sh-cell:hover { border-color: #fff; }
#townPanel .sh-cell:disabled, #townPanel .sh-cell.empty { cursor: default; }
#townPanel .sh-cell.empty .cw-ico { filter: grayscale(1) brightness(.25); }
#townPanel .sh-cell.done { opacity: .45; }
#townPanel .sh-cell.unk .cw-ico { filter: brightness(0) drop-shadow(0 0 3px #c7b377); }
#townPanel .sh-cell.well img { height: 56px; image-rendering: pixelated; }
#townPanel .sh-q {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; font-style: normal; color: #e8d8a0; text-shadow: 0 0 4px #000, 0 0 4px #000;
}
#townPanel .sh-cell.g1, #townPanel .cw-bag.g1 { background-color: #0a0a28; }
#townPanel .sh-cell.g2, #townPanel .cw-bag.g2 { background-color: #22220a; }
#townPanel .sh-cell.g3, #townPanel .cw-bag.g3 { background-color: #0a220a; }
#townPanel .sh-cell.g4, #townPanel .cw-bag.g4 { background-color: #2a1e08; }
#townPanel .cw-badge {
  position: absolute; right: 2px; bottom: 0; font-size: 11px; font-style: normal; color: #fff;
  text-shadow: 0 0 2px #000, 0 0 2px #000;
}
#townPanel .sh-price { display: flex; align-items: center; gap: 3px; font-size: 13px; color: #fff; }
#townPanel .sh-arrow { font-style: normal; font-size: 18px; color: #6b5a3a; }
#townPanel .cw-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; }
#townPanel .cw-bag {
  position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  background: #0a0908; border: 1px solid #2a2318;
}
#townPanel .cw-bag[data-pick] { cursor: pointer; }
#townPanel .cw-bag[data-pick]:hover { border-color: #fff; }
#townPanel .cw-bag.pick { border-color: #6fbf6f; box-shadow: inset 0 0 10px #6fbf6f66; }
#townPanel .cw-bag .cw-ico { max-width: 100%; }
#townPanel .sh-eq {
  position: absolute; left: 1px; top: 0; font-size: 9px; font-weight: 700; font-style: normal; color: #c7b377;
  text-shadow: 0 0 2px #000, 0 0 2px #000;
}
#townPanel .sh-bar { display: flex; justify-content: center; min-height: 34px; padding-top: 6px; }
#townPanel .sh-sell {
  display: flex; align-items: center; gap: 6px; margin: 0; padding: 4px 14px; border-radius: 0; font-family: inherit;
  background: #1a1510; color: #e8d8a0; border: 1px solid #6b5a3a;
}
#townPanel .sh-sell:hover { border-color: #fff; color: #fff; }
.unit .uhead { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.unit .uhead h3 { margin: 0; }
.unit .face {
  width: 34px; height: 34px; flex: none; cursor: pointer; image-rendering: pixelated;
  background: #0a0908; border: 1px solid #6b5a3a; box-shadow: inset 0 0 6px #000;
}
.unit .face:hover { border-color: #ffe08a; box-shadow: 0 0 8px #c9a22799; }

#charWin {
  position: absolute; left: 8px; top: 8px; bottom: 8px; width: min(400px, 52%); z-index: 34;
  display: flex; flex-direction: column;
  background-color: #141210;
  background-image:
    repeating-linear-gradient(45deg, #ffffff04 0 2px, transparent 2px 7px),
    repeating-linear-gradient(-45deg, #00000033 0 1px, transparent 1px 9px),
    linear-gradient(#1d1a16, #0c0a08);
  border: 2px solid #6b5a3a;
  box-shadow: inset 0 0 0 1px #000, inset 0 0 0 4px #2a2318, inset 0 0 24px #000, 0 12px 32px #000d;
  font-family: "Palatino Linotype", "Book Antiqua", "바탕", Batang, serif; color: #c7b377;
}
#charWin[hidden] { display: none; }
#charWin.onmap { position: fixed; left: 12px; top: 62px; bottom: 76px; width: min(400px, calc(100vw - 24px)); z-index: 55; }
#cwKeys { position: fixed; right: 14px; bottom: 14px; z-index: 56; display: flex; gap: 6px; }
#cwKeys .cw-key {
  position: relative; width: 48px; height: 48px; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: #141210e6; border: 2px solid #6b5a3a; border-radius: 6px;
  box-shadow: inset 0 0 0 1px #000, 0 4px 12px #000c; touch-action: manipulation;
}
#cwKeys .cw-key:hover, #cwKeys .cw-key.on { border-color: #e8c860; background: #2a2116f0; box-shadow: inset 0 0 0 1px #000, 0 0 10px #c9a22788; }
#cwKeys .cw-key em {
  position: absolute; right: 2px; bottom: 0; font-style: normal; font-weight: 700; font-size: 13px; line-height: 1;
  color: #ffe08a; text-shadow: 0 0 2px #000, 0 0 2px #000, 0 0 3px #000;
}
#charWin .cw-ico, #cwKeys .cw-ico {
  display: block; width: 32px; height: 32px; image-rendering: pixelated;
  background-image: url("../assets/icons/items.png"); background-size: 512px 288px;
}
#charWin .cw-top { display: flex; align-items: center; gap: 5px; padding: 8px 10px 6px; border-bottom: 1px solid #3a3022; }
#charWin .cw-face {
  width: 40px; height: 40px; cursor: pointer; image-rendering: pixelated;
  background: #050403; border: 1px solid #4a3e28; filter: grayscale(.5) brightness(.8);
}
#charWin .cw-face.on, #charWin .cw-face:hover { border-color: #c7b377; filter: none; box-shadow: 0 0 8px #c7b37766; }
#charWin .cw-x {
  margin-left: auto; width: 28px; height: 28px; padding: 0; cursor: pointer; font-size: 14px;
  background: #1a0806; color: #d0a070; border: 1px solid #6b3a22;
}
#charWin .cw-x:hover { background: #4a140c; color: #fff; }
#charWin .cw-tabs { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid #3a3022; }
#charWin .cw-tab {
  width: 44px; height: 40px; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: #0d0b09; border: 1px solid #3a3022; filter: brightness(.6);
}
#charWin .cw-tab.on, #charWin .cw-tab:hover { border-color: #c7b377; filter: none; background: #241d14; }
#charWin .cw-name { margin-left: auto; font-size: 18px; color: #e8d8a0; letter-spacing: .06em; text-shadow: 0 0 6px #000; }
#charWin .cw-body { flex: 1; overflow-y: auto; padding: 10px; }
#charWin .cw-msg { min-height: 18px; padding: 4px 10px 8px; font-size: 12px; color: #8fd08f; text-align: center; }

#charWin .cw-lv { display: flex; align-items: center; gap: 10px; font-size: 15px; margin-bottom: 8px; }
#charWin .cw-lv b { color: #fff; }
#charWin .cw-xp { flex: 1; height: 6px; background: #050403; border: 1px solid #3a3022; display: block; }
#charWin .cw-xp > i { display: block; height: 100%; background: linear-gradient(#e8c860, #9a7a20); }
#charWin .cw-pts { display: flex; gap: 14px; margin-bottom: 10px; }
#charWin .cw-pts span { display: flex; align-items: center; gap: 4px; font-size: 15px; }
#charWin .cw-pts b { color: #fff; }
#charWin .cw-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#charWin .cw-stat {
  display: flex; align-items: center; gap: 8px; padding: 3px 8px;
  background: #0a0908; border: 1px solid #3a3022; box-shadow: inset 0 0 8px #000;
}
#charWin .cw-stat b { font-size: 15px; color: #fff; }

#charWin .cw-sec {
  display: flex; justify-content: space-between; margin: 10px 0 6px; padding-bottom: 2px;
  font-size: 14px; color: #e8d8a0; border-bottom: 1px solid #3a3022;
}
#charWin .cw-sec:first-child { margin-top: 0; }
#charWin .cw-sec span { color: #fff; }
#charWin .cw-row { display: flex; gap: 8px; }
#charWin .cw-row.wrap { flex-wrap: wrap; gap: 6px; }
#charWin .cw-cell {
  position: relative; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: #0a0908; border: 1px solid #4a3e28; box-shadow: inset 0 0 8px #000;
}
#charWin .cw-cell.big { width: 52px; height: 52px; }
#charWin .cw-cell.lock .cw-ico { filter: grayscale(1) brightness(.45); }
#charWin .cw-cell.got { border-color: #c7b377; box-shadow: inset 0 0 10px #c7b37744; }
#charWin .cw-cell.got .cw-ico { filter: none; }
#charWin .cw-cell.can { border-color: #6fbf6f; }
#charWin .cw-cell:hover { border-color: #fff; }
#charWin .cw-badge {
  position: absolute; right: 1px; bottom: 0; font-size: 10px; font-style: normal; color: #fff;
  text-shadow: 0 0 2px #000, 0 0 2px #000;
}
#charWin .cw-plus {
  position: absolute; right: 1px; top: -2px; font-size: 13px; font-weight: 700; font-style: normal; color: #6fef6f;
  text-shadow: 0 0 3px #000;
}
#charWin .cw-lines { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
#charWin .cw-line { display: flex; flex-direction: column; align-items: center; }
#charWin .cw-lname { font-size: 13px; color: #e8d8a0; margin-bottom: 4px; }
#charWin .cw-link { display: block; width: 2px; height: 10px; background: #4a3e28; }

#charWin .cw-doll { display: flex; justify-content: center; gap: 18px; margin: 4px 0 12px; }
#charWin .cw-slot {
  width: 64px; height: 88px; display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: #050403; border: 1px solid #4a3e28; box-shadow: inset 0 0 12px #000;
}
#charWin .cw-slot .cw-ico { transform: scale(1.6); }
#charWin .cw-slot.empty { cursor: default; }
#charWin .cw-slot.empty .cw-ico { filter: grayscale(1) brightness(.25); }
#charWin .cw-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; }
#charWin .cw-bag {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  background: #0a0908; border: 1px solid #2a2318;
}
#charWin .cw-bag[data-act] { cursor: pointer; }
#charWin .cw-bag[data-act]:hover { border-color: #fff; }
#charWin .cw-bag .cw-ico { width: 32px; height: 32px; max-width: 100%; }
#charWin .cw-slot.g1, #charWin .cw-bag.g1 { background-color: #0a0a28; }
#charWin .cw-slot.g2, #charWin .cw-bag.g2 { background-color: #22220a; }
#charWin .cw-slot.g3, #charWin .cw-bag.g3 { background-color: #0a220a; }
#charWin .cw-slot.g4, #charWin .cw-bag.g4 { background-color: #2a1e08; }
#charWin .cw-gold { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 8px; font-size: 14px; }
#charWin .cw-gold b { color: #fff; }
#charWin .coin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3a0, #d4a020 60%, #8a6010); }

#cwTip {
  position: fixed; z-index: 60; max-width: 260px; pointer-events: none; text-align: center;
  padding: 6px 10px; background: #000000e6; border: 1px solid #2c2c2c;
  font-family: "Palatino Linotype", "Book Antiqua", "바탕", Batang, serif; font-size: 12px; line-height: 1.45; color: #fff;
}
#cwTip[hidden] { display: none; }
#cwTip b { display: block; font-size: 13px; }
#cwTip .dim { color: #a8a8a8; }
#cwTip .mag { color: #7878ff; }
#cwTip .hint { color: #c7b377; margin-top: 2px; }
#cwTip .g0 { color: #ffffff; }
#cwTip .g1 { color: #7878ff; }
#cwTip .g2 { color: #ffff64; }
#cwTip .g3 { color: #00d000; }
#cwTip .g4 { color: #c7a85a; }
.gem.rock { background-image: none !important; background-color: #5a5650 !important; box-shadow: inset 0 0 0 3px #3a3732; }
.gem.rock::after { content: ""; position: absolute; inset: 14px; border-radius: 40% 55% 45% 50%; background: #8a857c; }
.gem.vine { outline: 3px solid #3f8a2a; outline-offset: -3px; }
.gem.vine::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, transparent 0 10px, #3f8a2a88 10px 13px);
}
.gem.bomb { outline: 3px solid #e04a2a; outline-offset: -3px; }
.gem.bomb .tm {
  position: absolute; right: 3px; bottom: 2px; min-width: 18px; padding: 0 3px;
  font: 700 13px/18px sans-serif; text-align: center; color: #fff; background: #b02a14; border-radius: 9px;
}
.actor { position: absolute; width: 80px; height: 96px; transition: left .28s linear, top .28s linear; pointer-events: auto; cursor: pointer; overflow: visible; }
.actor.tgt-foe .spr { outline: 2px solid #ff7040; outline-offset: 1px; box-shadow: 0 0 10px #ff704088; }
.actor.tgt-ally .spr { outline: 2px solid #6ea8ff; outline-offset: 1px; box-shadow: 0 0 10px #6ea8ff88; }
.spr { width: 64px; height: 64px; display: block; image-rendering: pixelated; position: relative; z-index: 1;
  background: none !important; }
.alab { text-align: center; font-size: 10px; margin-top: -4px; text-shadow: 0 1px 3px #000; }
.ahp {
  position: absolute; left: 50%; top: -12px; transform: translateX(-50%);
  z-index: 6; height: 7px; width: 52px;
  background: #1a120c; border: 1px solid #000; border-radius: 3px; overflow: hidden;
  box-sizing: border-box;
}
.ahp > i { display: block; height: 100%; background: #c0392b; }
.actor.ally .ahp > i { background: #3d8fff; }
.actor.foe .ahp > i { background: #e22b22; }
.actor.acting .spr { outline: 2px solid #ffe08a; outline-offset: -2px; }
.actor.dead { opacity: .35; }
.actor.stunned .spr { outline: 2px solid #9b59b6; }
.actor.ally .alab { color: #8ec8ff; }
.actor.foe .alab { color: #ff9a90; }
.actor.rank-elite { width: 144px; height: 168px; }
.actor.rank-elite .spr { width: 128px; height: 128px; }
.actor.rank-elite .ahp { width: 96px; height: 8px; top: -14px; }
.actor.rank-elite .shadow { width: 72px; height: 16px; margin-left: -36px; }
.actor.rank-boss { width: 208px; height: 236px; }
.actor.rank-boss .spr { width: 192px; height: 192px; }
.actor.rank-boss .ahp { width: 140px; height: 9px; top: -16px; }
.actor.rank-boss .shadow { width: 110px; height: 22px; margin-left: -55px; }
.actor.rank-elite .alab, .actor.rank-boss .alab { color: #ffd27a; font-size: 11px; }
.shadow {
  position: absolute; left: 50%; bottom: 10px; width: 40px; height: 12px; margin-left: -20px;
  background: radial-gradient(ellipse, #0009 0%, #0000 70%); border-radius: 50%;
}
#hud {
  grid-column: 1; grid-row: 2;
  display: flex; gap: 6px; padding: 8px 10px;
  background: #120e0ae8; border-top: 1px solid #8a6a22; overflow-x: auto;
}
.unit {
  flex: 1; min-width: 150px; background: #1c1612; border: 1px solid #6a5220;
  border-radius: 8px; padding: 6px 8px;
}
.unit.dead { opacity: .45; }
.unit h3 { margin: 0 0 4px; font-size: 12px; color: #ffe08a; }
.bars { margin-bottom: 4px; }
.bar { height: 8px; background: #2a2218; border-radius: 4px; overflow: hidden; margin: 2px 0; }
.bar > i { display: block; height: 100%; }
.bar.hp > i { background: #c0392b; }
.bar.mp > i { background: #2980b9; }
.barlab { font-size: 10px; opacity: .8; }
.skills { display: flex; gap: 4px; }
.sk {
  width: 48px; height: 56px; padding: 2px 0 0; border: 1px solid #c9a227; border-radius: 6px;
  background: #3a3228; cursor: pointer; color: #f4ead2; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.sk:hover { background: #3a2e1c; }
.sk.off { opacity: .35; cursor: default; }
.sk .ico { width: 32px; height: 32px; background-image: url("../assets/icons/items.png");
  background-size: 512px 288px; image-rendering: pixelated; }
.sk em { font-size: 9px; font-style: normal; line-height: 1; }
#skTip {
  position: fixed; z-index: 40; max-width: 240px; pointer-events: none;
  background: #1a140ee8; border: 1px solid #c9a227; border-radius: 8px;
  padding: 8px 10px; color: #f4ead2; font-size: 12px; line-height: 1.35;
  box-shadow: 0 6px 18px #000a;
}
#skTip b { display: block; color: #ffe08a; font-size: 13px; margin-bottom: 4px; }
#skTip .cost { color: #7eb6ff; margin-bottom: 4px; }
#skTip[hidden] { display: none !important; }
#puzzleCol {
  grid-column: 2; grid-row: 1 / span 2;
  background: #0c0a08; border-left: 2px solid #c9a227;
  padding: 8px; overflow: hidden; display: flex; flex-direction: column; align-items: center;
  z-index: 3;
}
#metaBox {
  position: absolute; right: 10px; top: 10px; z-index: 31;
  padding: 6px 8px; background: #0a0806cc; border: 1px solid #8a6a22; border-radius: 8px;
  max-width: min(320px, 30%);
}
#pmeta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
#metaBox #msg { text-align: right; margin: 4px 0 0; }
.stat {
  background: #221c16; border: 1px solid #8a6a22; border-radius: 8px;
  padding: 6px 8px; font-size: 12px;
}
#turnBox.player { border-color: #7dffa0; }
#turnBox.enemy { border-color: #e74c3c; color: #ffb4a8; }
#msg { min-height: 1.2em; color: #ffe08a; font-weight: 700; font-size: 12px; margin: 4px 0; width: 100%; flex: none; }
#boardClip { overflow: hidden; flex: 0 0 auto; }
#boardWrap { transform-origin: top left; width: 560px; height: 560px; }
#board {
  position: relative; box-sizing: border-box; width: 560px; height: 560px; min-width: 560px; min-height: 560px;
  background: #1a140e; border: 2px solid #c9a227; border-radius: 12px;
  user-select: none; touch-action: none; overflow: hidden;
}
.gem {
  position: absolute; width: 60px; height: 60px; border-radius: 12px;
  background-color: #2a241c; background-position: center; background-size: 82%; background-repeat: no-repeat;
  cursor: grab; z-index: 2; touch-action: none;
}
.gem.sel { box-shadow: 0 0 0 3px #ffe08a; z-index: 3; }
.gem.pop { animation: pop .22s ease-in forwards; pointer-events: none; }
@keyframes pop {
  0% { transform: scale(1); opacity: 1; }
  40% { transform: scale(1.25); }
  100% { transform: scale(0.15); opacity: 0; }
}
#pbtns { display: flex; gap: 4px; flex: none; }
#pbtns button { font-size: 11px; padding: 4px 8px; margin: 0; }
button, select {
  background: #3a2e1c; color: #f3e2b0; border: 1px solid #8a7030;
  padding: 6px 10px; border-radius: 8px; cursor: pointer; font-weight: 700; margin: 2px;
}
.sideBox {
  width: 100%;
  margin-top: 8px;
  background: #050505;
  border: 3px solid #c45a12;
  border-radius: 4px;
  text-align: left;
  flex: none;
}
.sideBox h4 {
  margin: 0;
  padding: 6px 10px 4px;
  color: #f4ead2;
  font-size: 14px;
  font-weight: 800;
}
#combatBox { flex: 1 1 120px; min-height: 100px; display: flex; flex-direction: column; }
#combatLog {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 10px 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #ddd;
}
#combatLog p { margin: 0 0 4px; }
#itemBox { min-height: 72px; }
#itemSlots { min-height: 40px; padding: 4px 10px 8px; }
.nm-ally { color: #4aa3ff; font-weight: 800; }
.nm-foe { color: #e22b22; font-weight: 800; }
.nm-sk { color: #fff; font-weight: 800; }
.nm-status { color: #c44cff; font-weight: 800; }
.astat {
  text-align: center; font-size: 10px; font-weight: 800; color: #c44cff;
  text-shadow: 0 1px 3px #000; min-height: 12px; line-height: 1.2;
}
body.mobile #app { grid-template-columns: 1fr; grid-template-rows: 200px auto 1fr; }
body.mobile #field, body.mobile #hud, body.mobile #puzzleCol { grid-column: 1; }
body.mobile #field { grid-row: 1; }
body.mobile #hud { grid-row: 2; }
body.mobile #puzzleCol { grid-row: 3; border-left: 0; border-top: 2px solid #c9a227; }
body.mobile .unit { min-width: 120px; }

.gem-i {
  display: inline-block; width: 10px; height: 10px; margin: 0 3px; transform: rotate(45deg); flex: none;
  background: linear-gradient(135deg, #e8fbff, #5ad8ff 45%, #1a7ad0); border: 1px solid #0a3a6a; box-shadow: 0 0 4px #5ad8ff99;
}
#worldMap .wm-top { flex-wrap: wrap; row-gap: 6px; }
#worldMap .wm-accs { display: flex; align-items: center; gap: 6px; }
#worldMap .wm-acc {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; font: inherit; font-size: 12px; color: #e8d8a0; cursor: pointer;
  background: #2a1e10; border: 1px solid #6b5a3a; border-radius: 4px;
}
#worldMap .wm-acc:hover { border-color: #c9a227; color: #ffe08a; }
#worldMap .wm-acc b { color: #fff; margin-right: 4px; }
#worldMap .wm-acc.shop { background: #10283a; border-color: #2a6a9a; }
#worldMap .wm-acc.login { background: #3a2a08; border-color: #c9a227; color: #ffe08a; }
#worldMap .wm-acc em { min-width: 16px; padding: 0 4px; font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: #c0302a; border-radius: 8px; text-align: center; }
#worldMap .wm-acc img, #worldMap .wm-acc .am-ava { width: 20px; height: 20px; border-radius: 50%; }
#worldMap .wm-acc .nm { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: #888; flex: none; }
.sync-dot.s-ok { background: #4ad06a; }
.sync-dot.s-wait { background: #f0c040; }
.sync-dot.s-error, .sync-dot.s-conflict { background: #ff5a4a; }
.am-ava { display: inline-block; background: radial-gradient(circle at 50% 38%, #c9b88a 28%, transparent 30%), radial-gradient(circle at 50% 100%, #c9b88a 45%, #3a2e1a 47%); }

#accModal {
  position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center; padding: 12px;
  background: #000a; font-family: "Malgun Gothic", sans-serif;
}
#accModal[hidden] { display: none; }
#accModal .am-box {
  width: min(460px, 100%); max-height: calc(100vh - 24px); display: flex; flex-direction: column; color: #e8dcc0;
  background: #17110a; border: 2px solid #8a6a22; border-radius: 8px; box-shadow: 0 10px 40px #000c;
}
#accModal.k-shop .am-box { width: min(760px, 100%); height: min(640px, calc(100vh - 24px)); }
#accModal.k-conflict .am-box { width: min(620px, 100%); }
#accModal .am-top { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid #4a3a1a; }
#accModal .am-title { flex: 1; font-size: 16px; font-weight: 700; color: #ffe08a; letter-spacing: .05em; }
#accModal .am-x { width: 28px; height: 28px; font-size: 14px; color: #c9b88a; background: none; border: 1px solid #4a3a1a; border-radius: 4px; cursor: pointer; }
#accModal .am-body { padding: 12px 16px 16px; overflow: auto; font-size: 13px; line-height: 1.6; display: flex; flex-direction: column; min-height: 0; flex: 1; }
#accModal .am-body p { margin: 0 0 8px; }
#accModal .am-dim { color: #9a8c6a; }
#accModal .small { font-size: 11px; }
#accModal a { color: #e0b060; }
#accModal .am-warn { color: #ff9a7a; }
#accModal .am-msg { min-height: 18px; margin: 4px 0; color: #c9b88a; }
#accModal .am-msg.good { color: #8fe08f; }
#accModal .am-msg.bad { color: #ff8a7a; }
#accModal .am-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
#accModal .am-in { flex: 1; min-width: 120px; height: 32px; padding: 0 10px; font: inherit; color: #fff; background: #0a0806; border: 1px solid #6b5a3a; border-radius: 4px; }
#accModal .am-btn {
  height: 32px; padding: 0 14px; font: inherit; font-size: 13px; color: #e8dcc0; cursor: pointer;
  background: #2a1e10; border: 1px solid #6b5a3a; border-radius: 4px;
}
#accModal .am-btn:hover:not(:disabled) { border-color: #c9a227; }
#accModal .am-btn.gold { background: #6a4a10; border-color: #c9a227; color: #fff2c0; }
#accModal .am-btn:disabled { opacity: .5; cursor: default; }
#accModal .am-logins { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
#accModal .am-login {
  display: block; padding: 10px; text-align: center; font-weight: 700; font-size: 14px; color: #fff; text-decoration: none; border-radius: 6px;
}
#accModal .am-login.discord { background: #5865f2; }
#accModal .am-login.google { background: #fff; color: #333; }
#accModal .am-login.off { background: #333; color: #888; font-weight: 400; }
#accModal .am-me { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
#accModal .am-me img, #accModal .am-me .am-ava { width: 48px; height: 48px; border-radius: 50%; border: 2px solid #8a6a22; }
#accModal .am-me b { font-size: 16px; color: #fff; }
#accModal .am-sync { padding: 6px 10px; background: #0f0b06; border: 1px solid #3a2e1a; border-radius: 4px; }
#accModal .am-sync.s-ok { color: #8fe08f; }
#accModal .am-sync.s-error, #accModal .am-sync.s-conflict { color: #ff9a7a; }
#accModal .am-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
#accModal .am-card { display: flex; flex-direction: column; gap: 4px; padding: 10px; background: #0f0b06; border: 1px solid #4a3a1a; border-radius: 6px; }
#accModal .am-card h4 { margin: 0; color: #ffe08a; font-size: 14px; }
#accModal .am-card .am-btn { margin-top: auto; }
#accModal .am-sum { margin: 4px 0 8px; }
#accModal .am-sum b { color: #fff; }

#accModal .cs-head { display: flex; align-items: center; gap: 10px; }
#accModal .cs-tabs { display: flex; gap: 4px; flex: 1; }
#accModal .cs-tab { height: 30px; padding: 0 14px; font: inherit; font-size: 13px; color: #c9b88a; cursor: pointer; background: #1f170c; border: 1px solid #4a3a1a; border-radius: 4px; }
#accModal .cs-tab.on { color: #1a1206; background: #ffe08a; border-color: #ffe08a; font-weight: 700; }
#accModal .cs-gems { display: flex; align-items: center; gap: 2px; padding: 4px 10px; font-size: 15px; background: #0a1a28; border: 1px solid #2a6a9a; border-radius: 14px; }
#accModal .cs-gems b { color: #fff; }
#accModal .cs-body { flex: 1; min-height: 0; overflow: auto; }
#accModal .cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-bottom: 10px; }
#accModal .cs-mail { display: flex; flex-direction: column; gap: 6px; }
#accModal .cs-card { display: flex; gap: 10px; align-items: center; padding: 8px; background: #0f0b06; border: 1px solid #4a3a1a; border-radius: 6px; }
#accModal .cs-card.out { opacity: .55; }
#accModal .cs-item { flex-direction: column; align-items: stretch; gap: 6px; }
#accModal .cs-name { display: flex; align-items: center; gap: 8px; }
#accModal .cs-name b { font-size: 14px; color: #fff; line-height: 1.3; }
#accModal .cs-item .cs-info { flex: 1; }
#accModal .cs-item .cs-buy { width: 100%; }
#accModal .cs-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 12px; }
#accModal .cs-info b { font-size: 13px; color: #fff; }
#accModal .cs-rw { color: #8fd0ff; }
#accModal .cs-lim { color: #f0c040; }
#accModal .cs-ic {
  position: relative; flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: #1f170c; border: 1px solid #6b5a3a; border-radius: 6px;
}
#accModal .cs-ic.g2 { border-color: #f6d870; box-shadow: inset 0 0 8px #f6d87066; }
#accModal .cs-ic.g3 { border-color: #c08aff; box-shadow: inset 0 0 8px #c08aff66; }
#accModal .cs-ic.g4 { border-color: #ff9a3a; box-shadow: inset 0 0 10px #ff9a3a88; }
#accModal .cs-ic .cw-ico {
  display: block; width: 32px; height: 32px; image-rendering: pixelated;
  background-image: url("../assets/icons/items.png"); background-size: 512px 288px;
}
#accModal .cs-q { position: absolute; right: 3px; bottom: 0; font-style: normal; font-weight: 700; color: #fff; text-shadow: 0 0 3px #000; }
#accModal .cs-buy {
  flex: none; min-width: 72px; height: 32px; padding: 0 8px; font: inherit; font-size: 13px; color: #fff; cursor: pointer;
  background: #10283a; border: 1px solid #2a6a9a; border-radius: 4px;
}
#accModal .cs-buy:hover:not(:disabled) { border-color: #5ad8ff; }
#accModal .cs-buy:disabled { opacity: .5; cursor: default; }
#accModal .cs-price { display: inline-flex; align-items: center; }
@media (max-width: 560px) { #accModal .am-pick { grid-template-columns: 1fr; } }

#splash {
  position: fixed; inset: 0; z-index: 300; background: #02060f; cursor: pointer;
  user-select: none; -webkit-tap-highlight-color: transparent; transition: opacity .35s;
}
#splash.out { opacity: 0; pointer-events: none; }
#splash .splash-stage {
  position: absolute; left: 50%; top: 50%; width: min(100vw, 177.78vh); aspect-ratio: 16 / 9;
  transform: translate(-50%, -50%); background: url("../assets/splash.jpg") center / cover no-repeat;
  container-type: inline-size;
}
#splash .splash-stage::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 3cqw 1cqw #02060f; pointer-events: none; }
#splash canvas { position: absolute; left: 50%; bottom: 12%; z-index: 1; width: 44.4%; transform: translateX(-50%); image-rendering: pixelated; }
#splash .splash-bar {
  position: absolute; left: 40%; bottom: 5.5%; z-index: 1; width: 20%; height: max(3px, .3cqw);
  background: #2a241a; border-radius: 2px; overflow: hidden;
}
#splash .splash-bar i { display: block; height: 100%; background: #f6d870; transform: scaleX(0); transform-origin: left; transition: transform .2s; }
#splash .splash-hint {
  position: absolute; left: 0; right: 0; bottom: 1.8%; z-index: 1; text-align: center;
  font-family: "Malgun Gothic", sans-serif; font-size: max(12px, 1.15cqw); letter-spacing: 1px; color: #e6d3a1;
}
@media (orientation: portrait) { #splash .splash-hint { bottom: auto; top: calc(100% + 14px); } }
#splash .splash-title {
  position: absolute; left: 18px; top: 12px; z-index: 2; margin: 0; font-family: "Malgun Gothic", sans-serif;
  font-size: clamp(16px, 2.2vw, 28px); font-weight: 700; letter-spacing: 2px; color: #f0d9a0; text-shadow: 0 2px 6px #000;
}
#splash .splash-legal { position: absolute; right: 12px; bottom: 8px; z-index: 2; margin: 0; font-family: "Malgun Gothic", sans-serif; font-size: 12px; color: #8a8270; }
#splash .splash-legal a { color: #b3a790; }
#splash.ready .splash-hint { animation: splashBlink 1.6s ease-in-out infinite; }
@keyframes splashBlink { 50% { opacity: .35; } }
