:root {
  --bg: #050403;
  --panel: rgba(18, 14, 11, 0.94);
  --border: #5a4630;
  --border-hi: #8a6c44;
  --text: #d8d0c0;
  --dim: #8a8070;
  --gold: #d8b060;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: 'Noto Serif KR', Georgia, serif; user-select: none; }
canvas { display: block; cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24'><path d='M2 2 L18 9 L11 11 L9 18 Z' fill='%23d8b060' stroke='%23201008' stroke-width='1.5'/></svg>") 2 2, default; }
.hidden { display: none !important; }
button { font-family: inherit; }

#top-info { position: fixed; top: 14px; left: 16px; font-size: 14px; color: var(--dim); text-shadow: 0 1px 2px #000; pointer-events: none; }
#top-info b { color: var(--gold); font-family: 'Cinzel', 'Noto Serif KR', serif; }
#log { position: fixed; left: 16px; bottom: 140px; width: 460px; max-width: calc(100vw - 32px); pointer-events: none; font-size: 14px; }
.log-line { text-shadow: 0 1px 3px #000, 0 0 2px #000; margin-top: 3px; transition: opacity 1.5s; }
.log-line.fade { opacity: 0; }

/* ---------- HUD ---------- */
#hud { position: fixed; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 10px; }
.orb { position: relative; width: 112px; height: 112px; border-radius: 50%; overflow: hidden; background: #0c0806;
  border: 3px solid var(--border-hi); box-shadow: 0 0 0 2px #1a120a, 0 0 18px rgba(0,0,0,0.9); }
.orb-fill { position: absolute; left: 0; right: 0; bottom: 0; transition: height 0.12s linear; }
.orb.hp .orb-fill { background: radial-gradient(circle at 40% 30%, #ff5040, #a00e0e 45%, #4a0404); }
.orb.mp .orb-fill { background: radial-gradient(circle at 40% 30%, #6080ff, #1a28b0 45%, #060a4a); }
.orb-glass { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 35% 25%, rgba(255,255,255,0.35), rgba(255,255,255,0) 35%); }
.orb span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; text-shadow: 0 1px 2px #000; opacity: 0; transition: opacity 0.2s; }
.orb:hover span { opacity: 1; }
#bar { background: var(--panel); border: 2px solid var(--border); border-radius: 6px 6px 0 0; padding: 6px 8px 8px; box-shadow: 0 0 20px #000; }
#xp-bar { height: 6px; background: #1a1610; border: 1px solid #3a2e20; margin-bottom: 6px; }
#xp-fill { height: 100%; width: 0; background: linear-gradient(#e8d080, #9a7a30); }
#bar-row { display: flex; align-items: center; gap: 8px; }
#menu-l, #menu-r { display: flex; flex-direction: column; gap: 4px; }
#menu-l button, #menu-r button { width: 28px; height: 26px; background: #241a12; color: var(--gold); border: 1px solid var(--border); border-radius: 3px; cursor: pointer; font-family: 'Cinzel', serif; font-weight: 700; }
#menu-l button:hover, #menu-r button:hover { border-color: var(--gold); }
button.glow { animation: glow 1s infinite alternate; }
@keyframes glow { from { box-shadow: 0 0 2px #ffd060; } to { box-shadow: 0 0 10px #ffd060; border-color: #ffd060; } }
#skills { display: flex; gap: 6px; }
.skill-slot { position: relative; width: 46px; height: 46px; background: #15100c; border: 2px solid var(--border); border-radius: 4px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; }
.skill-slot.active { border-color: #ffd060; box-shadow: 0 0 10px rgba(255,208,96,0.6); }
.skill-slot.locked { opacity: 0.3; }
.skill-slot.nomana .sk-icon { filter: grayscale(1) brightness(0.6); }
.sk-icon { font-size: 23px; text-shadow: 0 0 8px currentColor; }
.sk-key { position: absolute; left: 3px; top: 1px; font-size: 11px; color: var(--dim); }
.sk-lvl { position: absolute; right: 3px; bottom: 1px; font-size: 11px; color: var(--gold); }
.pot { position: relative; width: 38px; height: 52px; border: 2px solid var(--border); border-radius: 4px; background: #15100c; cursor: default;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 3px; font-size: 14px; }
.pot::before { content: ''; position: absolute; top: 7px; width: 18px; height: 22px; border-radius: 40% 40% 50% 50%; }
#pot-hp::before { background: radial-gradient(circle at 40% 40%, #ff6060, #900); }
#pot-mp::before { background: radial-gradient(circle at 40% 40%, #7090ff, #106); }
.pk { position: absolute; left: 3px; top: 0; font-size: 10px; color: var(--dim); }

/* ---------- 패널 ---------- */
.panel { position: fixed; top: 50px; width: 400px; max-width: calc(100vw - 32px); max-height: calc(100vh - 200px); overflow-y: auto;
  background: var(--panel); border: 2px solid var(--border); border-radius: 6px; box-shadow: 0 0 30px #000; padding: 0 14px 14px; }
.panel.left { left: 16px; }
.panel.right { right: 16px; }
.panel.center { left: 50%; transform: translateX(-50%); width: 520px; }
.panel-title { position: sticky; top: 0; background: var(--panel); font-family: 'Cinzel', 'Noto Serif KR', serif; color: var(--gold); font-size: 18px;
  text-align: center; padding: 10px 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.close { position: absolute; right: 0; top: 6px; background: none; border: none; color: var(--dim); font-size: 22px; cursor: pointer; }
.close:hover { color: #fff; }

#equip { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: 60px 96px 60px; gap: 6px; margin-bottom: 12px;
  grid-template-areas: "ring1 helm amulet ring2" "weapon armor armor offhand" "gloves belt belt boots"; }
.eq-helm { grid-area: helm; } .eq-amulet { grid-area: amulet; } .eq-weapon { grid-area: weapon; } .eq-armor { grid-area: armor; }
.eq-gloves { grid-area: gloves; } .eq-ring1 { grid-area: ring1; } .eq-ring2 { grid-area: ring2; } .eq-boots { grid-area: boots; }
.eq-offhand { grid-area: offhand; } .eq-belt { grid-area: belt; }
.eq-slot .cell { width: 100%; height: 100%; }
.eq-armor .cell { width: 72px; margin: 0 auto; }
.eq-belt .cell { width: 96px; margin: 0 auto; }
.eq-label { font-size: 11px; color: #4a4030; }
#inv-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.cell { aspect-ratio: 1; background: #0e0b08 center/80% no-repeat; border: 1px solid #2e241a; border-radius: 3px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; }
.eq-slot .cell { aspect-ratio: auto; }
.cell:hover { border-color: var(--border-hi); background-color: #1c160f; }
.cell.r-magic { background-color: #10132a; }
.cell.r-rare { background-color: #262010; }
.cell.r-unique { background-color: #2a1a0a; border-color: #6a4a20; }
.cell.r-set { background-color: #0e2410; border-color: #2a6a30; }
.inv-actions { display: flex; gap: 6px; margin-top: 8px; }
.inv-actions button { flex: 1; padding: 6px; background: #241a12; color: var(--gold); border: 1px solid var(--border); border-radius: 3px; cursor: pointer; font-size: 12px; }
.inv-actions button:hover { border-color: var(--gold); }
.specials { flex-direction: column; gap: 3px; padding-top: 6px !important; }
.specials b { color: #e0b070; font-weight: 400; }
.tt-dim { color: var(--dim); font-size: 12px; }
.tt-special { color: #e0b070; margin-top: 6px; }
.tt-set { margin-top: 8px; padding-top: 6px; border-top: 1px dashed #2a5a30; font-size: 12px; }
.tt-set-name { color: #3fd45a; font-weight: 700; margin-bottom: 2px; }
.tt-set .on { color: #3fd45a; } .tt-set .off { color: #556; }
.tt-set .bonus { margin-top: 2px; }
.cell.unusable { background-color: #3a0c0c !important; }
.inv-foot { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; color: var(--dim); }
.gold-line b { color: var(--gold); font-size: 14px; }

.char-head { display: flex; justify-content: space-between; font-size: 17px; color: var(--gold); }
.xp-line { font-size: 12px; color: var(--dim); margin: 4px 0 10px; }
.pts { color: #ffe080; margin: 6px 0 10px; font-size: 14px; }
.stat-row { display: flex; align-items: center; padding: 6px 8px; background: #15100c; border: 1px solid #2e241a; margin-bottom: 4px; border-radius: 3px; }
.st-name { flex: 1; } .st-val { width: 50px; text-align: right; color: #fff; font-weight: 700; margin-right: 10px; }
.plus { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #ffd060; background: #3a2c10; color: #ffd060; font-weight: 700; cursor: pointer; }
.plus:hover { background: #5a4418; }
.plus-ph { width: 26px; }
.derived { margin-top: 12px; font-size: 13px; }
.derived div { display: flex; justify-content: space-between; padding: 3px 2px; border-bottom: 1px dashed #2a2218; }
.derived span { color: var(--dim); } .derived i { color: var(--dim); font-style: normal; font-weight: 400; font-size: 12px; }

.skill-row { display: flex; gap: 10px; align-items: center; padding: 8px; background: #15100c; border: 1px solid #2e241a; border-radius: 4px; margin-bottom: 6px; }
.skill-row.active { border-color: #8a6c30; }
.sk-big { font-size: 30px; width: 40px; text-align: center; text-shadow: 0 0 10px currentColor; }
.sk-info { flex: 1; }
.sk-name { color: var(--gold); } .sk-name span { color: var(--dim); font-size: 12px; margin-left: 6px; }
.sk-desc { font-size: 12px; margin-top: 3px; } .sk-desc.dim { color: var(--dim); }

.help div { padding: 4px 0; font-size: 14px; }
.help p { color: var(--dim); font-size: 13px; line-height: 1.6; }
kbd { background: #2a2018; border: 1px solid var(--border); border-radius: 3px; padding: 1px 6px; font-family: inherit; font-size: 12px; color: var(--gold); }

#tooltip { position: fixed; z-index: 50; pointer-events: none; background: rgba(8,6,4,0.96); border: 1px solid var(--border-hi); padding: 10px 14px;
  max-width: 300px; text-align: center; font-size: 13px; line-height: 1.5; box-shadow: 0 0 20px #000; }
.tt-name { font-size: 15px; font-weight: 700; }
.tt-base { font-size: 13px; }
.tt-rarity { color: var(--dim); font-size: 12px; margin-bottom: 4px; }
.tt-req { color: var(--dim); font-size: 12px; }
.tt-stats { color: #8a9cff; margin-top: 4px; }
.tt-hint { color: #9a8a60; font-size: 11px; margin-top: 6px; }
.tt-sep { margin: 10px -14px 6px; padding-top: 6px; border-top: 1px solid var(--border); color: var(--dim); font-size: 11px; }

/* ---------- 오버레이 ---------- */
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 40;
  background: radial-gradient(circle at 50% 45%, rgba(60,20,10,0.55), rgba(0,0,0,0.95) 70%); }
#overlay-dead { background: radial-gradient(circle, rgba(80,0,0,0.4), rgba(0,0,0,0.9) 70%); }
.title-box { text-align: center; max-width: 520px; padding: 16px; }
h1 { font-family: 'Cinzel', serif; font-size: 64px; margin: 0; color: #d8a860; letter-spacing: 4px;
  text-shadow: 0 0 30px rgba(255,120,40,0.5), 0 3px 0 #3a1a08; }
h1.dead { color: #c02020; font-family: 'Noto Serif KR', serif; text-shadow: 0 0 30px rgba(255,0,0,0.5); }
.subtitle { color: var(--dim); letter-spacing: 10px; margin: 4px 0 20px; }
.title-box p { color: var(--dim); line-height: 1.7; margin-bottom: 28px; }
button.big { display: block; width: 280px; margin: 10px auto; padding: 12px; font-size: 17px; background: linear-gradient(#3a2a18, #20160c);
  color: var(--gold); border: 2px solid var(--border-hi); border-radius: 4px; cursor: pointer; }
button.big:hover { border-color: #ffd070; color: #ffe0a0; box-shadow: 0 0 14px rgba(255,190,90,0.3); }

@media (max-width: 760px) {
  .orb { width: 70px; height: 70px; }
  .skill-slot { width: 40px; height: 40px; }
  h1 { font-size: 40px; }
}

/* ---------- 버프 / 단축키 / 기술 탭 ---------- */
#buffs { position: fixed; bottom: 128px; left: 50%; transform: translateX(-50%); display: flex; gap: 14px; white-space: nowrap; font-size: 13px; text-shadow: 0 1px 2px #000; pointer-events: none; }
.skill-slot.empty { opacity: 0.45; }
.tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.tabs button { flex: 1; padding: 6px 0; background: #15100c; color: var(--dim); border: 1px solid #2e241a; border-radius: 3px; cursor: pointer; font-size: 13px; }
.tabs button.on { color: var(--gold); border-color: var(--border-hi); background: #2a1e12; }
.tabs button:hover { color: var(--gold); }
.hint { color: var(--dim); font-size: 12px; margin: 4px 0 8px; line-height: 1.5; }
.hint kbd { font-size: 11px; padding: 0 4px; }
.skill-row.locked { opacity: 0.45; }
.sk-big { position: relative; cursor: pointer; }
.sk-slot { position: absolute; right: -2px; bottom: -4px; font-size: 11px; color: #ffd060; text-shadow: none; font-family: inherit; }
.cell { position: relative; }
.cell .upg { position: absolute; right: 2px; top: 1px; font-size: 10px; color: #ffe080; text-shadow: 0 0 3px #000, 0 0 2px #000; }
.tt-upg { color: #ffe080; font-size: 12px; }

/* ---------- 상인 ---------- */
#panel-shop { width: 440px; }
.shop-gold { text-align: right; font-size: 13px; color: var(--dim); margin-bottom: 4px; }
.shop-gold b { color: var(--gold); font-size: 15px; }
.shop-sec { color: var(--gold); font-size: 13px; margin: 12px 0 6px; padding-bottom: 3px; border-bottom: 1px solid #2e241a; }
.shop-row { display: flex; align-items: center; gap: 6px; padding: 5px 0; font-size: 13px; }
.shop-row > span:first-child { flex: 1; }
.shop-row i { color: var(--dim); font-style: normal; font-size: 12px; }
.shop-row.col { flex-direction: column; align-items: stretch; }
.shop-btn { padding: 5px 10px; background: #241a12; color: var(--gold); border: 1px solid var(--border); border-radius: 3px; cursor: pointer; font-size: 12px; white-space: nowrap; }
.shop-btn:hover { border-color: var(--gold); }
.shop-btn.off { opacity: 0.45; }
.shop-btn .cost, .gamble .cost, .price { color: #e8c040; }
.shop-btn .cost::before, .gamble .cost::before, .price::before { content: '● '; font-size: 9px; vertical-align: middle; }
.shop-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.shop-item .price { text-align: center; font-size: 11px; margin-top: 2px; }
.price.poor, .gamble.poor .cost { color: #8a4a3a; }
.cell.sold { cursor: default; font-size: 10px; color: #4a4030; }
.gamble-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.gamble { background: #15100c; border: 1px solid #2e241a; border-radius: 4px; padding: 6px 2px; text-align: center; cursor: pointer; font-size: 12px; }
.gamble:hover { border-color: var(--border-hi); background: #1e1610; }
.gamble img { width: 34px; height: 34px; display: block; margin: 0 auto 2px; }
.gamble .cost { font-size: 11px; }
.shop-card { background: #0c0906; border: 1px solid #2e241a; border-radius: 4px; padding: 10px; text-align: center; font-size: 13px; line-height: 1.5; }
.pick-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.cell.picked { border-color: #ffd060; box-shadow: 0 0 6px rgba(255,208,96,0.7); }
.smith-info { font-size: 13px; text-align: center; padding: 4px 0; }
.smith-info b { color: #ffe080; }
.warn { color: #e07060; }
.on-tag { color: #8c8; font-size: 12px; padding: 0 8px; }
@media (max-width: 1000px) { .skill-slot { width: 38px; height: 38px; } .sk-icon { font-size: 19px; } }
.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-track { background: #0e0b08; }
.panel::-webkit-scrollbar-thumb { background: #4a3a28; border-radius: 4px; }
.panel { scrollbar-color: #4a3a28 #0e0b08; scrollbar-width: thin; }

/* ---------- 사망 / 순위표 ---------- */
.overlay { overflow-y: auto; }
.title-box.wide { max-width: 640px; width: 100%; }
.warn-perma { color: #e06060; font-weight: 400; }
#death-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
#death-stats div { background: rgba(20,10,8,0.8); border: 1px solid #4a2a20; border-radius: 4px; padding: 8px 4px; }
#death-stats b { display: block; color: #ffd070; font-size: 20px; }
#death-stats span { color: var(--dim); font-size: 12px; }
#death-stats .by { grid-column: 1 / -1; color: #c88; font-size: 13px; }
#rank-form { margin: 10px 0; }
.rank-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.rank-row select, .rank-row input { background: #120c08; color: var(--text); border: 1px solid var(--border); border-radius: 3px; padding: 8px; font-family: inherit; font-size: 14px; }
.rank-row input { width: 160px; }
.rank-row button { padding: 8px 16px; background: linear-gradient(#5a3a18, #2a1a0c); color: #ffe0a0; border: 1px solid var(--border-hi); border-radius: 3px; cursor: pointer; font-family: inherit; font-size: 14px; }
.rank-row button:disabled { opacity: 0.6; cursor: default; }
#rank-form.done .rank-row { opacity: 0.6; pointer-events: none; }
#rank-msg { min-height: 20px; margin-top: 6px; color: #ffd070; font-size: 13px; }
.board-wrap { background: rgba(10,7,5,0.85); border: 1px solid var(--border); border-radius: 6px; padding: 10px; margin: 12px 0; text-align: left; }
.board-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.board-title { font-family: 'Cinzel', 'Noto Serif KR', serif; color: var(--gold); font-size: 18px; }
.board-filter { background: #120c08; color: var(--text); border: 1px solid var(--border); border-radius: 3px; padding: 4px; font-family: inherit; }
.board-body { max-height: 300px; overflow-y: auto; scrollbar-color: #4a3a28 #0e0b08; scrollbar-width: thin; }
.board { width: 100%; border-collapse: collapse; font-size: 13px; }
.board th { color: var(--dim); font-weight: 400; font-size: 12px; text-align: left; padding: 4px; border-bottom: 1px solid #3a2e20; position: sticky; top: 0; background: #0e0a07; }
.board td { padding: 5px 4px; border-bottom: 1px dashed #2a2218; }
.board tr.top1 td { color: #ffd700; } .board tr.top2 td { color: #d8d8e8; } .board tr.top3 td { color: #e0a070; }
.board tr.me td { background: rgba(255,200,80,0.15); color: #ffe8a0; }
.board-empty { color: var(--dim); text-align: center; padding: 20px; font-size: 13px; }
.donate { margin: 12px 0; padding: 12px; border: 1px dashed #8a6c44; border-radius: 6px; background: rgba(40,28,12,0.6); }
.donate-msg { color: #e8d8b0; margin-bottom: 8px; }
.donate-line { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.donate-acc { color: #ffd070; font-size: 15px; letter-spacing: 0.5px; }
.donate-copy { padding: 4px 12px; background: #3a2a14; color: #ffe0a0; border: 1px solid var(--border-hi); border-radius: 3px; cursor: pointer; font-family: inherit; }

#btn-fs { position: fixed; top: 38px; left: 16px; background: rgba(20,14,10,0.7); color: var(--dim); border: 1px solid #3a2e20; border-radius: 3px; padding: 2px 8px; font-size: 12px; cursor: pointer; font-family: inherit; }
#btn-fs:hover { color: var(--gold); border-color: var(--border-hi); }
.rank-note { color: var(--dim); font-size: 11px; line-height: 1.6; margin-top: 4px; }
.donate-link { display: inline-block; margin: 4px 0 8px; padding: 9px 22px; background: #0064ff; color: #fff; border-radius: 6px; text-decoration: none; font-size: 14px; }
.donate-link:hover { background: #1a75ff; }

/* ---------- 터치 화면 (휴대폰 · 태블릿) ---------- */
#tools { position: fixed; top: 38px; left: 16px; display: flex; gap: 6px; }
#tools #btn-fs { position: static; }
#tools button { background: rgba(20,14,10,0.7); color: var(--dim); border: 1px solid #3a2e20; border-radius: 3px; padding: 2px 8px; font-size: 12px; cursor: pointer; font-family: inherit; }
.touch-only { display: none !important; }
body.touch .touch-only { display: block !important; }
body.touch #tools .touch-only { display: inline-block !important; }
body.touch .mouse-only { display: none; }
.touch-help { margin-bottom: 8px; }
.pot { cursor: pointer; }
.overlay { align-items: flex-start; }
.overlay > .title-box { margin: auto; }
.skill-row { cursor: pointer; }
.skill-row.picked { border-color: #ffd060; box-shadow: 0 0 8px rgba(255,208,96,0.5); }
.hint.pick { color: #ffe080; }
.skill-slot.pick { animation: glow 0.7s infinite alternate; }
#rotate { display: none; }
body.touch { -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
body.touch canvas, body.touch #hud, body.touch #tools { touch-action: none; }
body.touch button, body.touch .cell, body.touch .panel { touch-action: manipulation; }
body.touch .orb span { opacity: 1; font-size: 11px; }
body.touch #tools { top: max(36px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); }
body.touch #tools button { padding: 6px 10px; font-size: 13px; }
body.touch #menu-l button, body.touch #menu-r button { width: 36px; height: 32px; font-size: 15px; }
body.touch .cell .upg { font-size: 11px; }
@media (orientation: portrait) {
  body.touch #rotate { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #050403; color: var(--gold); font-size: 48px; text-align: center; }
  body.touch #rotate p { font-size: 18px; color: var(--text); }
}
/* 높이가 낮은 화면 (휴대폰 가로) */
@media (max-height: 560px) {
  #top-info { top: 8px; font-size: 12px; }
  body.touch #tools { top: 28px; }
  #hud { bottom: max(4px, env(safe-area-inset-bottom)); gap: 6px; }
  .orb { width: 64px; height: 64px; }
  .skill-slot { width: 44px; height: 44px; }
  .sk-icon { font-size: 21px; }
  .pot { width: 40px; height: 48px; }
  #bar { padding: 4px 6px 5px; }
  #xp-bar { margin-bottom: 4px; }
  #log { bottom: 86px; font-size: 12px; width: 46vw; }
  #log .log-line:nth-last-child(n+5) { display: none; }
  #buffs { bottom: 80px; font-size: 11px; }
  .panel { top: 6px; max-height: calc(100vh - 92px); max-height: calc(100dvh - 92px); padding: 0 10px 10px; }
  .panel-title { font-size: 15px; padding: 6px 0; margin-bottom: 6px; }
  .close { top: 0; font-size: 26px; padding: 0 6px; }
  #equip { grid-template-rows: 48px 76px 48px; gap: 4px; margin-bottom: 8px; }
  .help div { font-size: 12px; padding: 2px 0; }
  .help p { font-size: 12px; }
  h1 { font-size: 40px; }
  .subtitle { margin-bottom: 10px; }
  .title-box p { font-size: 13px; margin-bottom: 12px; line-height: 1.5; }
  button.big { padding: 8px; margin: 6px auto; font-size: 15px; }
  #death-stats { margin: 8px 0; }
  #death-stats b { font-size: 16px; }
  .board-body { max-height: 180px; }
}
@media (max-width: 700px) {
  .skill-slot { width: 38px; height: 38px; }
  #skills { gap: 4px; }
  #bar-row { gap: 5px; }
}
@media (max-height: 560px) {
  body.touch #tools button { padding: 3px 8px; font-size: 12px; }
  /* 인벤토리: 장비 | 가방 좌우 배치 */
  #panel-inv { width: min(620px, calc(100vw - 20px)); right: 10px; display: grid; grid-template-columns: 210px 1fr; column-gap: 10px; align-content: start; }
  #panel-inv .panel-title { grid-column: 1 / -1; }
  #panel-inv #equip { grid-row: 2 / span 3; grid-template-rows: 44px 64px 44px; margin: 0; }
  #panel-inv .eq-armor .cell { width: 52px; } #panel-inv .eq-belt .cell { width: 70px; }
  #panel-inv .inv-foot { margin-top: 6px; }
  #panel-inv .inv-actions { margin-top: 4px; }
  #panel-inv .inv-actions button { padding: 5px 2px; font-size: 11px; }
}
