:root {
  --bg: #0d0e12;
  --panel: #171920;
  --panel-2: #1f222b;
  --line: #2c303b;
  --text: #ece8dc;
  --muted: #9a9fae;
  --accent: #ffd23f;
  --accent-dark: #b38f12;
  --t0: #f2a03d;
  --t1: #4fbf5e;
  --font: 'VT323', ui-monospace, Consolas, monospace;
  --display: 'Bungee', 'VT323', system-ui, sans-serif;
  --emoji: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 20px;
  overflow: hidden;
  user-select: none;
}

button { font: inherit; color: inherit; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

/* ---------- HUD trên ---------- */
#hud {
  flex: none;
  height: 58px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: linear-gradient(#191b22, #121318);
  border-bottom: 2px solid var(--line);
}
.team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.team.t1 { flex-direction: row-reverse; text-align: right; }
.ticon { width: 42px; height: 42px; image-rendering: pixelated; flex: none; }
.tinfo { flex: 1; min-width: 0; max-width: 280px; }
.tname { font-family: var(--display); font-size: 14px; letter-spacing: 1px; white-space: nowrap; }
.t0 .tname { color: var(--t0); }
.t1 .tname { color: var(--t1); }
.bar { height: 12px; margin-top: 4px; background: #08090b; border: 2px solid #000; box-shadow: 0 0 0 1px var(--line); }
.bar i { display: block; height: 100%; width: 100%; transition: width .15s; }
.t0 .bar i { background: var(--t0); }
.t1 .bar i { background: var(--t1); margin-left: auto; }
.lives { display: flex; flex-direction: column; align-items: center; line-height: .9; flex: none; }
.lives small { font-size: 14px; color: var(--muted); letter-spacing: 1px; }
.lives b { font-size: 28px; font-weight: 400; color: #ff7a7a; }
.mid { text-align: center; line-height: 1; }
#clock { font-size: 34px; color: var(--accent); }
#zoneinfo { font-size: 18px; color: #ff9f5a; white-space: nowrap; }

/* ---------- Sân ---------- */
#stage {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
#cv {
  display: block;
  box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--line), 0 14px 40px rgba(0, 0, 0, .6);
}

#banner {
  position: absolute;
  left: 50%;
  top: 14%;
  max-width: 92vw;
  transform: translateX(-50%);
  pointer-events: none;
  text-align: center;
  font-family: var(--display);
  font-size: clamp(18px, 2.8vw, 34px);
  color: #fff;
  text-shadow: 3px 3px 0 #000, 0 0 20px rgba(0, 0, 0, .7);
  opacity: 0;
  z-index: 2;
}
#banner.show { animation: bannerIn .25s ease-out forwards; }
#banner.count { top: 28%; font-size: clamp(64px, 12vw, 150px); color: var(--accent); }
#banner.go { color: #ff6b3d; }
#banner.warn { color: #ff6b6b; }
#banner.fire { color: #ffb347; }
@keyframes bannerIn {
  from { opacity: 0; transform: translateX(-50%) scale(1.35); }
  to { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* ---------- Thẻ người chơi ---------- */
#pcards {
  flex: none;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  background: #121318;
  border-top: 2px solid var(--line);
}
.pcard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 3px 12px;
  font-size: 22px;
  background: var(--panel);
  border: 2px solid var(--line);
  white-space: nowrap;
}
.pcard.right { flex-direction: row-reverse; }
.pcard.dead { opacity: .5; }
.pcard .who { font-family: var(--display); font-size: 14px; padding: 2px 8px; color: #111; }
.pcard.t0 .who { background: var(--t0); }
.pcard.t1 .who { background: var(--t1); }
.pcard .hearts { color: #ff5d5d; letter-spacing: 2px; }
.pcard .weap { display: flex; align-items: center; gap: 6px; min-width: 170px; }
.pcard.right .weap { justify-content: flex-end; }
.pcard .wicon { font-family: var(--emoji); font-size: 17px; }
.pcard .ammo { color: var(--accent); }
.pcard .kills { color: var(--muted); }
.pcard .status { color: #7bdff2; min-width: 90px; }
#pcards .hint { color: var(--muted); font-size: 18px; }

body.in-menu #hud, body.in-menu #pcards { display: none; }

/* ---------- Lớp phủ ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.overlay.show { display: flex; }
#menu { background: radial-gradient(ellipse at center, rgba(13, 14, 18, .45), rgba(13, 14, 18, .88)); }
#pause, #over, #online { background: rgba(8, 9, 12, .72); backdrop-filter: blur(3px); }

.panel {
  width: 100%;
  max-width: 840px;
  max-height: 100%;
  overflow-y: auto;
  padding: 24px 28px;
  background: rgba(23, 25, 32, .95);
  border: 2px solid #000;
  box-shadow: 0 0 0 2px var(--line), 8px 8px 0 rgba(0, 0, 0, .6);
}
.panel h2 { margin: 0 0 14px; font-family: var(--display); font-weight: 400; font-size: 32px; text-align: center; }

.logo { margin: 0; text-align: center; font-family: var(--display); font-weight: 400; line-height: .95; }
.logo .l1 {
  display: block;
  font-size: clamp(36px, 7vw, 66px);
  color: var(--accent);
  text-shadow: 4px 4px 0 #b3471d, 8px 8px 0 #000;
}
.logo .l2 {
  display: block;
  margin-top: 8px;
  font-size: clamp(26px, 5vw, 46px);
  color: #ff6b3d;
  text-shadow: 3px 3px 0 #000;
}
.tagline { margin: 12px 0 18px; text-align: center; font-size: 22px; color: var(--muted); }

.section-label { margin: 0 0 6px; font-size: 16px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }

.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.mode {
  padding: 12px;
  text-align: left;
  cursor: pointer;
  background: var(--panel-2);
  border: 2px solid var(--line);
}
.mode b { display: block; margin-bottom: 4px; font-family: var(--display); font-weight: 400; font-size: 15px; }
.mode small { display: block; font-size: 18px; line-height: 1.1; color: var(--muted); }
.mode:hover { border-color: #4a5060; }
.mode.sel { background: #2a2616; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.opts { display: flex; flex-wrap: wrap; gap: 28px; margin-bottom: 20px; }
.seg { display: inline-flex; border: 2px solid var(--line); }
.seg button {
  padding: 3px 16px;
  font-size: 22px;
  cursor: pointer;
  background: var(--panel-2);
  border: 0;
  border-right: 2px solid var(--line);
}
.seg button:last-child { border-right: 0; }
.seg button:hover { background: #2a2e38; }
.seg button.sel { background: var(--accent); color: #1a1300; }

.big-btn {
  display: block;
  margin: 0 auto;
  padding: 12px 34px;
  font-family: var(--display);
  font-size: 22px;
  color: #1a1300;
  cursor: pointer;
  background: var(--accent);
  border: 0;
  box-shadow: 0 5px 0 var(--accent-dark), 0 5px 0 2px #000;
}
.big-btn:hover { filter: brightness(1.08); }
.big-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--accent-dark), 0 2px 0 2px #000; }
.ghost-btn {
  padding: 10px 24px;
  font-family: var(--display);
  font-size: 16px;
  cursor: pointer;
  background: transparent;
  border: 2px solid var(--line);
}
.ghost-btn:hover { border-color: var(--muted); }

.info-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 2px dashed var(--line);
}
.ctl { margin-bottom: 6px; font-size: 20px; }
.ctl.note { font-size: 18px; color: var(--muted); }
.who { display: inline-block; margin-right: 8px; padding: 0 6px; font-family: var(--display); font-size: 12px; color: #111; vertical-align: 2px; }
.who.t0 { background: var(--t0); }
.who.t1 { background: var(--t1); }
kbd {
  display: inline-block;
  min-width: 22px;
  margin: 0 1px;
  padding: 0 5px;
  font-family: var(--font);
  font-size: 18px;
  text-align: center;
  background: #2a2e38;
  border: 1px solid #3b404c;
  border-bottom-width: 3px;
  border-radius: 3px;
}
.rules-label { margin-top: 14px; }
.rules { margin: 0; padding-left: 18px; font-size: 18px; color: var(--muted); }
.rules li { margin-bottom: 2px; }
#itemList { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 18px; }
#itemList .ic { display: inline-block; width: 26px; font-family: var(--emoji); font-size: 15px; }
#itemList b { font-weight: 400; color: var(--text); }
#itemList .d { color: var(--muted); }

.small-panel { max-width: 380px; text-align: center; }
.btn-col { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.btn-row { display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.btn-row .big-btn { margin: 0; }
.hint { margin: 16px 0 0; font-size: 18px; color: var(--muted); text-align: center; }

.over-panel { max-width: 580px; text-align: center; }
#overIcon { width: 72px; height: 72px; image-rendering: pixelated; }
#overTitle { margin: 6px 0 4px; font-size: 40px; }
#overTitle.t0 { color: var(--t0); }
#overTitle.t1 { color: var(--t1); }
#overTitle.lose { color: #ff6b6b; }
#overSub { margin: 0 0 14px; font-size: 20px; color: var(--muted); }
#overStats { width: 100%; border-collapse: collapse; font-size: 20px; }
#overStats th { padding: 4px 8px; font-weight: 400; font-size: 16px; letter-spacing: 1px; color: var(--muted); text-align: left; border-bottom: 2px solid var(--line); }
#overStats td { padding: 3px 8px; text-align: left; border-bottom: 1px solid #22252d; }
#overStats th.n, #overStats td.n { text-align: right; }
#overStats tr.me td { color: var(--accent); }
#overStats .dot { display: inline-block; width: 10px; height: 10px; margin-right: 6px; }

[hidden] { display: none !important; }

/* ---------- Online ---------- */
.online-btn {
  display: block;
  margin: 16px auto 0;
  padding: 8px 22px;
  font-family: var(--display);
  font-size: 16px;
  cursor: pointer;
  color: #bfe6ff;
  background: #16222e;
  border: 2px solid #2f5873;
}
.online-btn small { display: block; font-family: var(--font); font-size: 17px; color: var(--muted); }
.online-btn:hover { border-color: #5aa6d6; }
.mode-row { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.mode-row .online-btn { margin: 0; }
.story-btn { color: #ffd9a0; background: #2e2214; border-color: #7a5428; }
.story-btn:hover { border-color: #d69a4a; }

/* ---------- Cốt truyện ---------- */
.story-panel { max-width: 760px; }
.story-opts { margin-bottom: 14px; }
.chapters { display: grid; gap: 8px; }
.part-title { margin: 8px 0 2px; font-family: var(--display); font-size: 14px; letter-spacing: 1px; color: #ff9f5a; }
.chapter {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  background: var(--panel-2);
  border: 2px solid var(--line);
}
.chapter:hover:not(:disabled) { border-color: var(--accent); }
.chapter:disabled { cursor: default; opacity: .45; }
.chapter .ch-icon { font-family: var(--emoji); font-size: 30px; text-align: center; }
.chapter b { display: block; font-family: var(--display); font-weight: 400; font-size: 15px; }
.chapter small { display: block; font-size: 18px; color: var(--muted); }
.chapter .ch-state { font-size: 20px; color: var(--accent); white-space: nowrap; }
.chapter.cleared .ch-state { color: #9be7a3; }

#dialog { align-items: flex-end; padding-bottom: 6vh; background: rgba(8, 9, 12, .45); }
.dialog-box {
  width: min(760px, 100%);
  padding: 18px 22px 14px;
  cursor: pointer;
  background: rgba(18, 19, 25, .97);
  border: 3px solid #000;
  box-shadow: 0 0 0 3px var(--accent), 8px 8px 0 rgba(0, 0, 0, .6);
}
.dialog-title { font-size: 16px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.dialog-speaker { margin: 4px 0 6px; font-family: var(--display); font-size: 18px; color: var(--accent); }
.dialog-text { min-height: 64px; font-size: 25px; line-height: 1.25; }
.dialog-next { margin-top: 8px; font-size: 17px; text-align: right; color: var(--muted); }

body.story .t1 .tname { color: #c9a8ff; }
body.story .t1 .bar i { background: #9b6bd6; }

/* ---------- Điện thoại / cảm ứng ---------- */
.touch-only { display: none !important; }
body.touch .touch-only { display: block !important; }
.full-row { text-align: center; margin: -6px 0 14px; }
body.touch button { touch-action: manipulation; }
body.touch { -webkit-touch-callout: none; -webkit-user-select: none; }
body.touch:not(.in-menu) #app { touch-action: none; }

#touchUi { position: fixed; inset: 0; z-index: 6; pointer-events: none; }
.tc-zone {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50%;
  height: 78%;
  pointer-events: auto;
  touch-action: none;
}
.tc-zone[data-p="p2"] { display: none; }
.tc-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  font-size: 16px;
  color: rgba(255, 255, 255, .45);
  white-space: nowrap;
  pointer-events: none;
}
.tc-zone.used .tc-hint { display: none; }
.tc-base {
  position: absolute;
  left: 110px;
  top: calc(100% - 110px);
  width: 112px;
  height: 112px;
  margin: -56px 0 0 -56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  border: 2px solid rgba(255, 255, 255, .22);
  opacity: .55;
  pointer-events: none;
}
.tc-base.on { opacity: 1; background: rgba(255, 255, 255, .1); }
.tc-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 210, 63, .6);
  border: 2px solid rgba(255, 255, 255, .75);
  transform: translate(-50%, -50%);
}
.tc-fire {
  position: absolute;
  right: max(22px, env(safe-area-inset-right));
  bottom: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 94px;
  height: 94px;
  border-radius: 50%;
  font-family: var(--emoji);
  font-size: 32px;
  line-height: 1;
  color: #fff;
  pointer-events: auto;
  touch-action: none;
  background: rgba(230, 57, 70, .5);
  border: 3px solid rgba(255, 255, 255, .6);
}
.tc-fire small { font-family: var(--display); font-size: 11px; margin-top: 2px; }
.tc-fire.down { background: rgba(255, 130, 60, .85); transform: scale(.93); }
.tc-fire[data-p="p2"] { display: none; }
.tc-small {
  position: absolute;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  width: 42px;
  height: 36px;
  font-size: 18px;
  pointer-events: auto;
  color: #fff;
  background: rgba(23, 25, 32, .75);
  border: 2px solid var(--line);
}
/* 2 người chung máy tính bảng: P1 nửa trái, P2 nửa phải; nút bắn ở phía trên mỗi nửa */
#touchUi.two .tc-zone { height: 62%; }
#touchUi.two .tc-zone[data-p="p2"] { display: block; left: 50%; }
#touchUi.two .tc-fire[data-p="p1"] { right: auto; left: 22px; bottom: auto; top: 22%; width: 80px; height: 80px; }
#touchUi.two .tc-fire[data-p="p2"] { display: flex; bottom: auto; top: 22%; width: 80px; height: 80px; }
#touchUi.two .tc-zone[data-p="p2"] .tc-base { left: calc(100% - 110px); }

#rotateHint {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(13, 14, 18, .96);
}
#rotateHint b { display: block; font-family: var(--emoji); font-size: 54px; }
#rotateHint p { font-family: var(--display); font-size: 18px; color: var(--accent); }
@media (orientation: portrait) {
  body.touch:not(.in-menu) #rotateHint { display: flex; }
}
body.touch:not(.in-menu) #muteBtn { top: 48px; right: 10px; bottom: auto; }

/* màn hình thấp (điện thoại xoay ngang): gọn thanh trên/dưới để dành chỗ cho sân */
@media (max-height: 520px) {
  #hud { height: 40px; padding: 0 8px; gap: 8px; }
  .ticon { width: 28px; height: 28px; }
  .tname { font-size: 10px; }
  .bar { height: 8px; margin-top: 2px; }
  .lives small { font-size: 11px; }
  .lives b { font-size: 20px; }
  #clock { font-size: 22px; }
  #zoneinfo { font-size: 13px; }
  #pcards { height: 32px; padding: 0 8px; }
  .pcard { font-size: 16px; gap: 8px; padding: 1px 8px; }
  .pcard .who { font-size: 10px; }
  .pcard .weap { min-width: 0; }
  .pcard .kills, #pcards .hint { display: none; }
  .panel { padding: 14px 16px; }
  .logo .l1 { font-size: 34px; }
  .logo .l2 { font-size: 24px; }
  .tc-small, body.touch:not(.in-menu) #muteBtn { top: 44px; }
  .tc-fire { width: 84px; height: 84px; bottom: 16px; }
  .dialog-text { font-size: 20px; min-height: 48px; }
}

.online-panel { max-width: 720px; }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; margin-bottom: 4px; font-size: 16px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.field i { font-style: normal; text-transform: none; letter-spacing: 0; }
.field input {
  width: 100%;
  padding: 6px 10px;
  font-family: var(--font);
  font-size: 22px;
  color: var(--text);
  background: #0f1116;
  border: 2px solid var(--line);
  outline: none;
}
.field input:focus { border-color: var(--accent); }
.code-input { text-transform: uppercase; letter-spacing: 8px; font-size: 28px !important; }
.name-field { max-width: 320px; }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0 16px; font-size: 20px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.tabs { display: flex; gap: 6px; margin: 6px 0 12px; border-bottom: 2px solid var(--line); }
.tab-btn {
  padding: 6px 14px;
  margin-bottom: -2px;
  font-family: var(--display);
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.sel { color: var(--accent); border-bottom-color: var(--accent); }
.tab-pane { min-height: 220px; }
.tab-pane .big-btn { margin-top: 6px; }

.room-list { max-height: 260px; overflow-y: auto; background: #0f1116; border: 2px solid var(--line); }
.room {
  display: grid;
  grid-template-columns: 28px 1fr auto 52px 92px auto;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  font-size: 20px;
  border-bottom: 1px solid #1e2129;
}
.room:last-child { border-bottom: 0; }
.room:hover { background: #161920; }
.r-lock { font-family: var(--emoji); font-size: 14px; text-align: center; }
.r-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-host { font-size: 17px; white-space: nowrap; color: var(--muted); }
.r-count { text-align: right; color: var(--accent); }
.r-state { font-size: 17px; color: var(--muted); }
.r-state.playing { color: #ff9f5a; }
.room-empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.note { margin: 8px 0 0; font-size: 17px; color: var(--muted); }
.ghost-btn.small { padding: 4px 12px; font-size: 12px; }
.ghost-btn:disabled { opacity: .4; cursor: default; }

.net-status { min-height: 24px; margin: 12px 0 0; text-align: center; color: #7bdff2; }
.net-status.err { color: #ff7a7a; }

.lobby-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; }
.lobby-title h2 { margin: 0; font-size: 26px; text-align: left; overflow-wrap: anywhere; }
.code-box { text-align: right; }
.code-box b { display: block; font-family: var(--display); font-weight: 400; font-size: 34px; letter-spacing: 4px; color: var(--accent); }

.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.team-col { padding: 10px 12px; background: #0f1116; border: 2px solid var(--line); }
.team-col.t0 { border-top: 4px solid var(--t0); }
.team-col.t1 { border-top: 4px solid var(--t1); }
.team-col h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-family: var(--display); font-weight: 400; font-size: 15px; }
.team-col.t0 h3 { color: var(--t0); }
.team-col.t1 h3 { color: var(--t1); }
.team-ico { width: 28px; height: 28px; image-rendering: pixelated; }
.team-col ul { list-style: none; margin: 0 0 10px; padding: 0; min-height: 112px; }
.team-col li { padding: 3px 6px; font-size: 21px; border-bottom: 1px dashed #22252d; }
.team-col li.me { color: var(--accent); }
.team-col li.bot { color: #5d6270; }

/* ---------- Chọn bối cảnh / chọn xe ---------- */
.theme-seg { flex-wrap: wrap; margin-bottom: 16px; }
.theme-seg button { font-size: 19px; padding: 3px 12px; border-bottom: 2px solid var(--line); }
.opt-wide { flex-basis: 100%; }
.opt-wide .theme-seg { margin-bottom: 0; }

.kinds-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.kinds-row.one { grid-template-columns: 1fr; }
.kind-picker { display: flex; flex-wrap: wrap; gap: 5px; }
.kind {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 70px;
  padding: 4px 2px 3px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  background: var(--panel-2);
  border: 2px solid var(--line);
}
.kind canvas { display: block; width: 44px; height: 44px; }
.kind span { white-space: nowrap; }
.kind:hover { border-color: #4a5060; }
.kind.sel { background: #2a2616; border-color: var(--accent); color: var(--accent); }
.bases-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 18px; }
.opt.bases-row { margin-bottom: 0; }
.base-picker .kind { width: 64px; font-size: 12px; padding: 3px 1px 2px; }
.base-picker .kind canvas { width: 40px; height: 40px; image-rendering: pixelated; }
.base-picker .kind:disabled:not(.sel) { opacity: .3; cursor: default; }
.skin-label { margin-top: 10px; }
.skin-picker .kind { width: 58px; font-size: 13px; padding: 3px 1px 2px; }
.skin-picker .kind canvas { width: 38px; height: 38px; }
.kind-info { min-height: 40px; margin-top: 6px; font-size: 17px; line-height: 1.15; color: var(--muted); white-space: pre-line; }
.lobby-kind { margin-bottom: 14px; }

#banner.theme { top: 28%; font-size: clamp(30px, 5vw, 60px); color: #fff; }

/* nút bắt đầu khi còn người chưa sẵn sàng */
.big-btn.waiting { background: #4a4020; color: var(--accent); box-shadow: 0 5px 0 #2a2410, 0 5px 0 2px #000; }
.big-btn.armed { animation: armed 1s ease-in-out infinite; }
@keyframes armed { 50% { filter: brightness(1.25); } }
.ghost-ready { background: #1e3a24 !important; color: #9be7a3 !important; box-shadow: 0 5px 0 #11241a, 0 5px 0 2px #000 !important; }

#lobbyOpts .seg button:disabled { cursor: default; opacity: .55; }
#lobbyOpts .seg button.sel:disabled { opacity: 1; }
.lobby-info { margin: 0 0 4px; font-size: 19px; text-align: center; color: var(--muted); }

#muteBtn {
  position: fixed;
  right: 10px;
  bottom: 10px;
  z-index: 20;
  width: 38px;
  height: 38px;
  font-family: var(--emoji);
  font-size: 18px;
  cursor: pointer;
  background: rgba(23, 25, 32, .9);
  border: 2px solid var(--line);
}
body:not(.in-menu) #muteBtn { bottom: 64px; }

/* ---------- Nói chuyện trong đội (online) ---------- */
.voice-row { margin-bottom: 14px; }
.voice-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vbtn.on { border-color: #4fbf5e; color: #9be7a3; }
.vbtn.talk { box-shadow: 0 0 0 3px rgba(79, 191, 94, .45); }
.voice-note { font-size: 17px; color: var(--muted); }
.voice-note.err { color: #ff7a7a; }
.team-col li.talk { background: rgba(79, 191, 94, .16); box-shadow: inset 3px 0 0 #4fbf5e; }

#voiceHud { position: fixed; right: 54px; bottom: 64px; z-index: 20; display: none; align-items: center; gap: 6px; }
body.net:not(.in-menu) #voiceHud { display: flex; }
#voiceHud button {
  position: relative;
  width: 38px;
  height: 38px;
  font-family: var(--emoji);
  font-size: 18px;
  cursor: pointer;
  background: rgba(23, 25, 32, .9);
  border: 2px solid #4fbf5e;
}
#voiceHud button.off { border-color: var(--line); opacity: .75; }
#voiceHud button.off::after {
  content: '';
  position: absolute;
  left: 5px;
  right: 5px;
  top: 50%;
  height: 3px;
  margin-top: -1px;
  background: #ff5a5a;
  transform: rotate(-45deg);
}
#vMicHud.talk { box-shadow: 0 0 0 3px rgba(79, 191, 94, .5); }
#voiceTalk {
  max-width: 38vw;
  padding: 2px 8px;
  font-size: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #9be7a3;
  background: rgba(13, 14, 18, .82);
  border: 1px solid var(--line);
}
#voiceTalk:empty { display: none; }
#voiceTalk.err { color: #ff7a7a; }
body.touch:not(.in-menu) #voiceHud { top: 48px; bottom: auto; }
@media (max-height: 520px) { body.touch:not(.in-menu) #voiceHud { top: 44px; } }

@media (max-width: 760px) {
  .modes { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .panel { padding: 18px 16px; }
  #hud { padding: 0 8px; gap: 8px; }
  .tname { font-size: 11px; }
  .ticon { width: 32px; height: 32px; }
  .pcard .weap { min-width: 0; }
  .pcard .kills, #pcards .hint { display: none; }
  .teams { grid-template-columns: 1fr; }
  .kinds-row, .bases-row { grid-template-columns: 1fr; }
  .room { grid-template-columns: 24px 1fr 44px auto; }
  .r-host, .r-state { display: none; }
  .lobby-head { flex-direction: column; align-items: flex-start; }
  .code-box { text-align: left; }
}
