/* CUBE CLASH — 모바일 가로 전용 UI */
:root {
  --bg: #0E0B1A;
  --bg2: #17122B;
  --panel: #1D1836;
  --panel2: #271F4C;
  --stroke: #4A3D80;
  --violet: #7C4DFF;
  --violet-d: #4423A8;
  --cyan: #22E6D6;
  --cyan-d: #0E8F87;
  --hot: #FF2E63;
  --hot-d: #A00C33;
  --gold: #FFC531;
  --lime: #A8FF3E;
  --txt: #EDEAFB;
  --dim: #9C93C6;
  --teamA: #3BA9FF;
  --teamB: #FF6B4A;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--txt);
  font-family: system-ui, -apple-system, "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-weight: 800;
  overscroll-behavior: none;
  touch-action: none;
}

input {
  font-family: inherit;
  -webkit-user-select: text;
  user-select: text;
}

.hidden {
  display: none !important;
}

/* ---------- 공용 버튼 ---------- */
.btn {
  border: none;
  border-radius: 14px;
  color: #fff;
  font-family: inherit;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: .3px;
  padding: 11px 18px;
  background: var(--panel2);
  border-bottom: 5px solid #14102A;
  transition: transform .06s, filter .12s;
  touch-action: manipulation;
}

.btn:active {
  transform: translateY(3px);
  border-bottom-width: 2px;
  filter: brightness(1.12);
}

.btn-play {
  background: linear-gradient(#9A6BFF, var(--violet));
  border-bottom-color: var(--violet-d);
  font-size: 20px;
  padding: 15px 46px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}

.btn-cyan {
  background: linear-gradient(#3CF2E3, var(--cyan));
  border-bottom-color: var(--cyan-d);
  color: #04302C;
}

.btn-red {
  background: linear-gradient(#FF5C82, var(--hot));
  border-bottom-color: var(--hot-d);
}

.btn-ghost {
  background: rgba(255, 255, 255, .06);
  border: 2px solid var(--stroke);
  border-bottom: 5px solid #14102A;
  color: var(--txt);
}

.btn-mini {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 11px;
  border-bottom-width: 4px;
}

.chip {
  background: rgba(255, 255, 255, .07);
  border: 2px solid var(--stroke);
  color: var(--txt);
  font-family: inherit;
  font-weight: 800;
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 999px;
}

input[type=text],
input[type=password],
input:not([type]) {
  width: 100%;
  background: #100D22;
  border: 2px solid var(--stroke);
  border-radius: 12px;
  color: var(--txt);
  font-weight: 800;
  font-size: 15px;
  padding: 11px 14px;
  outline: none;
}

input::placeholder {
  color: #6A5F99;
}

input:focus {
  border-color: var(--violet);
}

.seg {
  display: flex;
  gap: 6px;
}

.seg button {
  flex: 1;
  background: #100D22;
  border: 2px solid var(--stroke);
  color: var(--dim);
  font-family: inherit;
  font-weight: 900;
  font-size: 13px;
  padding: 9px 4px;
  border-radius: 11px;
}

.seg button.on {
  background: var(--violet);
  border-color: #A98BFF;
  color: #fff;
}

.seg.small button {
  font-size: 12px;
  padding: 7px 2px;
}

/* ---------- 화면 전환 ---------- */
.screen {
  position: fixed;
  inset: 0;
  display: none;
}

.screen.show {
  display: block;
}

/* ---------- 세로 경고 ---------- */
#rotate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--bg);
  text-align: center;
  padding: 20px;
}

.rot-icon {
  font-size: 62px;
  animation: rot 1.8s ease-in-out infinite;
}

@keyframes rot {

  0%,
  40% {
    transform: rotate(0)
  }

  60%,
  100% {
    transform: rotate(90deg)
  }
}

.rot-t {
  font-size: 20px;
}

.rot-s {
  font-size: 13px;
  color: var(--dim);
}

@media (orientation:portrait) {
  #rotate {
    display: flex;
  }
}

/* ================= 메인 메뉴 ================= */
#menu {
  background: radial-gradient(120% 90% at 50% 0%, #2A1F5C 0%, var(--bg) 60%);
}

.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, #fff6, transparent),
    radial-gradient(1.5px 1.5px at 70% 20%, #fff5, transparent),
    radial-gradient(2px 2px at 40% 70%, #fff4, transparent),
    radial-gradient(1.5px 1.5px at 85% 60%, #fff5, transparent),
    radial-gradient(1.5px 1.5px at 12% 80%, #fff4, transparent);
  pointer-events: none;
}

.menu-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;                 /* menu-grid 위 — 전체화면/랭킹 버튼이 눌리도록 */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
  pointer-events: none;      /* 빈 영역은 통과, 버튼만 클릭 */
}

.menu-top > * { pointer-events: auto; }

.coin-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, .07);
  border: 2px solid var(--gold);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 13px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.coin-chip em { font-style: normal; }

.logo {
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -1px;
  color: #fff;
  text-shadow: 0 3px 0 var(--violet-d), 0 0 22px rgba(124, 77, 255, .7);
}

.logo span {
  color: var(--cyan);
  text-shadow: 0 3px 0 #06514C, 0 0 22px rgba(34, 230, 214, .6);
  margin-left: 5px;
}

.menu-top-r {
  display: flex;
  gap: 8px;
}

/* 3열 레이아웃: 왼쪽 캐릭터/XP · 가운데 닉네임/시작 · 오른쪽 무기가방/방만들기 */
.menu-grid {
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  gap: 12px;
  padding: 8px 16px 14px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(52px, calc(env(safe-area-inset-right) + 52px));  /* 로그인 탭 공간 */
  overflow: hidden;
}

.mg-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
  min-height: 0;
}

.mg-col > * { max-width: 100%; }

.mg-center { gap: 10px; }

.code-join {
  display: flex;
  gap: 6px;
  width: 100%;
  max-width: 260px;
}

.code-join input {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 13px;
  padding: 8px 10px;
}

.mg-center .map-seg { width: 100%; max-width: 260px; }
.mg-center .nick-row { max-width: 260px; }
.mg-center .btn-play { width: 100%; max-width: 260px; }

/* 메인의 맵 선택은 이름만 (설명 숨겨 세로 공간 절약) */
#quickMap .map-card { padding: 7px 9px; text-align: center; }
#quickMap .map-card span { display: none; }
#quickMap .map-card b { font-size: 12px; }

.big-tile {
  width: 100%;
  max-width: 220px;
  background: linear-gradient(#241C48, #171130);
  border: 2px solid var(--stroke);
  border-bottom: 5px solid #14102A;
  border-radius: 16px;
  color: var(--txt);
  font-family: inherit;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: inset 0 0 22px rgba(124, 77, 255, .12);
}

.big-tile:active {
  transform: translateY(3px);
  border-bottom-width: 2px;
  border-color: var(--violet);
}

.big-tile em { font-style: normal; font-size: 28px; line-height: 1.1; }
.big-tile b { font-size: 15px; }
.big-tile span { font-size: 10px; color: var(--dim); font-weight: 700; }

.skin-stage {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.skin-view {
  width: 132px;
  height: 132px;
  border-radius: 20px;
  background: linear-gradient(#241C48, #171130);
  border: 2px solid var(--stroke);
  box-shadow: inset 0 0 30px #0007;
}

#skinCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.skin-arrow {
  width: 36px;
  height: 46px;
  border-radius: 12px;
  border: 2px solid var(--stroke);
  background: #1B1533;
  color: var(--txt);
  font-size: 22px;
  font-weight: 900;
}

.skin-name {
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--violet);
  border-radius: 999px;
  font-size: 11px;
  padding: 3px 12px;
  white-space: nowrap;
  box-shadow: 0 3px 0 var(--violet-d);
}

.nick-row {
  position: relative;
  width: 100%;
  max-width: 220px;
}

#nick {
  text-align: center;
  font-size: 17px;
  padding-right: 62px;
}

.nick-tag {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--dim);
  background: #0A0817;
  padding: 4px 8px;
  border-radius: 8px;
}

.menu-sub {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.menu-sub .btn {
  font-size: 13px;
  padding: 9px 14px;
}

/* 로그인 탭 */
#loginTab {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  padding: 16px 0;
  border: none;
  border-radius: 16px 0 0 16px;
  background: linear-gradient(#9A6BFF, var(--violet));
  color: #fff;
  font-family: inherit;
  font-weight: 900;
  font-size: 13px;
  line-height: 1.25;
  box-shadow: -4px 0 16px #0008;
  z-index: 20;
}

#loginTab:active {
  filter: brightness(1.15);
}

/* 슬라이드 패널 */
#panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 78%);
  background: linear-gradient(180deg, #221B44, #14102A);
  border-left: 3px solid var(--violet);
  box-shadow: -18px 0 40px #000A;
  transform: translateX(101%);
  transition: transform .28s cubic-bezier(.3, .9, .3, 1);
  z-index: 30;
  display: flex;
  flex-direction: column;
  padding-right: env(safe-area-inset-right);
}

#panel.open {
  transform: translateX(0);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 2px solid #0007;
}

.panel-tabs {
  display: flex;
  gap: 6px;
}

.ptab {
  background: transparent;
  border: none;
  color: var(--dim);
  font-family: inherit;
  font-weight: 900;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 10px;
}

.ptab.on {
  background: var(--violet);
  color: #fff;
}

.panel-x {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 2px solid var(--stroke);
  background: #1B1533;
  color: var(--txt);
  font-size: 15px;
  font-weight: 900;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.ptabpage {
  display: none;
  flex-direction: column;
  gap: 9px;
}

.ptabpage.on {
  display: flex;
}

.hint {
  font-size: 12px;
  color: var(--dim);
  font-weight: 700;
  line-height: 1.5;
}

.row2 {
  display: flex;
  gap: 8px;
}

.row2 .btn {
  flex: 1;
}

.err {
  color: var(--hot);
  font-size: 12px;
  min-height: 15px;
}

.me-card {
  background: #100D22;
  border: 2px solid var(--stroke);
  border-radius: 14px;
  padding: 12px;
}

.me-name {
  font-size: 19px;
  color: var(--cyan);
  margin-bottom: 8px;
}

.me-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  text-align: center;
}

.me-stats b {
  display: block;
  font-size: 17px;
}

.me-stats span {
  font-size: 10px;
  color: var(--dim);
}

/* 방 목록 */
.search-row {
  display: flex;
  gap: 6px;
}

.room-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 40px;
}

.room-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #100D22;
  border: 2px solid var(--stroke);
  border-radius: 12px;
  padding: 9px 10px;
}

.room-item .ri-n {
  flex: 1;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-item .ri-m {
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 7px;
  background: var(--panel2);
  color: var(--dim);
}

.room-item .ri-m.hc {
  background: var(--hot-d);
  color: #FFD9E2;
}

.room-item .ri-c {
  font-size: 12px;
  color: var(--cyan);
}

.room-empty {
  text-align: center;
  color: var(--dim);
  font-size: 12px;
  padding: 14px 0;
}

.make-room {
  margin-top: 6px;
  background: #100D22;
  border: 2px dashed var(--stroke);
  border-radius: 14px;
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mr-title {
  font-size: 13px;
  color: var(--gold);
}

.chk {
  font-size: 12px;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 7px;
}

.chk input {
  width: 17px;
  height: 17px;
  accent-color: var(--violet);
}

.rank-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.rank-row {
  display: flex;
  gap: 9px;
  align-items: center;
  background: #100D22;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
}

.rank-row i {
  width: 22px;
  color: var(--gold);
  font-style: normal;
}

.rank-row span {
  flex: 1;
}

.rank-row b {
  color: var(--cyan);
}

/* ================= 무기 선택 ================= */
#loadout {
  background: var(--bg2);
  display: none;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  padding: 8px 12px 10px;
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
}

#loadout.show {
  display: grid;
}

.ld-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ld-title {
  font-size: 16px;
  flex: 1;
}

.ld-slots {
  display: flex;
  gap: 6px;
}

.ld-slot {
  width: 60px;
  height: 40px;
  border-radius: 10px;
  border: 2px dashed var(--stroke);
  background: #100D22;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--dim);
}

.ld-slot.f {
  border-style: solid;
  border-color: var(--violet);
  color: #fff;
}

.ld-slot em {
  font-style: normal;
  font-size: 16px;
}

/* 무기 선택: 왼쪽 목록 · 오른쪽 3D 렌더 + 설명 */
.ld-body {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 10px;
  margin: 8px 0 0;
  min-height: 0;
  overflow: hidden;
}

.ld-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding-right: 5px;
  min-height: 0;
}

.wrow {
  display: flex;
  align-items: center;
  gap: 9px;
  background: linear-gradient(90deg, #241C48, #171130);
  border: 2px solid var(--stroke);
  border-radius: 11px;
  padding: 8px 10px;
  flex-shrink: 0;
  position: relative;
}

.wrow.sel { border-color: var(--violet); background: linear-gradient(90deg, #2E2358, #1B1436); }
.wrow.on { border-color: var(--cyan); }
.wrow .wi { font-style: normal; font-size: 20px; }
.wrow .wn { flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wrow .wt { font-size: 10px; color: var(--dim); }

.wrow .pickdot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-style: normal;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  color: transparent;
}

.wrow .pickdot.f { background: var(--cyan); color: #04302C; }

/* 왼쪽 열: 무기 목록(스크롤) + 그 아래 스킨/키링 */
.ld-left {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
}

.ld-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.ld-view {
  position: relative;
  flex: 1 1 auto;
  min-height: 110px;
  background: radial-gradient(70% 90% at 50% 40%, #2A2158, #120F26);
  border: 2px solid var(--stroke);
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
}

#gunCanvas { width: 100%; height: 100%; display: block; }

.ld-view-name {
  position: absolute;
  left: 10px;
  bottom: 8px;
  font-size: 13px;
  color: var(--cyan);
  text-shadow: 0 2px 4px #000;
}

/* 스킨 · 키링 선택 (왼쪽 열 아래) */
.ld-cos {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
  background: #100D22;
  border: 2px solid var(--stroke);
  border-radius: 12px;
  padding: 7px 8px;
}

.cos-row { display: flex; align-items: center; gap: 7px; }
.cos-t { font-size: 11px; color: var(--gold); width: 52px; flex-shrink: 0; }

.cos-list {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  touch-action: pan-x;
  padding-bottom: 2px;
}

.cos-chip {
  flex: 0 0 auto;
  background: #100D22;
  border: 2px solid var(--stroke);
  color: var(--txt);
  font-family: inherit;
  font-weight: 800;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
}

.cos-chip.on { border-color: var(--cyan); color: var(--cyan); }
.cos-chip.lock { opacity: .45; }

.wcard {
  background: linear-gradient(#241C48, #171130);
  border: 2px solid var(--stroke);
  border-radius: 13px;
  padding: 7px 4px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.wcard.on {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(34, 230, 214, .25) inset;
}

.wcard .wi {
  font-size: 21px;
}

.wcard .wn {
  font-size: 11px;
  margin-top: 1px;
}

.wcard .wt {
  font-size: 9px;
  color: var(--dim);
}

.wcard .pick {
  position: absolute;
  top: 3px;
  right: 4px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--cyan);
  color: #04302C;
  font-size: 11px;
  line-height: 17px;
}

.ld-detail {
  background: #100D22;
  border: 2px solid var(--stroke);
  border-radius: 13px;
  padding: 9px 12px;
  min-height: 96px;
  font-size: 12px;
}

.ld-d-empty {
  color: var(--dim);
  text-align: center;
  padding-top: 26px;
}

.dd-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.dd-head b {
  font-size: 16px;
}

.dd-head span {
  font-size: 11px;
  color: var(--dim);
}

.dd-cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr;
  gap: 12px;
}

.dd-cols ul {
  list-style: none;
  font-weight: 700;
  line-height: 1.55;
}

.dd-cols .good li::before {
  content: "＋ ";
  color: var(--lime);
}

.dd-cols .bad li::before {
  content: "－ ";
  color: var(--hot);
}

.dd-stats div {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  color: var(--dim);
}

.dd-stats div b {
  color: var(--txt);
}

.dd-tip {
  margin-top: 5px;
  font-size: 11px;
  color: var(--gold);
  font-weight: 700;
}

.ld-ok {
  padding: 10px 26px;
  font-size: 16px;
}

.ld-detail {
  flex: 0 0 auto;
  max-height: 52%;
  overflow-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

/* ================= 로비 ================= */
#lobby {
  background: var(--bg2);
  display: none;
  grid-template-rows: auto 1fr;
  padding: 8px 12px 12px;
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
}

#lobby.show {
  display: grid;
}

.lb-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lb-title {
  flex: 1;
  font-size: 17px;
}

.lb-title small {
  font-size: 11px;
  color: var(--dim);
  margin-left: 8px;
}

.lb-code {
  font-size: 11px;
  color: var(--dim);
}

.lb-code b {
  color: var(--cyan);
}

.lb-body {
  display: grid;
  grid-template-columns: 1fr 210px;
  gap: 12px;
  margin-top: 8px;
  min-height: 0;
}

.lb-teams {
  display: grid;
  gap: 8px;
  overflow-y: auto;
  touch-action: pan-y;
}

.team-col {
  background: #100D22;
  border: 2px solid var(--stroke);
  border-radius: 14px;
  padding: 9px;
}

.team-col.A {
  border-color: var(--teamA);
}

.team-col.B {
  border-color: var(--teamB);
}

.tc-h {
  font-size: 13px;
  margin-bottom: 7px;
  display: flex;
  justify-content: space-between;
}

.plr {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1A1436;
  border-radius: 10px;
  padding: 7px 9px;
  margin-bottom: 5px;
  font-size: 13px;
}

.plr .pdot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
}

.plr .pn {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plr .host {
  font-size: 9px;
  background: var(--gold);
  color: #3A2A00;
  padding: 2px 6px;
  border-radius: 6px;
}

.plr .swp {
  font-size: 10px;
  background: var(--panel2);
  border: none;
  color: var(--txt);
  font-family: inherit;
  font-weight: 900;
  padding: 4px 7px;
  border-radius: 7px;
}

.lb-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.lb-my {
  background: #100D22;
  border: 2px solid var(--stroke);
  border-radius: 14px;
  padding: 9px;
  display: flex;
  gap: 6px;
  justify-content: space-around;
}

.lb-my .m {
  text-align: center;
  font-size: 10px;
  color: var(--dim);
}

.lb-my .m em {
  display: block;
  font-size: 20px;
  font-style: normal;
}

.lb-hint {
  font-size: 11px;
  color: var(--dim);
  text-align: center;
}

.lb-bots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  background: #100D22;
  border: 2px dashed var(--stroke);
  border-radius: 12px;
  padding: 8px;
}

.lb-bots-t {
  width: 100%;
  font-size: 12px;
  color: var(--cyan);
}

/* ================= 게임 ================= */
#game {
  background: #000;
}

#c3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#cross {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

#cross .ch {
  position: absolute;
  background: #fff;
  box-shadow: 0 0 3px #000;
  opacity: .9;
  transition: all .08s;
}

#cross .t,
#cross .b {
  width: 2px;
  height: 7px;
  left: 19px;
}

#cross .l,
#cross .r {
  height: 2px;
  width: 7px;
  top: 19px;
}

#cross .t {
  top: calc(20px - var(--sp, 9px) - 7px);
}

#cross .b {
  top: calc(20px + var(--sp, 9px));
}

#cross .l {
  left: calc(20px - var(--sp, 9px) - 7px);
}

#cross .r {
  left: calc(20px + var(--sp, 9px));
}

#cross .dot {
  position: absolute;
  left: 19px;
  top: 19px;
  width: 2px;
  height: 2px;
  background: #fff;
  border-radius: 50%;
}

#cross.hit .ch {
  background: var(--hot);
}

#hitmark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
}

#hitmark i {
  position: absolute;
  width: 10px;
  height: 2.5px;
  background: #fff;
  box-shadow: 0 0 4px #000;
}

#hitmark i:nth-child(1) {
  top: 4px;
  left: 2px;
  transform: rotate(45deg);
}

#hitmark i:nth-child(2) {
  top: 4px;
  right: 2px;
  transform: rotate(-45deg);
}

#hitmark i:nth-child(3) {
  bottom: 4px;
  left: 2px;
  transform: rotate(-45deg);
}

#hitmark i:nth-child(4) {
  bottom: 4px;
  right: 2px;
  transform: rotate(45deg);
}

#hitmark.on {
  animation: hm .22s ease-out;
}

#hitmark.kill i {
  background: var(--hot);
}

@keyframes hm {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(.6)
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.35)
  }
}

#scopeOverlay {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 24%, #000 26%);
}

#scopeOverlay.on {
  display: block;
}

.sc-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46vh;
  height: 46vh;
  transform: translate(-50%, -50%);
  border: 2px solid #0009;
  border-radius: 50%;
}

.sc-h {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: #000;
}

.sc-v {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: #000;
}

#dmgVig {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 50%, transparent 45%, rgba(255, 20, 60, .75) 100%);
  transition: opacity .25s;
}

#hitDirs {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* 이온캐논 충전 화면 글로우 (1인칭) */
#ionVig {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 8;
  background: radial-gradient(circle at 50% 50%, rgba(34, 230, 214, .12) 0%, transparent 40%, rgba(34, 230, 214, .5) 100%);
  transition: opacity .1s;
  animation: ionPulse 1.1s ease-in-out infinite;
}

@keyframes ionPulse {
  50% { filter: brightness(1.5); }
}

.hdir {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-bottom: 26px solid rgba(255, 46, 99, .85);
  transform-origin: 50% 108px;
  animation: hd 1.1s forwards;
}

@keyframes hd {
  0% {
    opacity: 1
  }

  100% {
    opacity: 0
  }
}

/* 상단 좌 */
#topLeft {
  z-index: 30;
  position: absolute;
  top: 8px;
  left: max(10px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

#scoreBar {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #0B0818CC;
  border: 2px solid var(--stroke);
  border-radius: 12px;
  padding: 5px 12px;
  font-size: 17px;
}

#scoreBar .sA {
  color: var(--teamA);
}

#scoreBar .sB {
  color: var(--teamB);
}

#scoreBar .stime {
  font-size: 12px;
  color: var(--dim);
}

#alivePill {
  background: #0B0818CC;
  border: 2px solid var(--hot);
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 12px;
  align-self: flex-start;
}

#killfeed {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kf {
  background: #0B0818D9;
  border-radius: 9px;
  padding: 4px 9px;
  font-size: 11px;
  animation: kfin .2s;
}

.kf b {
  color: var(--cyan);
}

.kf i {
  font-style: normal;
  color: var(--dim);
  margin: 0 5px;
}

.kf .v {
  color: var(--hot);
}

.kf .hs {
  color: var(--gold);
}

@keyframes kfin {
  from {
    transform: translateX(-14px);
    opacity: 0
  }
}

/* 상단 우 */
#topRight {
  z-index: 30;
  position: absolute;
  top: 8px;
  right: max(10px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: none;      /* 체력바·탄약 위를 드래그해도 시선이 돌아가도록 통과 */
}

.tr-bar {
  display: flex;
  gap: 6px;
  pointer-events: none;      /* 버튼 사이 간격으로도 시선이 돌아가게 */
}

.tr-bar .ib { pointer-events: auto; }   /* 실제 버튼만 클릭 */

.ib {
  width: 46px;
  height: 40px;
  border-radius: 10px;
  border: 2px solid var(--stroke);
  background: #0B0818CC;
  color: var(--txt);
  font-size: 15px;
}

.ib:active {
  background: var(--violet);
}

.hpwrap {
  display: flex;
  align-items: center;
  gap: 7px;
}

.hpbar {
  position: relative;
  width: 132px;
  height: 15px;
  background: #0B0818;
  border: 2px solid var(--stroke);
  border-radius: 999px;
  overflow: hidden;
}

.hpbar i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 999px;
}

#hpFill {
  width: 100%;
  background: linear-gradient(var(--lime), #4FA61A);
  z-index: 2;
  transition: width .12s;
}

#hpLag {
  width: 100%;
  background: var(--hot);
  z-index: 1;
  transition: width .5s .18s;
}

.hpbar.low #hpFill {
  background: linear-gradient(#FF7C7C, var(--hot));
}

.hpnum {
  font-size: 16px;
  min-width: 42px;
}

.hpnum small {
  font-size: 9px;
  color: var(--dim);
  margin-left: 2px;
}

/* 파란 보호막 (클래시업) — HP 바 바로 아래 */
.shieldwrap {
  display: flex;
  align-items: center;
  gap: 7px;
}

.shbar {
  position: relative;
  width: 132px;
  height: 9px;
  background: #0B0818;
  border: 2px solid #2A5B8A;
  border-radius: 999px;
  overflow: hidden;
}

#shFill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(#8FD4FF, #3BA9FF);
  box-shadow: 0 0 8px rgba(59, 169, 255, .8);
  border-radius: 999px;
  transition: width .12s;
}

.shnum {
  font-size: 13px;
  min-width: 42px;
  color: #8FD4FF;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(59, 169, 255, .5);
}

.ammo {
  background: #0B0818CC;
  border: 2px solid var(--stroke);
  border-radius: 11px;
  padding: 4px 11px;
  text-align: right;
}

.ammo b {
  font-size: 21px;
}

.ammo span {
  font-size: 12px;
  color: var(--dim);
}

.ammo.empty b {
  color: var(--hot);
}

.wname {
  font-size: 10px;
  color: var(--cyan);
}

/* 채팅 — 왼쪽 하단에 쌓이고, 입력창은 화면 상단 중앙 바(모바일 키보드에 가리지 않게) */
#chatBox {
  z-index: 32;
  position: absolute;
  left: max(10px, env(safe-area-inset-left));
  bottom: 42%;
  width: min(260px, 42vw);
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
}

#chatLog {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  max-height: 118px;
  overflow: hidden;
}

.cm {
  background: linear-gradient(90deg, #0B0818E6, #0B0818B0);
  border-left: 2px solid var(--cyan);
  border-radius: 4px 9px 9px 4px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 700;
  max-width: 100%;
  word-break: break-word;
  line-height: 1.35;
  animation: kfin .2s;
}

.cm b {
  color: var(--cyan);
  margin-right: 5px;
}

.cm.sys {
  color: var(--dim);
  font-style: italic;
  border-left-color: var(--stroke);
}

.cm.A {
  border-left-color: var(--teamA);
}

.cm.A b {
  color: var(--teamA);
}

.cm.B {
  border-left-color: var(--teamB);
}

.cm.B b {
  color: var(--teamB);
}

/* 입력 바: 열리면 화면 상단 중앙에 고정 */
#chatInputRow {
  position: fixed;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  width: min(440px, 88vw);
  display: flex;
  gap: 6px;
  pointer-events: auto;
  z-index: 60;
  background: #0B0818F2;
  border: 2px solid var(--cyan);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 0 20px rgba(34, 230, 214, .3);
}

#chatInput {
  flex: 1;
  font-size: 14px;
  padding: 8px 12px;
}

/* 무기 가방 */
#bagPop {
  z-index: 40;
  position: absolute;
  right: max(10px, env(safe-area-inset-right));
  top: 50px;
  bottom: 14px;                /* top+bottom = 확정 높이 → 내부 리스트가 제대로 스크롤됨 */
  width: 288px;
  background: #16112BF2;
  border: 2px solid var(--violet);
  border-radius: 15px;
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.bag-t {
  font-size: 13px;
  margin-bottom: 7px;
  color: var(--gold);
  flex-shrink: 0;
}

#bagList {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

/* 스크롤 가능한 영역엔 얇은 네온 스크롤바를 보이게 */
#bagList, .ld-grid, .ld-detail, .panel-body, .admin-body, .bp-track, #missionList, #shopList {
  scrollbar-width: thin;
  scrollbar-color: var(--violet) transparent;
}
#bagList::-webkit-scrollbar, .ld-grid::-webkit-scrollbar, .ld-detail::-webkit-scrollbar,
.panel-body::-webkit-scrollbar, .admin-body::-webkit-scrollbar, .bp-track::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
#bagList::-webkit-scrollbar-thumb, .ld-grid::-webkit-scrollbar-thumb, .ld-detail::-webkit-scrollbar-thumb,
.panel-body::-webkit-scrollbar-thumb, .admin-body::-webkit-scrollbar-thumb, .bp-track::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--violet), var(--cyan));
  border-radius: 999px;
}
#bagList::-webkit-scrollbar-track, .ld-grid::-webkit-scrollbar-track, .panel-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .05);
  border-radius: 999px;
}

.bag-item.own { border-color: var(--violet); }
.bag-item.own .ba { color: var(--lime); }

.bag-item {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #100D22;
  border: 2px solid var(--stroke);
  border-radius: 11px;
  padding: 7px 9px;
  margin-bottom: 5px;
  flex-shrink: 0;      /* 절대 위아래로 찌그러지지 않게 */
  min-height: 38px;
}

.bag-item .bn {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bag-item.on {
  border-color: var(--cyan);
}

.bag-item em {
  font-style: normal;
  font-size: 19px;
}

.bag-item .bn {
  flex: 1;
  font-size: 13px;
}

.bag-item .ba {
  font-size: 11px;
  color: var(--dim);
}

.bag-hint {
  font-size: 10px;
  color: var(--dim);
  text-align: center;
  flex-shrink: 0;
  margin-top: 6px;
}

/* 일시 메뉴 */
#pausePop,
#resultPop {
  position: absolute;
  inset: 0;
  background: #060411D9;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.pp,
.res {
  background: linear-gradient(#221B44, #14102A);
  border: 2px solid var(--violet);
  border-radius: 18px;
  padding: 16px 18px;
  width: min(400px, 86%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pp-t,
.res-t {
  font-size: 18px;
  text-align: center;
}

.pp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.pp-row input[type=range] {
  flex: 1;
  accent-color: var(--violet);
}

.pp-row input[type=checkbox] {
  width: 20px;
  height: 20px;
  accent-color: var(--cyan);
}

.pp-row .seg {
  flex: 1;
}

.res-tb {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  max-height: 40vh;
  display: block;
  overflow-y: auto;
}

.res-tb td,
.res-tb th {
  padding: 5px 6px;
  text-align: left;
}

.res-tb tr:nth-child(odd) {
  background: #ffffff08;
}

.res-tb .me {
  color: var(--cyan);
}

/* 사망 */
#deadPop {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #12000699;
  z-index: 45;
  pointer-events: none;
}

.dead-t {
  font-size: 30px;
  color: var(--hot);
  text-shadow: 0 3px 0 #000;
}

.dead-s {
  font-size: 15px;
}

.dead-by {
  font-size: 12px;
  color: var(--dim);
}

/* ---------- 조작 ---------- */
#controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

#stickZone {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 42%;
  height: 58%;
  pointer-events: auto;
}

#lookZone {
  position: absolute;
  right: 0;
  top: 0;                 /* 화면 최상단까지 — 위쪽 여백에서도 시선 회전. 버튼은 위(z30)라 그대로 눌림 */
  bottom: 0;
  width: 62%;
  pointer-events: auto;
}

#stickBase {
  position: absolute;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  border: 3px solid #ffffff2E;
  background: #0B081855;
  left: 74px;
  bottom: 74px;
  transform: translate(-50%, 50%);
  opacity: .55;
  transition: opacity .15s;
  pointer-events: none;
}

#stickBase.act {
  opacity: 1;
}

#stickKnob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: #EDEAFBCC;
  border: 3px solid #7C4DFF;
  box-shadow: 0 3px 10px #0009;
}

.rb,
.fire-l {
  position: absolute;
  pointer-events: auto;
  border: none;
  color: #fff;
  font-family: inherit;
  font-weight: 900;
  border-radius: 50%;
  background: #1D1836D9;
  border: 3px solid #ffffff33;
  box-shadow: 0 4px 0 #0007;
  touch-action: none;
}

.rb:active,
.fire-l:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #0007;
  filter: brightness(1.3);
}

.fire-l {
  left: max(20px, env(safe-area-inset-left));
  bottom: 46%;
  width: 68px;
  height: 68px;
  font-size: 12px;
  background: radial-gradient(#FF6B87, var(--hot));
  border-color: #FFB3C2;
  opacity: .92;
}

/* 오른손 조작 클러스터 — FIRE/점프는 크게, 보조 버튼은 작고 은은하게 */
.right-pad {
  position: absolute;
  right: max(10px, env(safe-area-inset-right));
  bottom: 10px;
  width: 286px;
  height: 216px;
  pointer-events: none;
}

/* 주 버튼: FIRE */
.rb.fire {
  right: 6px;
  bottom: 6px;
  width: 108px;
  height: 108px;
  font-size: 17px;
  letter-spacing: 1px;
  background: radial-gradient(circle at 50% 38%, #FF6B87, var(--hot) 70%);
  border-color: #FFB3C2;
  box-shadow: 0 5px 0 #0007, 0 0 22px rgba(255, 46, 99, .55);
}

/* 주 버튼: 점프 */
.rb.jump {
  right: 128px;
  bottom: 14px;
  width: 88px;
  height: 88px;
  font-size: 15px;
  background: radial-gradient(circle at 50% 38%, #8FE3FF, #1FA6E8 72%);
  border-color: #BDEBFF;
  box-shadow: 0 5px 0 #0007, 0 0 18px rgba(34, 170, 232, .5);
}

/* 보조 버튼 공통(작게, 반투명) */
.rb.slide,
.rb.ads,
.rb.reload,
.rb.build {
  width: 56px;
  height: 56px;
  font-size: 11px;
  opacity: .9;
}

.rb.ads {
  right: 26px;
  bottom: 126px;
}

.rb.ads.on {
  background: var(--cyan);
  color: #04302C;
  box-shadow: 0 3px 0 #0007, 0 0 14px rgba(34, 230, 214, .6);
}

.rb.slide {
  right: 132px;
  bottom: 118px;
  background: radial-gradient(#C6A6FF, #7C4DFF);
  border-color: #D9C6FF;
}

.rb.slide.on {
  background: radial-gradient(#FFE08A, #FFC531);
  color: #3A2A00;
}

.rb.reload {
  right: 90px;
  bottom: 168px;
}

.rb.reload.need {
  animation: rblink .7s infinite;
}

@keyframes rblink {
  50% {
    background: var(--gold);
    color: #3A2A00;
    box-shadow: 0 3px 0 #0007, 0 0 16px var(--gold);
  }
}

.rb.build {
  right: 202px;
  bottom: 150px;
}

.rb.build.on {
  background: var(--lime);
  color: #16300A;
}

#slots {
  position: absolute;
  left: calc(50% - 40px);
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  pointer-events: none;      /* 슬롯 사이 간격으로도 시선이 돌아가게 */
}

.slot { pointer-events: auto; }

.slot {
  width: 62px;
  height: 42px;
  border-radius: 11px;
  background: #0B0818CC;
  border: 2px solid var(--stroke);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--dim);
}

.slot em {
  font-style: normal;
  font-size: 16px;
}

.slot.on {
  border-color: var(--cyan);
  background: #16224AE6;
  color: #fff;
}

.slot.empty {
  opacity: .35;
}

#buildHint {
  position: absolute;
  left: 50%;
  top: 12%;
  transform: translateX(-50%);
  background: #0B0818CC;
  border: 2px solid var(--lime);
  border-radius: 10px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--lime);
}

#toast {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  background: #0B0818E6;
  border: 2px solid var(--gold);
  color: var(--gold);
  border-radius: 11px;
  padding: 7px 15px;
  font-size: 13px;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}

#toast.on {
  opacity: 1;
}

/* 로딩 */
#loading {
  position: fixed;
  inset: 0;
  background: #060411EE;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 999;
}

.ld-spin {
  width: 42px;
  height: 42px;
  border: 5px solid #ffffff22;
  border-top-color: var(--violet);
  border-radius: 50%;
  animation: sp .8s linear infinite;
}

@keyframes sp {
  to {
    transform: rotate(360deg)
  }
}

/* 낮은 화면(가로 폰): 메인 메뉴 세로 압축 */
@media (max-height:430px) {
  .menu-grid { top: 48px; gap: 8px; padding-top: 4px; }
  .mg-col { gap: 8px; }
  .skin-view { width: 104px; height: 104px; }
  .lvl-badge { width: 40px; height: 34px; }
  .lvl-badge b { font-size: 15px; }
  #nick { font-size: 15px; padding-top: 9px; padding-bottom: 9px; }
  .mg-center .btn-play { font-size: 17px; padding: 11px 20px; }
  .big-tile { padding: 10px 8px; }
  .big-tile em { font-size: 22px; }
  .big-tile b { font-size: 13px; }
}

/* 작은 화면 대응 */
@media (max-height:400px) {
  .skin-view {
    width: 96px;
    height: 96px;
  }

  .btn-play {
    font-size: 17px;
    padding: 12px 34px;
  }

  .right-pad {
    width: 250px;
    height: 190px;
  }

  .rb.fire {
    width: 92px;
    height: 92px;
  }

  .rb.jump {
    width: 74px;
    height: 74px;
    right: 108px;
  }

  .rb.slide,
  .rb.ads,
  .rb.reload,
  .rb.build {
    width: 50px;
    height: 50px;
  }

  .rb.ads { right: 22px; bottom: 108px; }
  .rb.slide { right: 116px; bottom: 104px; }
  .rb.reload { right: 78px; bottom: 148px; }
  .rb.build { right: 178px; bottom: 132px; }
}


/* ---------- 맵 선택 ---------- */
.map-seg {
  display: flex;
  gap: 6px;
}

.map-card {
  flex: 1;
  background: #100D22;
  border: 2px solid var(--stroke);
  border-radius: 12px;
  padding: 8px;
  text-align: left;
  color: var(--dim);
  font-family: inherit;
  font-weight: 900;
}

.map-card.on {
  border-color: var(--cyan);
  color: #fff;
}

.map-card b {
  display: block;
  font-size: 13px;
}

.map-card span {
  font-size: 10px;
  font-weight: 700;
}

/* ---------- 실시간 순위표 ---------- */
#scoreboard {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 46;
  width: min(420px, 84%);
  background: #16112BF2;
  border: 2px solid var(--violet);
  border-radius: 16px;
  padding: 12px 14px;
}

#scoreboard h4 {
  font-size: 14px;
  color: var(--gold);
  margin-bottom: 8px;
}

.sb-row {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  padding: 5px 8px;
  border-radius: 8px;
}

.sb-row:nth-child(odd) {
  background: #ffffff0A;
}

.sb-row.me {
  background: #7C4DFF44;
}

.sb-row i {
  width: 20px;
  font-style: normal;
  color: var(--gold);
}

.sb-row span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-row b {
  color: var(--cyan);
  min-width: 26px;
  text-align: right;
}

.sb-row em {
  font-style: normal;
  color: var(--dim);
  min-width: 26px;
  text-align: right;
  font-size: 11px;
}

/* 미니 순위 (항상 표시) */
#miniBoard {
  z-index: 30;
  position: absolute;
  left: max(10px, env(safe-area-inset-left));
  top: 120px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
}

.mb-row {
  background: #0B0818B3;
  border-radius: 7px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
  color: var(--dim);
}

.mb-row.me {
  color: var(--cyan);
}

.mb-row b {
  color: #fff;
  margin-left: 6px;
}

/* 스폰 보호 표시 */
#protectPill {
  z-index: 30;
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translateX(-50%);
  background: #22E6D633;
  border: 2px solid var(--cyan);
  color: var(--cyan);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 11px;
  pointer-events: none;
}

/* 데미지 숫자 */
.dmgnum {
  position: absolute;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 3px #000;
  pointer-events: none;
  animation: dnum .7s ease-out forwards;
  z-index: 25;
}

.dmgnum.head {
  color: var(--gold);
  font-size: 19px;
}

@keyframes dnum {
  0% { opacity: 1; transform: translate(-50%, 0) scale(.8); }
  100% { opacity: 0; transform: translate(-50%, -46px) scale(1.1); }
}

/* 연속 처치 배너 */
#streakBanner {
  position: absolute;
  left: 50%;
  top: 26%;
  transform: translateX(-50%);
  z-index: 35;
  background: linear-gradient(#FF8A2B, #FF2E63);
  border-radius: 12px;
  padding: 6px 18px;
  font-size: 15px;
  box-shadow: 0 4px 0 #7A0C2A;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

#streakBanner.on {
  opacity: 1;
}


/* 에너지건 충전바 */
#chargeBar {
  position: absolute;
  left: 50%;
  top: calc(50% + 36px);
  transform: translateX(-50%);
  width: 76px;
  height: 6px;
  background: #0B0818CC;
  border: 1px solid var(--cyan);
  border-radius: 5px;
  opacity: 0;
  transition: opacity .12s;
  pointer-events: none;
  z-index: 20;
}

#chargeBar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--cyan);
  border-radius: 5px;
}

/* 드론 캐논: 준비된 드론 수 */
#chargeN {
  position: absolute;
  left: 50%;
  top: calc(50% + 46px);
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 900;
  color: var(--cyan);
  text-shadow: 0 0 8px #22E6D6AA;
  opacity: 0;
  transition: opacity .12s;
  pointer-events: none;
  white-space: nowrap;
  z-index: 20;
}

/* EMP 방전에 휩쓸렸을 때 화면 번쩍임 */
#empFlash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 24;
  background:
    radial-gradient(ellipse at center, #5AE3FF33 0%, #5AE3FF00 62%),
    repeating-linear-gradient(0deg, #CFF6FF22 0 2px, transparent 2px 6px);
}

#empFlash.on {
  animation: empZap .5s ease-out;
}

@keyframes empZap {
  0% { opacity: 0; }
  12% { opacity: .85; }
  40% { opacity: .28; }
  60% { opacity: .6; }
  100% { opacity: 0; }
}

/* ---------- 핑 표시 ---------- */
#pingPill {
  pointer-events: none;      /* 표시 전용 — 시선 회전을 막지 않는다 */
  display: flex;
  align-items: center;
  gap: 5px;
  height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  border: 2px solid var(--stroke);
  background: #0B0818CC;
  font-size: 12px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

#pingPill .pdot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 6px var(--lime);
}

/* ---------- FPS 표시 ---------- */
#fpsMeter {
  z-index: 30;
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  background: #0B0818CC;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--lime);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* ---------- 빠른 대화(이모트) ---------- */
#emotePop {
  z-index: 42;
  position: absolute;
  right: max(10px, env(safe-area-inset-right));
  top: 52px;
  width: 250px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #16112BF2;
  border: 2px solid var(--cyan);
  border-radius: 15px;
  padding: 10px;
  box-shadow: 0 0 24px rgba(34, 230, 214, .25);
}

.emote-b {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #100D22;
  border: 2px solid var(--stroke);
  border-radius: 11px;
  padding: 8px 9px;
  color: var(--txt);
  font-family: inherit;
  font-weight: 800;
  font-size: 12px;
}

.emote-b:active {
  border-color: var(--cyan);
  filter: brightness(1.2);
}

.emote-b em {
  font-style: normal;
  font-size: 18px;
}

/* ---------- 메뉴 레벨/경험치 ---------- */
.lvl-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  max-width: 220px;
}

.lvl-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(#9A6BFF, var(--violet));
  box-shadow: 0 3px 0 var(--violet-d), 0 0 16px rgba(124, 77, 255, .5);
  line-height: 1;
}

.lvl-badge small {
  font-size: 8px;
  color: #E7DBFF;
  letter-spacing: .5px;
}

.lvl-badge b {
  font-size: 18px;
  color: #fff;
}

.lvl-bar {
  position: relative;
  flex: 1;
  height: 20px;
  background: #100D22;
  border: 2px solid var(--stroke);
  border-radius: 999px;
  overflow: hidden;
}

.lvl-bar i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, var(--cyan), #7CF5EA);
  box-shadow: 0 0 12px var(--cyan);
  transition: width .5s cubic-bezier(.3, .9, .3, 1);
}

.lvl-bar span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--txt);
  text-shadow: 0 1px 2px #000;
  font-variant-numeric: tabular-nums;
}

/* ---------- 아나운서 배너 변형 ---------- */
#streakBanner.multi {
  background: linear-gradient(#22E6D6, #0E8F87);
  box-shadow: 0 4px 0 #06514C, 0 0 26px rgba(34, 230, 214, .6);
  color: #04302C;
}

#streakBanner.first {
  background: linear-gradient(#FFE08A, #FFC531);
  box-shadow: 0 4px 0 #8A6A00, 0 0 26px rgba(255, 197, 49, .6);
  color: #3A2A00;
}

#streakBanner.level {
  background: linear-gradient(#9A6BFF, var(--violet));
  box-shadow: 0 4px 0 var(--violet-d), 0 0 30px rgba(124, 77, 255, .7);
  letter-spacing: 2px;
}

#streakBanner.on {
  animation: annpop .3s cubic-bezier(.2, 1.5, .4, 1);
}

@keyframes annpop {
  0% { transform: translateX(-50%) scale(.7); opacity: 0; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* ================= 사이버 분위기 강화 ================= */

/* 메뉴 배경 네온 그리드 */
#menu::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(124, 77, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 230, 214, .05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(180deg, transparent, #000 40%, #000 70%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 40%, #000 70%, transparent);
}

/* HUD 숫자 네온 강조 */
.ammo b {
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(34, 230, 214, .55);
  font-variant-numeric: tabular-nums;
}

.ammo.empty b {
  color: var(--hot);
  text-shadow: 0 0 10px rgba(255, 46, 99, .6);
}

.hpnum {
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(168, 255, 62, .35);
}

#scoreBar .stime {
  font-variant-numeric: tabular-nums;
}

.hpbar,
.ammo,
.ib,
.tr-bar #pingPill {
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* 크로스헤어 네온 */
#cross .ch {
  background: #7CF5EA;
  box-shadow: 0 0 4px #000, 0 0 6px rgba(34, 230, 214, .8);
}

#cross .dot {
  background: #7CF5EA;
  box-shadow: 0 0 5px var(--cyan);
}

/* 인게임 버튼 테두리 네온감 */
.ib {
  box-shadow: inset 0 0 12px rgba(124, 77, 255, .12);
}

/* 로고 살짝 더 빛나게 */
.logo {
  animation: logoGlow 3.4s ease-in-out infinite;
}

@keyframes logoGlow {
  0%, 100% { text-shadow: 0 3px 0 var(--violet-d), 0 0 22px rgba(124, 77, 255, .7); }
  50% { text-shadow: 0 3px 0 var(--violet-d), 0 0 34px rgba(124, 77, 255, .95); }
}

/* ================= 배틀패스 · 미션 · 상점 ================= */
.wallet {
  display: flex;
  gap: 8px;
}

.wallet-c {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #100D22;
  border: 2px solid var(--stroke);
  border-radius: 12px;
  padding: 9px;
}

.wallet-c em { font-style: normal; font-size: 18px; }
.wallet-c b { font-size: 18px; color: var(--gold); font-variant-numeric: tabular-nums; }
.wallet-c span { font-size: 9px; color: var(--dim); }

.sect-t {
  font-size: 13px;
  color: var(--cyan);
  margin: 6px 0 2px;
  font-weight: 900;
}

.sect-t small { color: var(--dim); font-size: 10px; margin-left: 6px; }

.mission-list { display: flex; flex-direction: column; gap: 6px; }

.mission {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #100D22;
  border: 2px solid var(--stroke);
  border-radius: 12px;
  padding: 8px 10px;
}

.mission.claimed { opacity: .55; }
.ms-main { flex: 1; min-width: 0; }
.ms-t { font-size: 12px; margin-bottom: 4px; }

.ms-bar {
  height: 6px;
  background: #0B0818;
  border-radius: 999px;
  overflow: hidden;
}

.ms-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), #7CF5EA); }
.ms-r { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.ms-rew { font-size: 10px; color: var(--gold); }
.ms-prog { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.ms-done { font-size: 11px; color: var(--lime); }

.bp-head { margin: 4px 0; }
.bp-bar { height: 22px; }

/* 큐브패스 구매 배너 */
.cube-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(100deg, #3A2A00, #2A1F5C);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 9px 11px;
  box-shadow: 0 0 18px rgba(255, 197, 49, .25);
}

.cube-banner.owned { border-color: var(--cyan); box-shadow: 0 0 18px rgba(34, 230, 214, .25); }
.cb-m { flex: 1; }
.cb-m b { display: block; font-size: 13px; color: var(--gold); }
.cube-banner.owned .cb-m b { color: var(--cyan); }
.cb-m span { font-size: 10px; color: var(--dim); }

/* 두 트랙: 위 프리미엄 / 구분선 / 아래 무료 */
.bp-tracks { display: flex; flex-direction: column; gap: 0; }

.bp-lane { position: relative; padding: 6px 0; }

.bp-lane.premium { background: linear-gradient(90deg, rgba(255,197,49,.10), transparent); border-radius: 10px 10px 0 0; }
.bp-lane.free { background: linear-gradient(90deg, rgba(124,77,255,.10), transparent); border-radius: 0 0 10px 10px; }

.lane-tag {
  font-size: 10px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 5px;
}

.lane-tag.prem { background: var(--gold); color: #3A2A00; }
.lane-tag.free { background: var(--violet); color: #fff; }

/* 두 트랙을 나누는 굵은 가로선 */
.lane-divider {
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--violet));
  border-radius: 999px;
  margin: 2px 0;
  box-shadow: 0 0 10px rgba(255, 197, 49, .35);
}

/* 프리미엄 티어는 금색 계열로 구분 */
.bp-tier.prem { border-color: #6B5520; background: linear-gradient(#241D0E, #16120A); }
.bp-tier.prem.ready { border-color: var(--gold); }
.bp-tier.prem.claimed { border-color: var(--gold); opacity: 1; }
.bp-tier.prem .bp-lv { color: var(--gold); }

.bp-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}

.bp-tier {
  flex: 0 0 auto;
  width: 82px;
  background: #100D22;
  border: 2px solid var(--stroke);
  border-radius: 12px;
  padding: 8px 6px;
  text-align: center;
  opacity: .6;
}

.bp-tier.ready {
  opacity: 1;
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(255, 197, 49, .4);
  animation: rblink 1.1s infinite;
}

.bp-tier.claimed { opacity: 1; border-color: var(--cyan); }
.bp-lv { font-size: 11px; color: var(--cyan); font-weight: 900; }
.bp-rew { font-size: 10px; margin: 5px 0; min-height: 26px; color: var(--txt); }
.bp-st { font-size: 11px; color: var(--gold); }
.bp-tier.claimed .bp-st { color: var(--cyan); }

/* XP 부스터 */
.boost-item {
  display: flex;
  align-items: center;
  gap: 9px;
  background: linear-gradient(90deg, #1B2A38, #100D22);
  border: 2px solid var(--cyan);
  border-radius: 12px;
  padding: 8px 10px;
}
.boost-item em { font-style: normal; font-size: 22px; }
.boost-on { font-size: 10px; color: var(--lime); }

/* 키링 능력 설명 */
.cos-chip .perk { display: block; font-size: 9px; color: var(--dim); font-weight: 700; }
.cos-chip.on .perk { color: var(--cyan); }
.cos-chip.tier-pass { border-color: #8A5CFF; }
.cos-chip.tier-admin { border-color: var(--gold); }

/* 보물상자 */
.chest-list { display: flex; flex-direction: column; gap: 6px; }

.chest-item {
  display: flex;
  align-items: center;
  gap: 9px;
  background: linear-gradient(90deg, #1B1338, #100D22);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 8px 10px;
}

.chest-item em { font-style: normal; font-size: 22px; }
.ci-m { flex: 1; }
.ci-m b { display: block; font-size: 13px; }
.ci-m span { font-size: 10px; color: var(--dim); }

#chestPop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #060411E6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chest-box {
  background: linear-gradient(#241C48, #14102A);
  border: 3px solid var(--gold);
  border-radius: 20px;
  padding: 22px 34px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: chestPop .38s cubic-bezier(.2, 1.6, .4, 1);
}

#chestPop.tier-rare .chest-box { border-color: var(--cyan); box-shadow: 0 0 40px rgba(34, 230, 214, .5); }
#chestPop.tier-legend .chest-box { border-color: var(--gold); box-shadow: 0 0 60px rgba(255, 197, 49, .75); }

.chest-ic { font-size: 54px; animation: chestShake .5s ease-out; }
.chest-tier { font-size: 12px; color: var(--gold); letter-spacing: 2px; }
.chest-name { font-size: 19px; }

@keyframes chestPop {
  0% { transform: scale(.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes chestShake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-14deg); }
  75% { transform: rotate(14deg); }
}

.shop-list { display: flex; flex-direction: column; gap: 6px; }

.shop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #100D22;
  border: 2px solid var(--stroke);
  border-radius: 12px;
  padding: 8px 10px;
}

.si-n { font-size: 13px; }

/* ================= 관리자 콘솔 ================= */
#adminPop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #060411E6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.admin-box {
  width: min(760px, 96%);
  max-height: 92%;
  background: linear-gradient(#1A1533, #100C22);
  border: 2px solid var(--hot);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(255, 46, 99, .3);
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 2px solid #0007;
  font-size: 16px;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 12px 0;
  flex-wrap: wrap;
}

.atab {
  background: transparent;
  border: 2px solid var(--stroke);
  color: var(--dim);
  font-family: inherit;
  font-weight: 900;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 10px;
}

.atab.on { background: var(--hot); border-color: var(--hot); color: #fff; }

.admin-body {
  padding: 12px 14px 14px;
  overflow-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.apage { display: none; flex-direction: column; gap: 8px; }
.apage.on { display: flex; }

.adm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.adm-stat {
  background: #0B0818;
  border: 2px solid var(--stroke);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}

.adm-stat b { display: block; font-size: 20px; color: var(--cyan); font-variant-numeric: tabular-nums; }
.adm-stat span { font-size: 10px; color: var(--dim); }

.admin-hint { font-size: 11px; color: var(--dim); }

.admin-row { display: flex; gap: 6px; align-items: center; }
.admin-row input { flex: 1; }

.adm-room {
  background: #0B0818;
  border: 2px solid var(--stroke);
  border-radius: 12px;
  padding: 9px;
}

.adm-room-h {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  margin-bottom: 6px;
}

.adm-room-h span { color: var(--dim); font-size: 10px; flex: 1; }

.adm-plist { display: flex; flex-direction: column; gap: 4px; }

.adm-p {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #16112B;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
}

.adm-p span { flex: 1; }
.adm-p em { font-style: normal; font-size: 10px; color: var(--dim); font-variant-numeric: tabular-nums; }

.adm-log {
  display: flex;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 6px;
  background: #0B0818;
  align-items: baseline;
}

.al-t { color: var(--dim); font-variant-numeric: tabular-nums; }
.al-ev { color: var(--cyan); min-width: 92px; }
.al-ev.login, .al-ev.token { color: var(--lime); }
.al-ev.disconnect, .al-ev.login-fail { color: var(--hot); }
.al-ev.connect { color: var(--gold); }
.al-ip { color: var(--txt); }
.al-n { color: var(--cyan); }
.al-ua { color: var(--dim); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
