* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #000;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  overscroll-behavior: none;
}
#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#touch-layer { position: fixed; inset: 0; }
#hud { position: fixed; inset: 0; pointer-events: none; color: #fff; }
#hud button { pointer-events: auto; font: inherit; }

/* ── 십자선 ───────────────────────── */
#crosshair { position: fixed; left: 50%; top: 50%; --gap: 8px; --len: 9px; }
#crosshair .ch, #crosshair .dot {
  position: absolute; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.55); border-radius: 1px;
  transition: background .08s;
}
#crosshair .t { width: 2px; height: var(--len); left: -1px; top: calc(-1 * (var(--gap) + var(--len))); }
#crosshair .b { width: 2px; height: var(--len); left: -1px; top: var(--gap); }
#crosshair .l { height: 2px; width: var(--len); top: -1px; left: calc(-1 * (var(--gap) + var(--len))); }
#crosshair .r { height: 2px; width: var(--len); top: -1px; left: var(--gap); }
#crosshair .dot { width: 3px; height: 3px; left: -1.5px; top: -1.5px; border-radius: 50%; }
#crosshair.on .ch, #crosshair.on .dot { background: #ff4a3d; }
#crosshair.hide { display: none; }

/* ── 히트마커 ─────────────────────── */
#hitmarker { position: fixed; left: 50%; top: 50%; opacity: 0; }
#hitmarker i {
  position: absolute; width: 2.5px; height: 10px; left: -1.25px; top: -5px;
  background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.5);
}
#hitmarker i:nth-child(1) { transform: rotate(45deg) translateY(-13px); }
#hitmarker i:nth-child(2) { transform: rotate(135deg) translateY(-13px); }
#hitmarker i:nth-child(3) { transform: rotate(225deg) translateY(-13px); }
#hitmarker i:nth-child(4) { transform: rotate(315deg) translateY(-13px); }
#hitmarker.head i { background: #ffd23f; height: 12px; }
#hitmarker.kill i { background: #ff3b3b; height: 15px; width: 3px; }
#hitmarker.show { animation: hm var(--hm-time, .3s) ease-out; }
@keyframes hm {
  0% { opacity: 1; transform: scale(1.6); }
  25% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}

/* ── 조준경 오버레이 ───────────────── */
#scope { position: fixed; inset: 0; display: none; --r: 40vh; }
#scope.on { display: block; }
#scope[data-type=x2], #scope[data-type=x4], #scope[data-type=x8] {
  background: radial-gradient(circle at center, transparent 0, transparent var(--r), rgba(0,0,0,.94) calc(var(--r) + 3px), #000 75vh);
}
#scope[data-type=x2] { --r: 44vh; }
#scope[data-type=x4] { --r: 41vh; }
#scope[data-type=x8] { --r: 39vh; }
#scope .ret { position: absolute; left: 50%; top: 50%; width: 200px; height: 200px; margin: -100px 0 0 -100px; }
#scope[data-type=x4] .ret, #scope[data-type=x8] .ret { width: 78vh; height: 78vh; margin: -39vh 0 0 -39vh; }
#scope .ret svg { width: 100%; height: 100%; display: block; }
#scope[data-type=reddot] .ret, #scope[data-type=x2] .ret { filter: drop-shadow(0 0 3px rgba(255,40,40,.8)); }

/* ── 조준 보정 디버그 링 ─────────── */
#assist-ring {
  position: fixed; border: 2px dashed rgba(80,220,255,.8); border-radius: 50%;
  transform: translate(-50%,-50%); display: none;
}

/* ── 데미지 숫자 / 콜아웃 ─────────── */
#dmg-layer { position: fixed; inset: 0; }
.dmg {
  position: absolute; font-weight: 900; font-size: 18px; color: #fff;
  -webkit-text-stroke: 1px rgba(0,0,0,.65); text-shadow: 0 2px 0 rgba(0,0,0,.35);
  transform: translate(-50%,-50%); white-space: nowrap; will-change: transform, opacity;
}
.dmg.head { color: #ffd23f; font-size: 24px; }
#callout {
  position: fixed; left: 50%; top: 30%; transform: translateX(-50%);
  font-size: 30px; font-weight: 900; letter-spacing: 1px; opacity: 0;
  -webkit-text-stroke: 1.5px rgba(0,0,0,.7); text-shadow: 0 3px 0 rgba(0,0,0,.35);
}
#callout.head { color: #ffd23f; }
#callout.show { animation: callout .9s ease-out; }
@keyframes callout {
  0% { opacity: 0; transform: translateX(-50%) scale(1.8); }
  15% { opacity: 1; transform: translateX(-50%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-12px); }
}

/* ── 조이스틱 ─────────────────────── */
#joy-base {
  position: fixed; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%;
  background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.35); opacity: .45;
  transition: opacity .12s;
}
#joy-base { opacity: calc(.45 * var(--o, 1)); }
#joy-base.active { opacity: var(--o, 1); transition: none; }
#joy-knob {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%; background: rgba(255,255,255,.75); box-shadow: 0 2px 8px rgba(0,0,0,.35);
}

/* ── 버튼 ─────────────────────────── */
.btn {
  position: fixed; border-radius: 50%; border: 3px solid rgba(255,255,255,.75);
  color: #fff; font-weight: 800; display: grid; place-items: center;
  background: rgba(20,24,36,.35); touch-action: none;
}
.btn.pressed { --press: .92; transform: scale(.92); background: rgba(255,255,255,.3); }
#btn-fire {
  right: calc(56px + env(safe-area-inset-right)); bottom: 64px; width: 96px; height: 96px;
  background: rgba(255,90,60,.45); font-size: 16px;
}
#btn-fire-left {
  left: calc(36px + env(safe-area-inset-left)); top: 26%; width: 66px; height: 66px;
  background: rgba(255,90,60,.4); font-size: 13px;
}
#btn-fire-left.off { display: none; }
#btn-ads { right: calc(176px + env(safe-area-inset-right)); bottom: 44px; width: 64px; height: 64px; font-size: 14px; }
#btn-ads.on { background: rgba(80,200,255,.5); }
#btn-reload { right: calc(40px + env(safe-area-inset-right)); bottom: 182px; width: 52px; height: 52px; font-size: 16px; }
#btn-crouch { right: calc(170px + env(safe-area-inset-right)); bottom: 122px; width: 56px; height: 56px; font-size: 13px; }
#btn-crouch.on { background: rgba(120,220,120,.5); }
#gun-opts { position: fixed; left: calc(50% + 72px); bottom: 58px; display: flex; flex-direction: column; gap: 5px; }
#gun-opts button {
  height: 26px; padding: 0 10px; border-radius: 13px; border: 2px solid rgba(255,255,255,.45);
  background: rgba(20,24,36,.55); color: #fff; font-weight: 800; font-size: 11.5px; white-space: nowrap;
}
#btn-mode.single-only { opacity: .5; }
#btn-map {
  position: fixed; right: calc(104px + env(safe-area-inset-right)); top: 8px; height: 34px; padding: 0 12px;
  border-radius: 8px; border: 2px solid rgba(255,255,255,.5); background: rgba(20,24,36,.6); color: #fff; font-weight: 700;
}
#btn-map.on { background: #ffb02e; color: #1a1a1a; }

#weapons {
  position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 6px;
}
#weapons button {
  min-width: 50px; height: 36px; padding: 0 8px; border-radius: 8px; border: 2px solid rgba(255,255,255,.4);
  background: rgba(20,24,36,.5); color: #fff; font-weight: 800; font-size: 13px;
}
#weapons button.on { background: #ffb02e; color: #1a1a1a; border-color: #fff; }

#ammo {
  position: fixed; left: 50%; bottom: 58px; transform: translateX(-50%); text-align: center;
  font-weight: 900; text-shadow: 0 2px 0 rgba(0,0,0,.45);
}
#weapon-name { font-size: 12px; opacity: .85; }
#ammo-cur { font-size: 26px; }
#ammo-cur.low { color: #ff5a4a; }
#ammo-max { font-size: 14px; opacity: .75; }
#reload-bar { width: 90px; height: 5px; margin: 3px auto 0; background: rgba(0,0,0,.4); border-radius: 3px; overflow: hidden; visibility: hidden; }
#reload-bar.on { visibility: visible; }
#reload-bar i { display: block; height: 100%; width: 0; background: #ffd23f; }

#stats {
  position: fixed; left: calc(10px + env(safe-area-inset-left)); top: 8px;
  font-size: 11px; line-height: 1.5; background: rgba(0,0,0,.35); padding: 4px 8px; border-radius: 6px;
  white-space: pre;
}
#btn-tune {
  position: fixed; right: calc(10px + env(safe-area-inset-right)); top: 8px; height: 34px; padding: 0 12px;
  border-radius: 8px; border: 2px solid rgba(255,255,255,.5); background: rgba(20,24,36,.6); color: #fff; font-weight: 700;
}
#btn-tune.on { background: #ffb02e; color: #1a1a1a; }

/* ── 튜닝 패널 ───────────────────── */
#tuning {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(360px, 52vw); z-index: 20;
  background: rgba(14,17,27,.94); color: #e8ecf5; font-size: 12.5px; overflow-y: auto;
  padding: 10px 14px calc(16px + env(safe-area-inset-bottom)); touch-action: pan-y;
  border-left: 1px solid rgba(255,255,255,.12);
}
#tuning[hidden] { display: none; }
.tn-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.tn-head b { font-size: 15px; }
#tuning button {
  font: inherit; color: #fff; background: #2a3146; border: 1px solid #3c4560; border-radius: 6px; padding: 5px 9px;
}
#tuning button:active { background: #3c4560; }
.tn-presets { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 8px; }
.tn-presets button.on { background: #ffb02e; color: #1a1a1a; border-color: #ffb02e; }
#tuning h3 { font-size: 12px; color: #ffb02e; margin: 14px 0 6px; letter-spacing: .5px; }
.tn-row { display: grid; grid-template-columns: 1fr 58px; align-items: center; gap: 2px 8px; margin: 7px 0; }
.tn-row label { font-weight: 600; }
.tn-row .val { text-align: right; font-variant-numeric: tabular-nums; color: #9fd8ff; }
.tn-row input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: #ffb02e; height: 22px; margin: 0; }
.tn-row .hint { grid-column: 1 / -1; font-size: 11px; color: #8a93a8; margin-top: -2px; }
.tn-row.bool { grid-template-columns: 1fr auto; }
.tn-row.bool input { width: 20px; height: 20px; accent-color: #ffb02e; }
.tn-foot { display: flex; gap: 6px; margin-top: 16px; }
.tn-foot textarea { width: 100%; height: 90px; margin-top: 6px; background: #0b0d14; color: #9fd8ff; border: 1px solid #3c4560; font-size: 11px; }

/* ── 시작 / 회전 안내 ────────────── */
#start {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 30%, rgba(40,60,110,.85), rgba(8,10,18,.95));
  color: #fff; padding: 16px;
}
#start.hidden { display: none; }
#start .card { max-width: 520px; text-align: center; }
#start h1 { margin: 0; font-size: 34px; font-weight: 900; letter-spacing: 2px; color: #ffb02e; -webkit-text-stroke: 1px #000; }
#start .sub { margin: 4px 0 12px; opacity: .85; }
#start ul { text-align: left; display: inline-block; margin: 0 0 8px; padding-left: 18px; line-height: 1.7; font-size: 14px; }
#start .pc { font-size: 11px; opacity: .6; margin: 4px 0 14px; }
#start-btn {
  font: inherit; font-size: 18px; font-weight: 900; padding: 12px 34px; border-radius: 999px; border: 0;
  background: #ffb02e; color: #1a1a1a; box-shadow: 0 4px 0 #b36f00;
}
#rotate {
  position: fixed; inset: 0; z-index: 40; display: none; place-items: center;
  background: #0b0d14; color: #fff; font-size: 20px; font-weight: 800;
}
@media (orientation: portrait) and (pointer: coarse) { #rotate { display: grid; } }

/* ── 튜닝 탭 / 무기 밸런스 ─────────── */
.tn-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.tn-tabs button { flex: 1; }
.tn-tabs button.on { background: #ffb02e !important; color: #1a1a1a !important; border-color: #ffb02e !important; }
.tn-wmeta { color: #9fd8ff; font-size: 12px; }
#tuning table { width: 100%; border-collapse: collapse; font-size: 11.5px; font-variant-numeric: tabular-nums; }
#tuning th, #tuning td { padding: 3px 4px; text-align: right; border-bottom: 1px solid rgba(255,255,255,.08); }
#tuning th:first-child, #tuning td:first-child { text-align: left; }
#tuning th { color: #8a93a8; font-weight: 600; }
.tn-ttk .hint { font-size: 11px; color: #8a93a8; margin-top: 4px; }

/* ── 맵 분석 ───────────────────────── */
#mapview { position: fixed; inset: 0; z-index: 25; background: #0e1220; color: #e8ecf5; font-size: 12px; }
#mapview[hidden] { display: none; }
#mapview canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.mv-bar {
  position: absolute; left: 10px; right: 10px; top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.mv-bar b { font-size: 14px; margin-right: 6px; }
.mv-group { display: inline-flex; gap: 4px; }
#mapview button {
  font: inherit; font-weight: 700; color: #fff; background: #2a3146; border: 1px solid #3c4560; border-radius: 6px; padding: 6px 10px;
}
#mapview button.on { background: #ffb02e; color: #1a1a1a; border-color: #ffb02e; }
#mapview [data-close] { margin-left: auto; }
.mv-side {
  position: absolute; right: 10px; top: 52px; width: min(250px, 30vw); max-height: calc(100% - 90px); overflow: auto;
  background: rgba(14,17,27,.85); border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: 8px 10px; line-height: 1.6;
}
.mv-side table { width: 100%; border-collapse: collapse; margin-top: 6px; font-variant-numeric: tabular-nums; }
.mv-side th, .mv-side td { padding: 2px 3px; text-align: right; border-bottom: 1px solid rgba(255,255,255,.08); }
.mv-side th:first-child, .mv-side td:first-child { text-align: left; }
.mv-side .sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -2px; margin-right: 6px; border: 1px solid #000; }
.mv-side .ramp { display: inline-block; width: 100%; height: 10px; border-radius: 3px; background: linear-gradient(90deg, hsl(220,85%,52%), hsl(110,85%,52%), hsl(55,85%,52%), hsl(0,85%,52%)); }
.mv-hint { position: absolute; left: 12px; bottom: 8px; opacity: .6; }

#btn-char, #btn-modes {
  position: fixed; right: calc(196px + env(safe-area-inset-right)); top: 8px; height: 34px; padding: 0 12px;
  border-radius: 8px; border: 2px solid rgba(255,255,255,.5); background: rgba(20,24,36,.6); color: #fff; font-weight: 700;
}
.tn-cmp tr.warn td { color: #ff6a5a; }

/* ── 캐릭터 선택 ───────────────────── */
#charselect {
  position: fixed; inset: 0; z-index: 35; display: flex; flex-direction: column; gap: 8px;
  padding: 10px calc(14px + env(safe-area-inset-right)) 10px calc(14px + env(safe-area-inset-left));
  background: radial-gradient(circle at 50% 35%, #2a3a66, #0b0d16 75%); color: #e8ecf5; font-size: 12.5px;
}
#charselect[hidden] { display: none; }
.cs-head b { font-size: 18px; font-weight: 900; color: #ffb02e; margin-right: 10px; }
.cs-sub { opacity: .7; }
.cs-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(110px, 160px) 1fr minmax(220px, 300px); gap: 10px; }
.cs-list { display: flex; flex-direction: column; gap: 6px; overflow: auto; }
.cs-list button {
  display: grid; grid-template-columns: 14px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left;
  font: inherit; color: #fff; background: rgba(42,49,70,.8); border: 2px solid transparent; border-radius: 10px; padding: 7px 10px;
}
.cs-list button i { grid-row: 1 / 3; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #000; }
.cs-list button b { font-size: 14px; }
.cs-list button small { opacity: .7; }
.cs-list button.on { border-color: #ffb02e; background: rgba(255,176,46,.18); }
.cs-stage { position: relative; min-height: 0; }
.cs-stage canvas { width: 100%; height: 100%; display: block; }
.cs-hit {
  position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%);
  font: inherit; font-weight: 700; color: #fff; background: #2a3146; border: 1px solid #3c4560; border-radius: 999px; padding: 6px 14px;
}
.cs-hit.on { background: #39ff6a; color: #0b0d16; border-color: #39ff6a; }
.cs-info { overflow: auto; background: rgba(14,17,27,.7); border-radius: 10px; padding: 8px 12px; line-height: 1.5; }
.cs-info h2 { margin: 0; font-size: 20px; }
.cs-info h2 small { font-size: 12px; color: #ffb02e; margin-left: 4px; }
.cs-info p { margin: 4px 0 6px; opacity: .85; }
.cs-passive { display: inline-block; background: rgba(255,176,46,.18); color: #ffd27a; border-radius: 6px; padding: 2px 8px; margin-bottom: 6px; font-weight: 700; }
.cs-stat { display: grid; grid-template-columns: 74px 1fr 44px; align-items: center; gap: 6px; margin: 3px 0; }
.cs-stat em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; color: #9fd8ff; }
.cs-bar { height: 7px; background: rgba(255,255,255,.1); border-radius: 4px; overflow: hidden; }
.cs-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb02e, #ff6a3d); }
.cs-info table { width: 100%; margin-top: 6px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.cs-info td { padding: 2px 3px; border-bottom: 1px solid rgba(255,255,255,.08); }
.cs-info td:nth-child(even) { text-align: right; color: #9fd8ff; }
.cs-note { font-size: 11px; opacity: .55; margin-top: 4px; }
.cs-go {
  align-self: center; font: inherit; font-size: 16px; font-weight: 900; padding: 9px 46px; border-radius: 999px; border: 0;
  background: #ffb02e; color: #1a1a1a; box-shadow: 0 4px 0 #b36f00;
}
#btn-modes { right: calc(306px + env(safe-area-inset-right)); }

/* ── 모드 선택 ─────────────────────── */
#modeselect {
  position: fixed; inset: 0; z-index: 36; display: flex; flex-direction: column; gap: 8px;
  padding: 10px calc(14px + env(safe-area-inset-right)) 10px calc(14px + env(safe-area-inset-left));
  background: radial-gradient(circle at 50% 35%, #3a2a66, #0b0d16 75%); color: #e8ecf5; font-size: 12.5px;
}
#modeselect[hidden] { display: none; }
.ms-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(130px, 190px) 1fr; gap: 12px; }
.ms-list { display: flex; flex-direction: column; gap: 6px; overflow: auto; }
.ms-list button {
  font: inherit; color: #fff; text-align: left; background: rgba(42,49,70,.8); border: 2px solid transparent;
  border-radius: 10px; padding: 7px 12px; display: flex; flex-direction: column;
}
.ms-list button small { color: #ffb02e; font-size: 10.5px; }
.ms-list button b { font-size: 15px; }
.ms-list button.on { border-color: #ffb02e; background: rgba(255,176,46,.18); }
.ms-info { overflow: auto; background: rgba(14,17,27,.7); border-radius: 10px; padding: 8px 14px; }
.ms-info h2 { margin: 0; font-size: 20px; }
.ms-info p { margin: 4px 0 8px; opacity: .85; }
.ms-rules { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
.ms-row { display: flex; align-items: center; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.ms-row button, .ms-reset {
  font: inherit; font-weight: 700; color: #fff; background: #2a3146; border: 1px solid #3c4560; border-radius: 6px; padding: 5px 12px;
}
.ms-row button.on { background: #ffb02e; color: #1a1a1a; border-color: #ffb02e; }
.ms-row input { width: 18px; height: 18px; accent-color: #ffb02e; }
.ms-meta { color: #9fd8ff; margin: 6px 0; }

/* ── 매치 HUD ─────────────────────── */
#scorebar {
  position: fixed; left: 50%; top: 6px; transform: translateX(-50%); display: flex; align-items: stretch;
  font-weight: 900; text-shadow: 0 2px 0 rgba(0,0,0,.4); border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
#scorebar > span { min-width: 48px; display: grid; place-items: center; font-size: 22px; }
#scorebar .sa { background: rgba(60,140,240,.85); }
#scorebar .sb { background: rgba(230,70,60,.85); }
#scorebar .mid { background: rgba(14,17,27,.8); padding: 2px 12px; text-align: center; display: flex; flex-direction: column; }
#scorebar .mid b { font-size: 18px; }
#scorebar .mid b.low { color: #ff6a5a; }
#scorebar .mid small { font-size: 10px; font-weight: 600; opacity: .75; white-space: nowrap; }
#stats { top: 52px; }
#killfeed {
  position: fixed; right: calc(10px + env(safe-area-inset-right)); top: 50px; display: flex; flex-direction: column; gap: 3px;
  align-items: flex-end; font-size: 12px; font-weight: 700;
}
#killfeed div { background: rgba(14,17,27,.7); padding: 3px 8px; border-radius: 5px; white-space: nowrap; }
#killfeed em { font-style: normal; color: #cfd6e6; font-weight: 600; }
.tA { color: #6cbcff; } .tB { color: #ff7a6a; }
#killfeed .me { text-decoration: underline; color: #ffd23f; }
#hp {
  position: fixed; left: calc(50% - 230px); bottom: 64px; width: 130px; height: 16px; border-radius: 8px;
  background: rgba(0,0,0,.45); border: 2px solid rgba(255,255,255,.5); overflow: hidden;
}
#hp i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #4ee07a, #a5f06a); transition: width .15s; }
#hp.low i { background: linear-gradient(90deg, #ff3b3b, #ff8a3d); }
#hp span { position: relative; display: block; text-align: center; font-size: 11px; line-height: 12px; font-weight: 900; text-shadow: 0 1px 0 #000; }
#hurt {
  position: fixed; inset: 0; pointer-events: none; opacity: 0; z-index: 4;
  background: radial-gradient(circle at center, transparent 45%, rgba(220,20,20,.75) 100%);
}
#dmgdir { position: fixed; left: 50%; top: 50%; }
#dmgdir i {
  position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; transform-origin: 50% 50%;
}
#dmgdir i::before {
  content: ""; position: absolute; left: 50%; top: -60px; margin-left: -18px; width: 36px; height: 14px;
  border-radius: 50% 50% 0 0; border-top: 5px solid rgba(255,50,40,.95);
}
#invuln {
  position: fixed; left: 50%; top: calc(50% + 34px); transform: translateX(-50%);
  color: #8fd0ff; font-weight: 900; font-size: 14px; text-shadow: 0 1px 0 #000;
}
body.invuln #game { box-shadow: inset 0 0 0 4px rgba(90,180,255,.6); }
#game.dead { filter: grayscale(.85) brightness(.75); }
#death {
  position: fixed; left: 50%; top: 30%; transform: translateX(-50%); z-index: 5; text-align: center; pointer-events: none;
  color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.6);
}
#death b { display: block; font-size: 24px; color: #ff7a6a; }
#death span { font-size: 15px; }
#result {
  position: fixed; inset: 0; z-index: 37; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: rgba(8,10,18,.88); color: #e8ecf5; padding: 12px;
}
#result[hidden] { display: none; }
#result h1 { margin: 0; font-size: 40px; font-weight: 900; letter-spacing: 4px; }
#result h1.win { color: #6cbcff; } #result h1.lose { color: #ff7a6a; }
.rs-score { font-size: 26px; font-weight: 900; }
.rs-mvp { color: #ffd23f; font-weight: 700; }
.rs-tables { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.rs-tables table { border-collapse: collapse; font-size: 12.5px; min-width: 200px; background: rgba(42,49,70,.6); border-radius: 8px; }
.rs-tables th, .rs-tables td { padding: 3px 10px; text-align: right; }
.rs-tables th:first-child, .rs-tables td:first-child { text-align: left; }
.rs-tables tr.me td { color: #ffd23f; font-weight: 800; }
.rs-btns { display: flex; gap: 8px; margin-top: 6px; }
.rs-btns button {
  font: inherit; font-size: 15px; font-weight: 900; padding: 9px 26px; border-radius: 999px; border: 0;
  background: #ffb02e; color: #1a1a1a; box-shadow: 0 4px 0 #b36f00;
}
.rs-btns button + button { background: #2a3146; color: #fff; box-shadow: 0 4px 0 #11151f; }

/* 상단 버튼은 아이콘만 (점수판과 겹치지 않게) */
#btn-tune, #btn-map, #btn-char, #btn-modes { width: 40px; padding: 0; font-size: 17px; }
#btn-map { right: calc(56px + env(safe-area-inset-right)); }
#btn-char { right: calc(102px + env(safe-area-inset-right)); }
#btn-modes { right: calc(148px + env(safe-area-inset-right)); }
#btn-fire-left { top: 46%; }

/* ── 커스텀 레이아웃 적용 ──────────── */
.laid {
  position: fixed !important; right: auto !important; bottom: auto !important; margin: 0 !important;
  transform: translate(-50%, -50%) scale(calc(var(--s, 1) * var(--press, 1))) !important;
}
.lay-hidden { display: none !important; }
#btn-jump { right: calc(40px + env(safe-area-inset-right)); bottom: 248px; width: 54px; height: 54px; font-size: 13px; }

/* ── 미니맵 / 소리 방향 / 자막 ─────── */
#minimap { position: fixed; left: calc(8px + env(safe-area-inset-left)); top: 8px; width: 104px; height: 104px; border-radius: 50%; }
#stats { top: 118px; font-size: 10px; }
#soundviz { position: fixed; left: 50%; top: 50%; }
#soundviz i { position: absolute; left: -40px; top: -40px; width: 80px; height: 80px; transform-origin: 50% 50%; opacity: 0; }
#soundviz i::before {
  content: ""; position: absolute; left: 50%; top: -34px; margin-left: -14px; width: 28px; height: 10px;
  border-radius: 50% 50% 0 0; border-top: 3px solid #ffe066;
}
#soundviz i.shot::before { border-top: 5px solid #ff8a2e; width: 36px; margin-left: -18px; top: -44px; }
#voice-sub {
  position: fixed; left: 50%; bottom: 128px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 13px; font-weight: 700; text-shadow: 0 1px 0 #000, 0 0 4px rgba(0,0,0,.6); white-space: nowrap;
}
#voice-sub div { background: rgba(14,17,27,.55); padding: 2px 10px; border-radius: 12px; animation: vsub .2s ease-out; }
#voice-sub b { margin-right: 4px; }
#voice-sub .vs-A b { color: #6cbcff; } #voice-sub .vs-B b { color: #ff7a6a; } #voice-sub .vs-sys b { color: #ffd23f; }
@keyframes vsub { from { transform: translateY(6px); opacity: 0; } }

/* ── 스코어보드 ─────────────────────── */
#scorebar { pointer-events: auto; cursor: pointer; }
#scoreboard { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(8,10,18,.75); color: #e8ecf5; }
#scoreboard[hidden] { display: none; }
#scoreboard .sb-inner { text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
#scoreboard small { opacity: .6; }
.rs-tables tr.dead td { opacity: .45; }

/* ── HUD 편집기 ────────────────────── */
body.editing #hud .btn, body.editing #weapons, body.editing #gun-opts, body.editing #ammo, body.editing #minimap { pointer-events: none; }
#layout-editor { position: fixed; inset: 0; z-index: 45; touch-action: none; }
#layout-editor[hidden] { display: none; }
.le-boxes { position: absolute; inset: 0; background: rgba(8,10,18,.25); }
.le-box {
  position: absolute; border: 2px dashed rgba(255,255,255,.7); border-radius: 10px; display: grid; place-items: center;
  color: #fff; font-size: 11px; font-weight: 800; text-shadow: 0 1px 0 #000; cursor: grab;
}
.le-box span { background: rgba(14,17,27,.7); padding: 1px 6px; border-radius: 6px; pointer-events: none; }
.le-box.on { border: 2px solid #ffb02e; background: rgba(255,176,46,.18); }
.le-box.off { border-color: rgba(255,90,80,.7); background: rgba(255,90,80,.12); }
.le-panel {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(430px, 60vw);
  background: rgba(14,17,27,.94); border: 1px solid #3c4560; border-radius: 12px; padding: 8px 12px; color: #e8ecf5; font-size: 12px;
}
.le-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }
.le-row b { font-size: 14px; margin-right: 4px; }
.le-row button { font: inherit; font-weight: 700; color: #fff; background: #2a3146; border: 1px solid #3c4560; border-radius: 6px; padding: 5px 10px; }
.le-row button.primary { background: #ffb02e; color: #1a1a1a; border-color: #ffb02e; }
.le-hint { opacity: .7; font-size: 11px; }
.le-sel label { display: flex; align-items: center; gap: 4px; }
.le-sel input[type=range] { width: 80px; accent-color: #ffb02e; }
.le-name { color: #ffb02e; font-weight: 800; min-width: 60px; }
.tn-head span { display: flex; gap: 4px; }
.le-panel.at-top { top: 8px; transform: translateX(-50%); }
.le-panel.at-bottom { top: auto; bottom: 8px; transform: translateX(-50%); }

/* ── 병영 (육성·상점·미션) ─────────── */
#btn-lobby {
  position: fixed; right: calc(194px + env(safe-area-inset-right)); top: 8px; height: 34px; width: 40px; padding: 0; font-size: 17px;
  border-radius: 8px; border: 2px solid rgba(255,255,255,.5); background: rgba(20,24,36,.6); color: #fff;
}
#btn-lobby i, .lb-tabs .dot { position: absolute; right: -3px; top: -3px; width: 10px; height: 10px; border-radius: 50%; background: #ff3b3b; border: 2px solid #fff; }
.lb-tabs .dot { position: relative; display: inline-block; right: 0; top: -6px; width: 8px; height: 8px; }
#lobby {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; gap: 6px;
  padding: 8px calc(12px + env(safe-area-inset-right)) 8px calc(12px + env(safe-area-inset-left));
  background: radial-gradient(circle at 50% 30%, #2d3b5e, #0b0d16 80%); color: #e8ecf5; font-size: 12.5px;
}
#lobby[hidden] { display: none; }
#lobby button { font: inherit; color: #fff; background: #2a3146; border: 1px solid #3c4560; border-radius: 8px; padding: 6px 10px; }
#lobby button:disabled { opacity: .4; }
#lobby button.on { border-color: #ffb02e; background: rgba(255,176,46,.18); }
.lb-head { display: flex; align-items: center; gap: 12px; }
.lb-head > b { font-size: 18px; color: #ffb02e; }
.lb-lv { display: flex; align-items: center; gap: 6px; font-weight: 800; }
.lb-xp { display: inline-block; width: 90px; height: 8px; background: rgba(255,255,255,.12); border-radius: 4px; overflow: hidden; }
.lb-xp i, .lb-xp b { display: block; height: 100%; background: linear-gradient(90deg, #6cbcff, #a3e0ff); }
.lb-lv small { opacity: .6; font-weight: 600; }
.lb-cur { font-weight: 800; background: rgba(0,0,0,.3); padding: 3px 10px; border-radius: 999px; }
.lb-head [data-close] { margin-left: auto; }
.lb-tabs { display: flex; gap: 6px; }
.lb-body { flex: 1; min-height: 0; overflow: auto; }
.lb-msg { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #ffb02e; color: #1a1a1a; font-weight: 800; padding: 8px 18px; border-radius: 999px; }
.lb-note { font-size: 11px; opacity: .7; margin: 4px 0; }
.gr { font-weight: 800; font-size: .9em; }
.lb-armory { display: grid; grid-template-columns: 120px 1fr minmax(170px, 210px); gap: 10px; height: 100%; }
.lb-wlist { display: flex; flex-direction: column; gap: 5px; }
.lb-wlist button { text-align: left; border-left: 4px solid !important; display: flex; flex-direction: column; }
.lb-wlist small { opacity: .7; }
.lb-wdetail { overflow: auto; }
.lb-wdetail h2 { margin: 0 0 4px; font-size: 18px; }
.lb-wdetail .enh { color: #ffd23f; font-size: 14px; letter-spacing: 1px; }
.lb-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.lb-actions button:first-child { background: #3d6fd6 !important; }
.lb-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 6px; }
.lb-slot { text-align: left; display: flex; flex-direction: column; gap: 1px; min-height: 42px; }
.lb-slot small { opacity: .6; font-size: 10.5px; }
.lb-slot em { opacity: .5; font-style: normal; }
.lb-slot.locked { opacity: .45; }
.lb-inv { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; background: rgba(0,0,0,.25); border-radius: 8px; padding: 6px; }
.lb-inv button { text-align: left; display: flex; flex-direction: column; }
.lb-inv small { opacity: .7; font-size: 10.5px; }
.lb-stats { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 11.5px; background: rgba(0,0,0,.25); border-radius: 8px; }
.lb-stats td, .lb-stats th { padding: 3px 6px; text-align: right; border-bottom: 1px solid rgba(255,255,255,.06); }
.lb-stats td:first-child { text-align: left; opacity: .8; }
.lb-stats .up { color: #6be38f; font-weight: 800; } .lb-stats .down { color: #ff7a6a; font-weight: 800; }
.lb-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.lb-card { background: rgba(42,49,70,.6); border-radius: 10px; padding: 7px 9px; display: flex; flex-direction: column; gap: 4px; }
.lb-card small { opacity: .7; font-size: 10.5px; }
.lb-card div { display: flex; gap: 4px; flex-wrap: wrap; }
.lb-card.wide { grid-column: 1 / -1; }
.lb-card.crate { background: linear-gradient(90deg, rgba(255,176,46,.22), rgba(42,49,70,.6)); }
.lb-missions { display: flex; flex-direction: column; gap: 6px; max-width: 640px; }
.lb-mission { display: flex; align-items: center; gap: 10px; background: rgba(42,49,70,.6); border-radius: 10px; padding: 7px 10px; }
.lb-mission > div { flex: 1; }
.lb-mission small { opacity: .7; }
.lb-mission.done { opacity: .55; }
.lb-mission.bonus { background: rgba(255,176,46,.15); }
.lb-bar { height: 7px; background: rgba(255,255,255,.1); border-radius: 4px; overflow: hidden; margin: 3px 0; }
.lb-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb02e, #ff6a3d); }
.ms-lobby { margin-left: 10px; font: inherit; font-weight: 800; color: #fff; background: #2a3146; border: 1px solid #3c4560; border-radius: 8px; padding: 4px 12px; }
#toast { position: fixed; left: 50%; top: 58px; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 4px; align-items: center; pointer-events: none; }
#toast div { background: rgba(255,176,46,.95); color: #1a1a1a; font-weight: 800; padding: 6px 14px; border-radius: 999px; animation: vsub .25s ease-out; }
.rs-reward { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; font-weight: 800; }
.rs-reward span { background: rgba(42,49,70,.8); padding: 4px 12px; border-radius: 999px; display: flex; align-items: center; gap: 6px; }
.rs-reward .up { background: #ffb02e; color: #1a1a1a; }

/* ══ 모바일 사용성 ════════════════════════════════════════
   - 터치 대상 최소 44px, 상단은 🗺 + ☰ 두 개만
   - 주소창이 접히는 모바일 브라우저 대응(dvh), 노치 안전 영역
   - 더블탭 확대 방지(touch-action: manipulation) */
#game { height: 100vh; height: 100dvh; }
button { touch-action: manipulation; }
.top-old { display: none !important; }
#btn-menu, #btn-map {
  position: fixed; top: calc(6px + env(safe-area-inset-top)); width: 44px; height: 44px; padding: 0; font-size: 20px;
  border-radius: 10px; border: 2px solid rgba(255,255,255,.55); background: rgba(20,24,36,.65); color: #fff; font-weight: 800;
}
#btn-menu { right: calc(8px + env(safe-area-inset-right)); }
#btn-map { right: calc(58px + env(safe-area-inset-right)); }
#btn-menu i { position: absolute; right: -3px; top: -3px; width: 12px; height: 12px; border-radius: 50%; background: #ff3b3b; border: 2px solid #fff; }
#killfeed { top: calc(56px + env(safe-area-inset-top)); }
#minimap { top: calc(6px + env(safe-area-inset-top)); }

#quickmenu {
  position: fixed; inset: 0; z-index: 42; display: grid; place-items: center; background: rgba(8,10,18,.6);
}
#quickmenu[hidden] { display: none; }
.qm-grid { display: grid; grid-template-columns: repeat(4, minmax(88px, 120px)); gap: 10px; }
.qm-grid button {
  height: 84px; border-radius: 16px; border: 2px solid rgba(255,255,255,.25); background: rgba(30,36,54,.95); color: #fff;
  font-size: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.qm-grid button span { font-size: 13px; font-weight: 800; }
.qm-grid button:active { background: #ffb02e; color: #1a1a1a; }

/* 무기 슬롯 · 모드/조준경 버튼 키우기 */
#weapons { bottom: calc(8px + env(safe-area-inset-bottom)); gap: 5px; }
#weapons button { min-width: 52px; height: 42px; font-size: 14px; border-radius: 10px; }
#gun-opts button { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 16px; }
#ammo { bottom: 60px; }

/* 메뉴 화면: 글씨·버튼 크게, 스크롤은 세로만 */
#tuning, .lb-body, .ms-info, .cs-info, .ms-list, .cs-list, .mv-side { touch-action: pan-y; -webkit-overflow-scrolling: touch; }
#tuning { font-size: 13.5px; width: min(400px, 58vw); }
#tuning button { padding: 8px 12px; }
#tuning input[type=range] { height: 30px; }
.tn-row.bool input { width: 24px; height: 24px; }
#lobby, #modeselect, #charselect { font-size: 13.5px; }
#lobby button { padding: 9px 12px; min-height: 40px; }
.lb-tabs button { flex: 1; font-weight: 800; }
.lb-slots { grid-template-columns: repeat(3, 1fr); }
.lb-slot { min-height: 52px; }
.boost { color: #ffc933; font-size: .85em; }
.ms-list button, .cs-list button { min-height: 48px; }
.ms-row button, .ms-reset, .ms-lobby, .cs-hit { min-height: 38px; }
#mapview button { min-height: 40px; }
.cs-go { min-height: 46px; }
#start-btn { min-height: 52px; }
#install-hint { font-size: 12px; opacity: .85; margin-top: 12px; line-height: 1.5; }
.le-row button { min-height: 38px; }

/* 아주 작은 화면 (가로 640px 이하) */
@media (max-width: 700px) {
  .qm-grid { grid-template-columns: repeat(4, 76px); gap: 8px; }
  .qm-grid button { height: 70px; font-size: 24px; }
  .lb-armory { grid-template-columns: 96px 1fr; }
  .lb-wstats { grid-column: 1 / -1; }
  .cs-body { grid-template-columns: 100px 1fr 1fr; }
  #weapons button { min-width: 46px; padding: 0 6px; }
}

/* 사격 모드·조준경 버튼: 탄약 위 가로 배치 (작은 화면에서 조준 버튼과 겹치지 않게) */
#gun-opts { left: 50%; transform: translateX(-50%); bottom: 104px; flex-direction: row; }
#voice-sub { bottom: 146px; }

/* ── 확대 방지 ─────────────────────────
   double-tap 확대는 touch-action이 auto인 곳에서만 일어남 → 전부 manipulation 이하로.
   게임 화면은 none(핀치 확대까지 차단), 메뉴 스크롤 영역은 pan-y(세로 스크롤만) 유지 */
*, *::before, *::after { touch-action: manipulation; }
html, body, #game, #touch-layer, #hud, #hud *, .btn, #joy-base, #joy-knob, #layout-editor, #layout-editor * { touch-action: none; }
#tuning, .lb-body, .ms-info, .cs-info, .ms-list, .cs-list, .mv-side, #tuning * { touch-action: pan-y; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* 아이폰 설치 안내 */
#ios-guide { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(8,10,18,.85); padding: 12px; color: #e8ecf5; }
#ios-guide[hidden] { display: none; }
.ig-card { max-width: 480px; background: #161b2b; border: 1px solid #3c4560; border-radius: 16px; padding: 14px 18px; }
.ig-card h2 { margin: 0 0 6px; font-size: 18px; color: #ffb02e; }
.ig-card p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.5; opacity: .9; }
.ig-card ol { margin: 0 0 10px; padding-left: 20px; font-size: 14px; line-height: 1.9; }
.ig-icon { display: inline-block; border: 1.5px solid #6cbcff; color: #6cbcff; border-radius: 4px; padding: 0 5px; font-size: 12px; }
.ig-btns { display: flex; gap: 8px; }
.ig-btns button { flex: 1; min-height: 44px; font: inherit; font-weight: 800; border-radius: 10px; border: 0; background: #2a3146; color: #fff; }
.ig-btns button:first-child { background: #ffb02e; color: #1a1a1a; }
#install-hint b { color: #ffd27a; }
.ig-card small { opacity: .65; font-size: 11.5px; }
.ig-inapp { background: rgba(255,90,60,.15); border: 1px solid rgba(255,90,60,.5); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.ig-card { max-height: 92vh; overflow: auto; touch-action: pan-y; }

/* ══ 꾸미기 ══════════════════════════════════════════ */
/* 킬마크 배지: 희귀도별 테두리, 연속 처치 시 나란히 */
#killmark { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); display: flex; gap: 6px; opacity: 0; pointer-events: none; }
#killmark.show { animation: kmfade 1.6s ease-out forwards; }
@keyframes kmfade { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }
.km {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-size: 24px;
  background: radial-gradient(circle at 35% 30%, #3a4260, #11141f); border: 3px solid #c9d1e0; box-shadow: 0 3px 0 rgba(0,0,0,.4);
}
.km.r1 { border-color: #4a9dff; box-shadow: 0 0 10px rgba(74,157,255,.7); }
.km.r2 { border-color: #ffc933; box-shadow: 0 0 14px rgba(255,201,51,.9); background: radial-gradient(circle at 35% 30%, #6a4a10, #1a1206); }
#killmark .km.new { animation: kmpop .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes kmpop { from { transform: scale(2.2) rotate(-20deg); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.fmark { margin-right: 4px; }

/* 프로필 아바타 + 테두리 */
.av {
  position: relative; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--c); font-style: normal; color: #fff; font-size: 11px; font-weight: 900; text-shadow: 0 1px 0 #000;
  border: 2px solid #5c6680; vertical-align: middle; flex: none;
}
.fr-bronze { border-color: #cd7f32; }
.fr-silver { border-color: #d8dde6; box-shadow: 0 0 4px #fff; }
.fr-gold { border-color: #ffc933; box-shadow: 0 0 8px #ffc933; }
.fr-diamond { border-color: #8ff0ff; box-shadow: 0 0 10px #4ad8ff, inset 0 0 6px #b8f6ff; }
.fr-rainbow, .fr-flame, .fr-neon { border-color: transparent; }
.fr-rainbow::before, .fr-flame::before, .fr-neon::before {
  content: ""; position: absolute; inset: -5px; border-radius: 50%; padding: 3px; pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.fr-rainbow::before { background: conic-gradient(#ff5a6a, #ffd23f, #4ee07a, #4aa8ff, #c06aff, #ff5a6a); animation: spin 3s linear infinite; }
.fr-flame::before { background: conic-gradient(#ff3b1a, #ffb02e, #ff6a1a, #ffe066, #ff3b1a); animation: spin 1.2s linear infinite; filter: blur(1px); box-shadow: 0 0 12px #ff6a1a; }
.fr-neon::before { background: conic-gradient(#39ffe0, #ff3bd6, #39ffe0); animation: spin 2s linear infinite, neon 1s ease-in-out infinite alternate; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes neon { from { filter: drop-shadow(0 0 2px #39ffe0); } to { filter: drop-shadow(0 0 8px #ff3bd6); } }
.pf { display: inline-flex; align-items: center; gap: 5px; }
.pf .ttl { color: #ffd27a; font-size: 10px; font-weight: 700; }
.pf-card { display: flex; align-items: center; gap: 10px; text-align: left; }
.pf-card .av { width: 40px; height: 40px; font-size: 18px; border-width: 3px; }
.pf-card div { display: flex; flex-direction: column; line-height: 1.2; }
.pf-card div b { font-size: 16px; }
.pf-card .ttl { color: #ffd27a; font-size: 11.5px; font-weight: 800; }
.pf-card .km { width: 34px; height: 34px; font-size: 18px; }
#result .pf-card { background: rgba(42,49,70,.8); padding: 6px 14px 6px 8px; border-radius: 999px; }
.lb-profile { display: flex !important; align-items: center; gap: 6px; background: transparent !important; border: 0 !important; padding: 0 !important; }
.lb-profile .pf-card .av { width: 34px; height: 34px; font-size: 15px; }
.lb-profile .pf-card .km { display: none; }
.lb-profile > small { opacity: .6; }

/* 꾸미기 탭 */
.lb-style { display: grid; grid-template-columns: 110px 1fr; gap: 10px; height: 100%; }
.lb-cats { display: flex; flex-direction: column; gap: 5px; overflow: auto; }
.lb-items { overflow: auto; }
.lb-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 6px; }
.lb-chips button { min-height: 34px !important; padding: 4px 12px !important; border-radius: 999px !important; }
.lb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 7px; }
.cs-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center;
  background: rgba(42,49,70,.7); border: 2px solid; border-radius: 12px; padding: 8px 6px;
}
.cs-item.on { background: rgba(255,176,46,.18); box-shadow: 0 0 0 2px #ffb02e inset; }
.cs-item.locked { opacity: .82; }
.cs-item b { font-size: 12.5px; }
.cs-item small { font-size: 10.5px; }
.cs-item em { font-style: normal; color: #ffb02e; font-weight: 800; font-size: 12px; min-height: 32px; display: grid; place-items: center; }
.cs-item button { min-height: 32px !important; padding: 4px 10px !important; font-size: 12px; }
.cs-item .lock { opacity: .75; font-size: 10px; line-height: 1.3; }
.sw-img { width: 64px; height: 40px; border-radius: 8px; background-size: 32px; border: 2px solid rgba(255,255,255,.2); image-rendering: pixelated; }
.sw-img.round { width: 40px; border-radius: 50%; }
.sw-icon { font-size: 30px; font-style: normal; line-height: 40px; height: 40px; }
.sw-title { font-style: normal; color: #ffd27a; font-weight: 900; background: rgba(0,0,0,.3); padding: 6px 10px; border-radius: 8px; height: 40px; display: grid; place-items: center; }
.cs-item .av { width: 40px; height: 40px; font-size: 16px; border-width: 3px; margin: 2px 0; }
.anim-pulse { animation: swpulse 1s ease-in-out infinite alternate; }
.anim-hue { animation: swhue 3s linear infinite; }
.anim-scroll { animation: swscroll 4s linear infinite; }
@keyframes swpulse { from { box-shadow: 0 0 2px #39ffe0; } to { box-shadow: 0 0 14px #39ffe0; } }
@keyframes swhue { to { filter: hue-rotate(360deg); } }
@keyframes swscroll { to { background-position: 64px 32px; } }
body.result-open #toast { top: auto; bottom: 16px; }
