:root {
  --bg: #100e0c; --panel: #1b1815; --panel2: #24201b; --line: #3a322a; --text: #ebe2d3; --dim: #9c8f7d;
  --gold: #e0ad45; --pri: #c98a2b; --ok: #6fcf6a; --warn: #e8b93a; --bad: #ff6b5e; --info: #6fb6e8;
  --hp: #d8473b; --sp: #3f8fe0; --exp: #b58be0;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--text); font: 14px/1.55 "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 700; }
h2 { font-size: 18px; } h3 { font-size: 15px; margin-top: 4px; }
p { margin: 8px 0; }
ul { margin: 6px 0; padding-left: 20px; }
code { background: var(--panel2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.dim { color: var(--dim); } .sm { font-size: 12px; } .big { font-size: 18px; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); } .info { color: var(--info); } .gold { color: var(--gold); }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.mt { margin-top: 10px; }
.page { max-width: 1100px; margin: 0 auto; padding: 14px 12px 60px; }
.row { display: flex; align-items: center; } .row.between { justify-content: space-between; } .row.gap { gap: 8px; } .row.wrap { flex-wrap: wrap; gap: 8px; }
.grow { flex: 1 1 auto; min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 12px; }
.hint { border-color: #6b5320; background: #231c10; }

button, .btn { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; cursor: pointer; white-space: nowrap; display: inline-block; }
button:hover:not(:disabled), .btn:hover { border-color: var(--gold); text-decoration: none; }
button:disabled { opacity: .45; cursor: default; }
button.pri, .btn.pri { background: var(--pri); border-color: var(--pri); color: #1a1206; font-weight: 700; }
button.danger { color: var(--bad); border-color: #6b2d27; }
button.sm, .btn.sm { padding: 3px 8px; font-size: 12px; }
button.on { border-color: var(--gold); color: var(--gold); }
input, select { font: inherit; color: var(--text); background: #0d0b09; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; min-width: 0; }
input:focus, select:focus { outline: none; border-color: var(--gold); }
label { display: block; margin-bottom: 10px; color: var(--dim); font-size: 12px; }
label input { display: block; width: 100%; margin-top: 3px; font-size: 14px; }
label.chk { display: inline-flex; align-items: center; gap: 3px; margin: 0; color: var(--text); white-space: nowrap; }

.tag { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 10px; border: 1px solid var(--line); color: var(--dim); white-space: nowrap; }
.tag.ok { color: var(--ok); border-color: #2f5a2d; } .tag.bad { color: var(--bad); border-color: #6b2d27; } .tag.warn { color: var(--warn); border-color: #6b5320; } .tag.info { color: var(--info); border-color: #2a4d66; }
.tag.k-phys { color: #f0a070; } .tag.k-magic { color: #a9a0ff; } .tag.k-heal { color: var(--ok); } .tag.k-buff { color: var(--info); } .tag.k-summon { color: #e6a0e0; } .tag.k-passive { color: var(--dim); }
.ico { width: 40px; height: 40px; flex: none; object-fit: contain; background: #14110e; border: 1px solid var(--line); border-radius: 6px; padding: 2px; display: inline-block; }
.affix { color: #9fd0ff; }
.uniq { color: #ff9d4d; font-weight: 700; }

.bar { display: inline-block; width: 100%; height: 6px; background: #0b0908; border-radius: 3px; overflow: hidden; vertical-align: middle; }
.bar i { display: block; height: 100%; background: var(--dim); transition: width .25s; }
.bar.hp i { background: var(--hp); } .bar.sp i { background: var(--sp); } .bar.exp i { background: var(--exp); }
.bar.exp { max-width: 160px; } .bar.wide { height: 12px; }

.logo { font-family: Georgia, "Times New Roman", serif; font-size: 34px; letter-spacing: 1px; color: var(--text); }
.logo span { color: var(--gold); font-style: italic; }
.logo.sm { font-size: 18px; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.auth { max-width: 360px; margin: 9vh auto 0; padding: 0 14px; text-align: center; }
.auth form { text-align: left; margin-top: 18px; }
.auth form button { width: 100%; margin-bottom: 8px; }

header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 8px 14px; background: #15120f; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
header nav { display: flex; gap: 2px; flex: 1 1 auto; flex-wrap: wrap; }
header nav a { color: var(--dim); padding: 4px 9px; border-radius: 6px; position: relative; white-space: nowrap; }
header nav a.on { color: var(--gold); background: var(--panel2); }
header nav a:hover { color: var(--text); text-decoration: none; }
header .res { display: flex; gap: 12px; align-items: center; white-space: nowrap; }
.dot { position: absolute; top: 3px; right: 2px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }

/* 도트 그림: 불러와 크기를 정하기 전에는 숨긴다 */
.spr { image-rendering: pixelated; visibility: hidden; display: block; }
.spr.ok { visibility: visible; }
.spr.flip { transform: scaleX(-1); }
.art { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.art.broken { display: none; }

.tabs { display: flex; gap: 4px; margin-bottom: -1px; align-items: flex-end; flex-wrap: wrap; }
.tabs button { border-radius: 8px 8px 0 0; border-bottom-color: transparent; background: transparent; color: var(--dim); }
.tabs button.on { background: var(--panel); color: var(--gold); border-color: var(--line); border-bottom-color: var(--panel); }
.tabs .back { margin-left: auto; padding: 6px; }
.tabs + .panel { border-top-left-radius: 0; }

.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid #2a241e; }
.li:last-child { border-bottom: 0; }
.li.col { flex-direction: column; align-items: stretch; }
.li.off { opacity: .8; }
.slot { width: 52px; color: var(--dim); flex: none; }
.cands { margin: 4px 0 4px 60px; padding: 6px 10px; background: var(--panel2); border-radius: 6px; }
.cand { padding: 4px 0; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; color: var(--dim); font-weight: 400; font-size: 12px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 6px; border-bottom: 1px solid #2a241e; }
.tbl tr.me td { background: #2a2212; }

/* 배경 그림이 깔리는 패널: 흑백 선화에 층 색을 곱한다 */
.townhead, .floor, .bfield { position: relative; background-color: var(--tint, #333); background-image: linear-gradient(rgba(16, 14, 12, .82), rgba(16, 14, 12, .9)), var(--bg, none); background-size: cover, cover; background-position: center; background-blend-mode: normal, multiply; }
.floor.locked { opacity: .55; }
.floor { background-image: linear-gradient(90deg, rgba(27, 24, 21, .97) 35%, rgba(27, 24, 21, .72)), var(--bg, none); }
.mons { display: flex; gap: 12px; align-items: flex-end; margin-top: 10px; flex-wrap: wrap; }
.mon { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 56px; }
.mon.boss span { color: var(--warn); }
.drops { align-self: flex-end; }

.strip { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.pcard { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 150px; padding: 10px 8px; background: rgba(20, 17, 14, .85); border: 1px solid var(--line); border-radius: 8px; color: var(--text); text-align: center; }
a.pcard:hover { border-color: var(--gold); text-decoration: none; }
/* 일러스트 칸: 캐릭터(도트) 칸과 따로 둔다. 그림이 없어도 자리는 보인다 */
.artslot { background: #14110e; border: 1px dashed var(--line); border-radius: 6px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.noart { color: #5e554a; font-size: 11px; text-align: center; }
.pc-art { width: 100%; aspect-ratio: 1 / 1; }
.pc-spr { height: 92px; display: flex; align-items: flex-end; justify-content: center; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 10px; }
.ccard { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 3px; }
.ccard.in { border-color: #5a7a3a; }
/* 일러스트가 정사각형이라 칸도 정사각형으로 크게, 도트 칸은 그 아래에 둔다 */
.cc-top { display: flex; flex-direction: column; gap: 6px; }
.cc-art { width: 100%; aspect-ratio: 1 / 1; }
.cc-spr { height: 104px; background: #14110e; border-radius: 6px; display: flex; align-items: flex-end; justify-content: center; padding: 6px; overflow: hidden; }
.jobs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.jobs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.jobpick { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; padding: 8px; white-space: normal; }
.jp-art { width: 100%; aspect-ratio: 1 / 1; }
.jp-spr { height: 100px; display: flex; align-items: flex-end; justify-content: center; }
.jobpick.on { border-color: var(--gold); background: #2a2212; }

.charhead { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; }
.ch-box { position: relative; background: #14110e; border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; height: 300px; padding: 24px 8px 8px; }
.ch-sprbox { width: 200px; align-items: flex-end; padding-bottom: 16px; }
.ch-artbox { width: 300px; padding: 0; }
.ch-artbox .boxlabel { z-index: 1; background: rgba(16, 14, 12, .6); padding: 0 5px; border-radius: 4px; }
.boxlabel { position: absolute; left: 8px; top: 5px; font-size: 11px; color: var(--dim); }
.bports { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.bport { position: relative; flex: 1 1 90px; max-width: 150px; aspect-ratio: 1 / 1; transition: opacity .3s, border-color .15s; }
.bport b { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; text-align: center; background: rgba(0, 0, 0, .65); padding: 1px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #9fd0ff; }
.bport.s1 b { color: #ffb0a0; }
.bport.on { border: 1px solid var(--gold); box-shadow: 0 0 8px rgba(224, 173, 69, .45); }
.bport.dead { opacity: .3; filter: grayscale(1); }
.statgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 4px 14px; margin-top: 10px; }
.artprev { margin-top: 12px; height: 420px; background: #14110e; border-radius: 8px; display: flex; align-items: center; justify-content: center; }

.pat { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.prow { display: flex; align-items: center; gap: 6px; padding: 6px; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; flex-wrap: wrap; }
.prow.and { border-bottom-style: dashed; border-color: #6b5320; margin-bottom: -5px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.pno { width: 18px; text-align: center; color: var(--dim); }
.prow select[data-p=j] { flex: 2 1 200px; } .prow select[data-p=s] { flex: 1 1 150px; } .prow select[data-p=t] { flex: 0 1 140px; }
.pn { width: 62px; } .pn-empty { width: 62px; }

.raid { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.raid-img { width: 210px; height: 200px; display: flex; align-items: center; justify-content: center; background: #14110e; border-radius: 8px; flex: none; }

/* 광장(채팅): PC는 오른쪽에 붙어 있고, 좁은 화면은 버튼으로 연다 */
body.haschat { padding-right: 300px; }
#chatdock { position: fixed; top: 0; right: 0; bottom: 0; width: 300px; z-index: 30; display: flex; flex-direction: column; background: #15120f; border-left: 1px solid var(--line); }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--gold); }
.chat-close { display: none; }
.chat-log { flex: 1 1 auto; overflow-y: auto; padding: 8px 10px; overscroll-behavior: contain; }
.chat-msg { padding: 4px 0; border-bottom: 1px solid #221d18; }
.chat-meta { font-size: 12px; } .chat-meta .dim { font-size: 11px; }
.chat-msg.me .chat-meta b { color: var(--gold); }
.chat-text { overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1 1 auto; min-width: 0; }
#chatbtn { display: none; position: fixed; right: 12px; bottom: 14px; z-index: 31; min-width: 64px; min-height: 44px; border-radius: 22px; background: var(--pri); border-color: var(--pri); color: #1a1206; font-weight: 700; box-shadow: 0 4px 14px rgba(0, 0, 0, .55); }
#chatbtn .dot { display: none; position: absolute; top: 2px; right: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); border: 2px solid #15120f; }
#chatbtn.new .dot { display: block; }
@media (max-width: 900px) {
  body.haschat { padding-right: 0; }
  #chatdock { display: none; top: auto; left: 0; width: auto; height: min(70vh, 520px); border-left: 0; border-top: 1px solid var(--gold); border-radius: 12px 12px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, .6); }
  #chatdock.open { display: flex; }
  .chat-close { display: inline-block; }
  #chatbtn { display: block; }
  #chatbtn.open { display: none; }
  .chat-form input { font-size: 16px; }
  .page { padding-bottom: 80px; }
}
.devbox { border-style: dashed; }
.ver { text-align: center; }
.help h3 { margin-top: 16px; color: var(--gold); }
.skblock { margin-top: 14px; border: 1px solid color-mix(in srgb, var(--jc) 45%, var(--line)); border-left: 4px solid var(--jc); border-radius: 8px; background: color-mix(in srgb, var(--jc) 5%, var(--panel2)); overflow: hidden; }
.skhead { margin: 0; padding: 7px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--jc); background: color-mix(in srgb, var(--jc) 16%, #14110e); border-bottom: 1px solid color-mix(in srgb, var(--jc) 40%, var(--line)); }
.skhead .sm { font-weight: 400; opacity: .8; }
.skblock .list { padding: 2px 10px 4px; }
.skblock .li:last-child { border-bottom: 0; }
.skblock.locked { border-style: dashed; border-left-style: solid; opacity: .8; }
.dex-job { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-top: 12px; background: var(--panel2); }
.dex-job.adv { margin-left: 24px; }
.dex-jobhead { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.dex-spr { width: 130px; height: 130px; background: #14110e; border-radius: 8px; display: flex; align-items: flex-end; justify-content: center; padding: 4px; flex: none; }
.dex-art { width: 130px; height: 130px; flex: none; }
.dex-sk td { vertical-align: top; font-size: 13px; }
.dex-floor { margin: 12px 0; padding: 10px 12px; background: var(--panel2); border-radius: 8px; border: 1px solid var(--line); }
.dex-floor .ico, .dex .tbl .ico { width: 24px; height: 24px; vertical-align: middle; padding: 1px; }
.dex-mons { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 8px; }
.dex-mon { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; }
.dex-mon.boss { border-color: #6b5320; grid-column: 1 / -1; }
.dex-monspr { width: 104px; min-height: 80px; display: flex; align-items: flex-end; justify-content: center; flex: none; }
.dex-mon.boss .dex-monspr { width: 160px; }
.dex-raidnote { grid-column: 1 / -1; margin: -4px 0 6px 4px; }
.merc { border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); padding: 10px; margin-bottom: 8px; }
.merc-head { display: flex; gap: 10px; align-items: center; }
.merc-art { width: 88px; height: 88px; flex: none; }
.merc-spr { width: 88px; height: 88px; flex: none; display: flex; align-items: center; justify-content: center; }
.wear { margin-top: 2px; }
.merc-act { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
.merc-detail { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.merc-detail h4 { margin: 12px 0 4px; color: var(--gold); font-size: 13px; }
.merc-skills { display: flex; gap: 4px; flex-wrap: wrap; }
.merc-pat { margin: 0; padding-left: 22px; font-size: 13px; }
.merc-pat li { padding: 2px 0; }
.ccard.rent { border-style: dashed; border-color: #6b5320; }
.tblwrap { overflow-x: auto; }
.rico { width: 20px; height: 20px; object-fit: contain; vertical-align: -5px; margin-right: 3px; }
.stico { width: 18px; height: 18px; vertical-align: -4px; margin-right: 4px; }
.stico.big { width: 34px; height: 34px; margin-right: 2px; flex: none; }
.resv { display: inline-flex; align-items: center; }
.resv .rico { width: 22px; height: 22px; margin-right: 4px; }
.skico { width: 40px; height: 40px; padding: 0; border: 0; background: none; border-radius: 6px; flex: none; }
.li.off .skico { filter: grayscale(.35) brightness(.85); }
.dex-skn { white-space: nowrap; } .dex .tbl .dex-skn .skico { width: 34px; height: 34px; vertical-align: middle; margin-right: 6px; display: inline-block; }
.merc-skills .tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; font-size: 12px; }
.merc-skills .skico { width: 24px; height: 24px; border-radius: 50%; }

/* 전투 */
.bfield { border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; padding: 8px 10px 14px; overflow: hidden; background-image: linear-gradient(rgba(16, 14, 12, .5), rgba(16, 14, 12, .78)), var(--bg, none); }
.bnames { display: flex; justify-content: space-between; color: var(--dim); font-size: 12px; }
.bsides { display: flex; justify-content: space-between; gap: 10px; min-height: 330px; }
.bside { display: flex; gap: 14px; align-items: center; }
.bcol { display: flex; flex-direction: column; gap: 8px; justify-content: center; align-items: center; min-width: 96px; }
.bu { position: relative; width: 112px; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: opacity .3s, filter .3s; }
.bu.boss { width: 240px; }
.bu-img { min-height: 48px; display: flex; align-items: flex-end; justify-content: center; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .6)); }
.bu-name { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; text-shadow: 0 1px 2px #000; }
.bu .bar { height: 5px; width: 84px; border: 1px solid #000; box-sizing: content-box; }
.bu.boss .bar { width: 200px; height: 8px; }
.bu-st { min-height: 15px; display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }
.bu-st i { font-style: normal; font-size: 10px; padding: 0 3px; border-radius: 3px; background: rgba(0, 0, 0, .65); }
.bu.dead { opacity: .25; filter: grayscale(1); }
/* 동작 그림: 112픽셀 정사각 프레임을 1.5배로 보여 준다. 캔버스 여백만큼 바깥 여백을 당긴다 */
.bu-anim { width: 168px; height: 168px; margin: -34px -28px -4px; background-repeat: no-repeat; image-rendering: pixelated; }
.bu-anim.flip { transform: scaleX(-1); }
.bu.has-anim.dead { opacity: .75; filter: grayscale(.45); }
.bu.sum .bu-name { color: #e6a0e0; }
.bu.act .bu-img { animation: act .32s; }
.bside.s1 .bu.act .bu-img { animation-name: act1; }
.bu.hit .bu-img { animation: hit .26s; }
@keyframes act { 50% { transform: translateX(16px); } }
@keyframes act1 { 50% { transform: translateX(-16px); } }
@keyframes hit { 30% { filter: brightness(3); transform: translateX(-3px); } 60% { transform: translateX(3px); } }
.bu-fx { position: absolute; left: 0; right: 0; top: 0; height: 0; pointer-events: none; z-index: 3; }
.fl { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); font-weight: 700; font-size: 16px; text-shadow: 0 0 3px #000, 0 1px 0 #000; white-space: nowrap; animation: fl .9s ease-out forwards; }
.fl.dodge { color: #9fd8ff; font-style: italic; font-weight: 800; font-size: 15px; letter-spacing: 1px; } .fl.crit { color: #ffcf4a; font-size: 22px; font-weight: 900; } .fl.critlabel { color: #ff8a3a; font-style: italic; font-weight: 800; font-size: 13px; letter-spacing: 1px; margin-top: -16px; }
.fl.phys { color: #ffd9a0; } .fl.magic { color: #c8b8ff; } .fl.poison { color: #a6e06a; } .fl.heal { color: var(--ok); } .fl.info { color: var(--info); font-size: 12px; } .fl.cost { color: #ff9a9a; font-size: 12px; }
@keyframes fl { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -34px; } }
.bfx { position: absolute; pointer-events: none; z-index: 4; image-rendering: pixelated; background-repeat: no-repeat; }
.bfield.shake .bsides { animation: shake .28s; }
@keyframes shake { 20% { transform: translate(-4px, 2px); } 40% { transform: translate(4px, -2px); } 60% { transform: translate(-3px, -1px); } 80% { transform: translate(2px, 1px); } }
.blog { height: 170px; overflow-y: auto; background: #0d0b09; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin-top: 10px; font-size: 13px; }
.t0 { color: #9fd0ff; } .t1 { color: #ffb0a0; }
.bresult { margin-top: 10px; padding: 10px 12px; background: var(--panel2); border-radius: 6px; border: 1px solid var(--line); }
.bhead { font-size: 17px; margin-bottom: 4px; }
.bctl { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.battle > .row.between { flex-wrap: wrap; gap: 6px; }
#bafter { margin-top: 10px; flex-wrap: wrap; }
/* 전투 종료 연출과 정산 창 */
.battle.end-lose .bfield { filter: grayscale(.75) brightness(.8); transition: filter .8s; }
.battle.end-win .bfield { box-shadow: 0 0 0 1px var(--gold), 0 0 26px rgba(232, 176, 75, .35); transition: box-shadow .6s; }
.bover { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(8, 6, 5, 0); animation: bover-dim .5s forwards; overflow-y: auto; }
.bover-in { width: min(440px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; margin: auto; }
.bover-banner { display: flex; flex-direction: column; align-items: center; line-height: 1.05; text-align: center; animation: bover-pop .65s cubic-bezier(.2, 1.5, .4, 1) both; }
.bover-banner b { font-size: 56px; font-weight: 900; letter-spacing: 6px; text-shadow: 0 3px 0 #000, 0 0 24px currentColor; }
.bover-sub { font: 700 15px Georgia, serif; letter-spacing: 8px; opacity: .85; }
.bover.win .bover-banner { color: #ffd67a; }
.bover.win .bover-banner::before { content: ''; position: absolute; width: 340px; height: 340px; border-radius: 50%; background: repeating-conic-gradient(rgba(255, 214, 122, .16) 0 12deg, transparent 12deg 24deg); -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%); mask: radial-gradient(circle, #000 20%, transparent 68%); animation: bover-spin 14s linear infinite; z-index: -1; pointer-events: none; }
.bover.lose .bover-banner { color: #d9584b; animation: bover-fall .9s ease-out both; }
.bover.draw .bover-banner { color: #c9c2b6; }
.bover-banner { position: relative; }
.bover-card { width: 100%; background: var(--panel); border: 1px solid var(--gold); border-radius: 10px; padding: 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, .7); opacity: 0; animation: bover-up .4s .75s ease-out forwards; }
.bover.lose .bover-card { border-color: #6b2d27; }
.bover-card .bresult { margin: 0; border: 0; padding: 0; background: none; }
.bover-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.bover-btns > * { flex: 1 1 auto; text-align: center; }
.bover.fast { animation-duration: .15s; } .bover.fast .bover-banner { animation-duration: .25s; } .bover.fast .bover-card { animation-delay: .2s; animation-duration: .2s; }
@keyframes bover-dim { to { background: rgba(8, 6, 5, .78); } }
@keyframes bover-pop { from { transform: scale(2.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes bover-fall { from { transform: translateY(-60px); opacity: 0; } 60% { transform: translateY(6px); opacity: 1; } to { transform: translateY(0); opacity: 1; } }
@keyframes bover-up { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes bover-spin { to { transform: rotate(360deg); } }
@media (max-width: 700px) { .bover-banner b { font-size: 44px; } .bover.win .bover-banner::before { width: 260px; height: 260px; } .bover-card { max-height: 62vh; overflow-y: auto; } }
@media (prefers-reduced-motion: reduce) { .bover, .bover-banner, .bover-card { animation-duration: .01s !important; animation-delay: 0s !important; } .bover.win .bover-banner::before { animation: none; } }
#bafter[hidden] { display: none; }

#toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); background: #2a241e; border: 1px solid var(--gold); color: var(--text); padding: 9px 16px; border-radius: 8px; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: 90vw; text-align: center; }
#newver { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 20px); padding: 9px 14px; background: #2a2212; border: 1px solid var(--gold); border-radius: 10px; box-shadow: 0 8px 28px rgba(0, 0, 0, .65); animation: newver-in .35s ease-out; }
#newver.min { top: auto; bottom: 14px; left: 12px; transform: none; padding: 6px 10px; }
#newver.min span, #newver.min [data-x] { display: none; }
@keyframes newver-in { from { opacity: 0; transform: translateX(-50%) translateY(-16px); } }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.bad { border-color: var(--bad); }

@media (max-width: 700px) {
  header { gap: 6px; padding: 6px 8px; }
  header .res { justify-content: flex-end; gap: 8px; font-size: 12px; }
  .bsides { min-height: 260px; gap: 2px; }
  .bside { gap: 2px; }
  .bcol { min-width: 0; }
  .bu { width: 78px; } .bu .bar { width: 60px; } .bu.boss { width: 130px; } .bu.boss .bar { width: 110px; }
  .bu-img .spr { max-width: 76px; height: auto !important; }
  .bu-anim { width: 112px; height: 112px; margin: -22px -17px -2px; }
  .bu.boss .bu-img .spr { max-width: 128px; }
  /* 손가락으로 누르기 쉬운 크기, 입력할 때 화면이 확대되지 않는 글자 크기 */
  main, .wrapper { padding-left: 8px; padding-right: 8px; }
  .panel { padding: 10px; }
  button, .btn { padding: 9px 13px; min-height: 40px; }
  button.sm, .btn.sm { padding: 7px 10px; min-height: 34px; font-size: 13px; }
  input, select, textarea { font-size: 16px; padding: 9px 8px; max-width: 100%; }
  header h1, header .logo { font-size: 16px; }
  header nav { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; gap: 4px; padding-bottom: 2px; }
  header nav::-webkit-scrollbar { display: none; }
  header nav a { padding: 8px 11px; flex: none; }
  header .res { width: auto; margin-left: auto; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: none; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .jobs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ccard { padding: 7px; }
  .ccard .row.gap { flex-wrap: wrap; }
  .ccard .row.gap > * { flex: 1 1 auto; text-align: center; }
  .tbl { display: block; overflow-x: auto; }
  .li { flex-wrap: wrap; }
  .li > .grow { flex: 1 1 60%; min-width: 0; }
  .statgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .merc-art { width: 72px; height: 72px; }
  .merc-spr { width: 72px; height: 72px; }
  .merc-act { justify-content: flex-start; }
  .merc-act .pri { flex: 1 1 auto; }
  form.row > input, form.row > select, .row.gap.wrap > input, .row.gap.wrap > select { flex: 1 1 140px; }
  #toast { bottom: 70px; width: max-content; }
  .ch-box { flex: 1 1 140px; width: auto; height: 230px; }
  .dex-job.adv { margin-left: 8px; }
  .dex-mons { grid-template-columns: 1fr; }
  .dex-sk th:nth-child(3), .dex-sk td:nth-child(3), .dex-sk th:nth-child(4), .dex-sk td:nth-child(4) { display: none; }
  .bport { flex-basis: 56px; }
  .cands { margin-left: 0; }
  .artprev { height: 300px; }
}
.charhead > .grow { flex: 1 1 320px; }
