:root {
  --bg: #080c14;
  --panel: rgba(13, 19, 31, 0.84);
  --panel-strong: rgba(11, 16, 26, 0.94);
  --card: rgba(255, 255, 255, 0.045);
  --card-hover: rgba(255, 255, 255, 0.085);
  --border: rgba(255, 255, 255, 0.11);
  --accent: #ff7a1a;
  --accent-2: #ffb347;
  --cyan: #4cd4ff;
  --red: #ff4a5a;
  --green: #69f06e;
  --text: #eef3fc;
  --muted: #8b9bb4;
  --xhair: #7dff6a;
  --gap: 8px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Chakra Petch', system-ui, sans-serif;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

button, input, select {
  font-family: inherit;
  color: inherit;
}

#game {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

.hidden {
  display: none !important;
}

/* ============================== MENU ============================== */

#menu {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 20px 28px 14px;
  background:
    radial-gradient(circle at 75% 25%, rgba(16, 26, 44, 0.22) 0%, rgba(7, 10, 18, 0.78) 65%),
    linear-gradient(180deg, rgba(6, 9, 16, 0.72) 0%, rgba(6, 9, 16, 0.45) 45%, rgba(6, 9, 16, 0.86) 100%);
  backdrop-filter: blur(4px);
}

.menu-top {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  font-family: 'Black Ops One', cursive;
  font-size: 38px;
  letter-spacing: 2px;
  line-height: 1;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
  margin: 0;
}

.logo span {
  color: var(--accent);
}

.logo small {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--cyan);
  margin-left: 3px;
}

.player-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 14px;
  min-width: 210px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.player-chip:hover {
  border-color: var(--cyan);
  background: rgba(20, 29, 44, 0.92);
}

.chip-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chip-edit {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(76, 212, 255, 0.14);
  color: var(--cyan);
  flex-shrink: 0;
}

.player-chip .lvl {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #ff4e1a);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  color: #110903;
  box-shadow: 0 2px 10px rgba(255, 122, 26, 0.45);
}

.chip-info {
  flex: 1;
  min-width: 0;
}

.chip-name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xpbar {
  margin-top: 5px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.xpbar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: inherit;
  transition: width 0.35s ease;
}

.xpbar.big {
  height: 10px;
}

.menu-body {
  flex: 1;
  min-height: 0;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 18px;
}

.tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tab {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.tab:hover {
  background: rgba(26, 36, 56, 0.9);
  border-color: rgba(255, 255, 255, 0.25);
}

.tab.active {
  background: linear-gradient(135deg, rgba(255, 122, 26, 0.24), rgba(255, 122, 26, 0.08));
  border-color: var(--accent);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.panels {
  min-height: 0;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.panels::-webkit-scrollbar {
  width: 8px;
}

.panels::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 4px;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
}

.panel h2:not(:first-child) {
  margin-top: 18px;
}

.cards {
  display: grid;
  gap: 10px;
}

.cards.modes {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cards.maps {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 11px;
  padding: 12px 13px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.card:hover {
  background: var(--card-hover);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.card.active {
  background: rgba(255, 122, 26, 0.16);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(255, 122, 26, 0.35);
}

.card strong {
  font-size: 15px;
  font-weight: 700;
}

.card span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.map-swatch {
  height: 6px;
  border-radius: 4px;
  margin-bottom: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.opts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.opt {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.opt > span {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-weight: 600;
}

.opt > span b {
  color: var(--text);
}

.opt input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.opt select {
  background: #101725;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 13px;
  cursor: pointer;
}

.seg {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
}

.seg button {
  flex: 1;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 5px 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.seg button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.seg button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #140902;
  font-weight: 700;
}

.mutators {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mutator-btn {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.mutator-btn:hover {
  background: var(--card-hover);
}

.mutator-btn.active {
  background: rgba(76, 212, 255, 0.18);
  border-color: var(--cyan);
  color: #e6fbff;
}

.deploy-row {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.loadout-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  cursor: pointer;
}

.lm-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
}

.lm-pill b {
  color: var(--muted);
  margin-right: 6px;
  text-transform: uppercase;
  font-size: 11px;
}

.deploy {
  border: none;
  border-radius: 12px;
  padding: 14px 32px;
  font-family: 'Black Ops One', cursive;
  font-size: 22px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #160a02;
  background: linear-gradient(135deg, #ff8f2c, #ff6214);
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(255, 110, 26, 0.4);
  transition: transform 0.12s, filter 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.deploy:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.deploy:active {
  transform: translateY(1px);
}

.deploy span {
  font-size: 16px;
}

/* Loadout tab */

.slot-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.slot-tabs button {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  cursor: pointer;
}

.slot-tabs button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #140902;
}

.loadout-grid {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 16px;
}

.weapon-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 430px;
  overflow-y: auto;
  padding-right: 4px;
}

.weapon-list::-webkit-scrollbar {
  width: 6px;
}

.weapon-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 3px;
}

.weapon-item {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 9px;
  padding: 9px 12px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.weapon-item:hover {
  background: var(--card-hover);
}

.weapon-item.active {
  background: rgba(255, 122, 26, 0.18);
  border-color: var(--accent);
}

.weapon-item .wi-name {
  font-weight: 700;
  font-size: 14px;
}

.weapon-item .wi-tag {
  font-size: 11px;
  color: var(--muted);
}

.weapon-item .wi-eq {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(105, 240, 110, 0.18);
  color: var(--green);
  text-transform: uppercase;
}

.weapon-detail {
  background: rgba(7, 11, 18, 0.55);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

#preview {
  width: 100%;
  height: 190px;
  display: block;
  border-radius: 9px;
  background: radial-gradient(circle at center, rgba(45, 70, 110, 0.28), rgba(8, 12, 20, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.wd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.wd-head h3 {
  margin: 0;
  font-size: 20px;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(76, 212, 255, 0.16);
  color: var(--cyan);
}

#wd-desc {
  margin: 6px 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

.stat-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.stat-row div {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.stat-row b {
  color: var(--text);
}

.stat-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.stat-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--accent));
}

.wd-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.wd-meta span {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 8px;
  border-radius: 6px;
}

.weapon-detail h4 {
  margin: 14px 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

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

.camo-btn {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 8px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.camo-btn.active {
  border-color: var(--accent);
  background: rgba(255, 122, 26, 0.18);
}

.camo-btn.locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.camo-dot {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.camo-btn small {
  display: block;
  font-size: 10px;
  color: var(--muted);
}

/* Profile tab */

.text-input {
  width: 100%;
  max-width: 340px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 600;
  outline: none;
}

.text-input:focus {
  border-color: var(--accent);
}

.career {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.career-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.career-card span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--muted);
}

.career-card b {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

/* Settings & Controls */

.settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.opt.check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.opt.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.swatch {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
}

.swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--accent);
}

.controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

.controls > div {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

kbd {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
}

.tips ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.tips b {
  color: var(--text);
}

.menu-foot {
  max-width: 1180px;
  width: 100%;
  margin: 10px auto 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* ============================== ABOUT & SEO GUIDE ============================== */

.about-seo {
  display: flex;
  flex-direction: column;
  gap: 12px;
  line-height: 1.6;
}

.about-seo h2 {
  font-size: 15px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 8px 0 4px;
}

.about-lead {
  font-size: 14px;
  color: #e0e8f0;
  margin: 0;
  line-height: 1.65;
}

.about-lead strong {
  color: var(--cyan);
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0;
}

.seo-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s, background 0.15s;
}

.seo-card:hover {
  border-color: rgba(255, 122, 26, 0.4);
  background: var(--card-hover);
}

.seo-card h3 {
  font-size: 13px;
  margin: 0;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.seo-card p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.seo-card strong {
  color: #ffffff;
}

.seo-list {
  margin: 4px 0 8px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.seo-list li {
  margin-bottom: 4px;
}

.seo-list strong {
  color: #ffffff;
}

.about-p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

@media (max-width: 680px) {
  .seo-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================== HUD ============================== */

#hud {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

#crosshair {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

#crosshair[data-mode="none"] {
  display: none;
}

#crosshair i {
  position: absolute;
  background: var(--xhair);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.85);
}

#crosshair .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  left: -1.5px;
  top: -1.5px;
}

#crosshair[data-mode="dot"] .l,
#crosshair[data-mode="dot"] .r,
#crosshair[data-mode="dot"] .t,
#crosshair[data-mode="dot"] .b {
  display: none;
}

#crosshair .l,
#crosshair .r {
  width: 9px;
  height: 2px;
  top: -1px;
}

#crosshair .l {
  right: var(--gap);
}

#crosshair .r {
  left: var(--gap);
}

#crosshair .t,
#crosshair .b {
  width: 2px;
  height: 9px;
  left: -1px;
}

#crosshair .t {
  bottom: var(--gap);
}

#crosshair .b {
  top: var(--gap);
}

#hitmarker {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.08s;
}

#hitmarker.on {
  opacity: 1;
}

#hitmarker.kill {
  transform: translate(-50%, -50%) scale(1.25);
}

#hitmarker i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 2px;
  background: #fff;
  transform-origin: left center;
}

#hitmarker.head i {
  background: #ffd400;
  box-shadow: 0 0 8px rgba(255, 212, 0, 0.9);
}

#hitmarker.kill i {
  background: #ff3b4e;
  box-shadow: 0 0 10px rgba(255, 59, 78, 0.95);
}

#hitmarker i:nth-child(1) { transform: rotate(45deg) translateX(5px); }
#hitmarker i:nth-child(2) { transform: rotate(135deg) translateX(5px); }
#hitmarker i:nth-child(3) { transform: rotate(225deg) translateX(5px); }
#hitmarker i:nth-child(4) { transform: rotate(315deg) translateX(5px); }

#scope {
  position: fixed;
  inset: 0;
  opacity: 0;
  display: grid;
  place-items: center;
  transition: opacity 0.1s ease-out;
}

#scope.on {
  opacity: 1;
}

#scope .lens {
  position: relative;
  width: min(84vh, 84vw);
  height: min(84vh, 84vw);
  border-radius: 50%;
  border: 6px solid #090c12;
  overflow: hidden;
  box-shadow:
    0 0 0 100vmax rgba(3, 5, 10, 0.96),
    inset 0 0 42px rgba(0, 0, 0, 0.72),
    inset 0 0 3px rgba(120, 225, 255, 0.35);
}

#scope .reticle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#scope .scope-tag {
  position: absolute;
  bottom: 14%;
  padding: 3px 9px;
  border-radius: 5px;
  background: rgba(8, 12, 20, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.9px;
}

#scope .scope-zoom {
  left: 16%;
  color: var(--cyan);
}

#scope .scope-dist {
  right: 16%;
  color: #dfe8f6;
}

#scope .scope-dist.target {
  color: #ff4a5a;
  border-color: rgba(255, 74, 90, 0.6);
  background: rgba(35, 8, 14, 0.85);
}

#scope .scope-hint {
  position: absolute;
  top: 11%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: rgba(230, 240, 255, 0.65);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

#vignette,
#dmg-flash {
  position: fixed;
  inset: 0;
  opacity: 0;
}

#vignette {
  background: radial-gradient(circle, transparent 48%, rgba(200, 15, 25, 0.72) 100%);
  pointer-events: none;
}

@keyframes low-hp-pulse {
  0% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.02); }
  100% { opacity: 0.35; transform: scale(1); }
}

body.low-health #vignette {
  opacity: 1 !important;
  animation: low-hp-pulse 0.9s infinite ease-in-out;
  background: radial-gradient(circle, transparent 38%, rgba(220, 20, 35, 0.82) 100%);
}

#dmg-flash {
  background: rgba(255, 30, 40, 0.55);
}

#dmg-indicators {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
}

.dmg-ind {
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 12px;
  border-radius: 8px;
  background: linear-gradient(180deg, #ff2e43, rgba(255, 46, 67, 0.25));
  box-shadow: 0 0 12px rgba(255, 46, 67, 0.8);
}

#shield-note {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(76, 212, 255, 0.2);
  border: 1px solid rgba(76, 212, 255, 0.6);
  color: #b8f1ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  opacity: 0;
  transition: opacity 0.15s;
}

#shield-note.on {
  opacity: 1;
}

#topbar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: stretch;
  background: rgba(10, 15, 25, 0.78);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  backdrop-filter: blur(6px);
}

#topbar .ts {
  padding: 6px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  font-weight: 700;
}

#topbar .left {
  background: rgba(76, 212, 255, 0.14);
  font-size: 18px;
}

#topbar .right {
  background: rgba(255, 74, 90, 0.14);
  font-size: 15px;
}

#topbar .mid {
  min-width: 185px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

#timer {
  font-size: 19px;
  line-height: 1.1;
}

#mode-sub {
  font-size: 10px;
  letter-spacing: 0.8px;
  color: var(--muted);
}

#minimap {
  position: fixed;
  top: 16px;
  left: 16px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.55);
}

#fps {
  position: fixed;
  top: 174px;
  left: 16px;
  display: none;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(10, 15, 25, 0.75);
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
}

#killfeed {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.kf {
  padding: 5px 10px;
  border-radius: 7px;
  background: rgba(10, 15, 25, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: opacity 0.4s;
}

.kf.mine {
  border-color: rgba(255, 212, 0, 0.55);
  background: rgba(24, 22, 10, 0.85);
}

.kf.out {
  opacity: 0;
}

.kf em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

#streaks {
  position: fixed;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.streak-count {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 2px;
}

.streak-count b {
  color: var(--accent-2);
  font-size: 15px;
}

.streak {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(10, 15, 25, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.streak span {
  font-weight: 700;
  color: var(--text);
}

.streak.earned {
  border-color: rgba(255, 179, 71, 0.5);
  color: #ffe2b3;
}

.streak.live {
  border-color: var(--green);
  background: rgba(24, 60, 32, 0.72);
  color: var(--green);
}

#popup {
  position: fixed;
  left: 50%;
  bottom: 24%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
}

#popup b {
  font-size: 20px;
  color: #ffd400;
  letter-spacing: 1px;
}

#popup span {
  font-size: 13px;
  color: #fff;
}

#popup.pop {
  animation: popMsg 1.6s ease forwards;
}

#announce {
  position: fixed;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  opacity: 0;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.9);
}

#announce b {
  font-family: 'Black Ops One', cursive;
  font-size: 34px;
  letter-spacing: 2px;
  color: var(--accent-2);
}

#announce span {
  font-size: 15px;
  font-weight: 600;
}

#announce.pop {
  animation: popMsg 2.6s ease forwards;
}

@keyframes popMsg {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.95); }
  12% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  80% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -8px); }
}

#hint {
  position: fixed;
  left: 50%;
  top: calc(50% + 42px);
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #ffd400;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

#vitals {
  position: fixed;
  left: 20px;
  bottom: 20px;
  min-width: 220px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(10, 15, 25, 0.78);
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
}

.hp-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

#hp-num {
  font-size: 26px;
  color: var(--text);
}

.hp-bar {
  margin: 5px 0 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

#hp-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #35d66b, #8cff6b);
  transition: width 0.1s;
}

#hp-fill.low {
  background: linear-gradient(90deg, #ff2e43, #ff6c57);
}

#grenades {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-2);
}

#weapon-box {
  position: fixed;
  right: 20px;
  bottom: 20px;
  min-width: 240px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(10, 15, 25, 0.78);
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
  text-align: right;
}

#weapon-slots {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  margin-bottom: 6px;
}

#weapon-slots .slot {
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

#weapon-slots .slot b {
  margin-right: 4px;
  color: var(--text);
}

#weapon-slots .slot.active {
  background: rgba(255, 122, 26, 0.25);
  border: 1px solid var(--accent);
  color: #fff;
}

.ammo {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
}

#ammo-mag {
  font-size: 32px;
  line-height: 1;
}

#ammo-mag.empty {
  color: var(--red);
}

#ammo-res {
  font-size: 16px;
  color: var(--muted);
}

#weapon-name {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--cyan);
}

#scoreboard {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
  min-width: min(760px, 92vw);
  max-height: 75vh;
  overflow: auto;
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(9, 13, 22, 0.92);
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

#scoreboard.on {
  display: block;
}

#scoreboard h3,
.end-board h3 {
  margin: 0 0 12px;
  text-align: center;
  letter-spacing: 1.5px;
}

.sb-teams {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

#scoreboard table,
.end-board table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#scoreboard caption,
.end-board caption {
  font-weight: 700;
  letter-spacing: 1.4px;
  padding-bottom: 6px;
}

table.team0 caption { color: #5ab0ff; }
table.team1 caption { color: #ff6262; }

#scoreboard th, #scoreboard td,
.end-board th, .end-board td {
  padding: 7px 9px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#scoreboard th,
.end-board th {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
}

tr.me {
  background: rgba(255, 212, 0, 0.14);
  font-weight: 700;
}

tr.dead {
  opacity: 0.55;
}

#death-screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(25, 4, 8, 0.45);
}

#death-screen.on {
  display: flex;
}

.ds-title {
  font-family: 'Black Ops One', cursive;
  font-size: 46px;
  letter-spacing: 3px;
  color: var(--red);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

#death-killer {
  font-size: 20px;
  font-weight: 700;
}

#death-weapon,
#death-timer {
  font-size: 14px;
  color: #d6deeb;
}

/* ============================== OVERLAYS ============================== */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 9, 16, 0.78);
  backdrop-filter: blur(8px);
}

.dialog {
  width: 100%;
  max-width: 360px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

.dialog.wide {
  max-width: 780px;
  max-height: 90vh;
  overflow-y: auto;
}

.dialog h2 {
  margin: 0 0 6px;
  font-family: 'Black Ops One', cursive;
  letter-spacing: 1.5px;
}

.btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn.primary {
  border: none;
  background: linear-gradient(135deg, #ff8f2c, #ff6214);
  color: #160a02;
}

.muted {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.end-title {
  font-family: 'Black Ops One', cursive;
  font-size: 40px;
  letter-spacing: 2px;
  color: var(--accent-2);
}

.end-place {
  font-size: 15px;
  color: var(--muted);
}

.end-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.end-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px;
}

.end-stat span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
}

.end-stat b {
  font-size: 18px;
}

.end-xp {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}

.end-xp-row {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
}

#end-xpgain {
  color: var(--green);
}

#end-unlock {
  margin-top: 6px;
  font-size: 12px;
  color: var(--cyan);
}

.end-board {
  text-align: left;
  margin-top: 4px;
}

.end-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

/* ============================== FRIENDS / ROOM LOBBY ============================== */

.friends-box {
  background: linear-gradient(135deg, rgba(76, 212, 255, 0.08), rgba(255, 122, 26, 0.07));
  border: 1px solid rgba(76, 212, 255, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.friends-idle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.friends-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--cyan);
}

.friends-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}

.join-group {
  display: flex;
  gap: 6px;
  flex: 1;
  max-width: 360px;
  min-width: 220px;
}

.join-group input {
  flex: 1;
  min-width: 0;
  background: rgba(8, 12, 20, 0.8);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  outline: none;
}

.join-group input:focus {
  border-color: var(--cyan);
}

.btn.small {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 8px;
}

.btn.accent-tva {
  background: linear-gradient(135deg, rgba(43, 127, 255, 0.25), rgba(232, 72, 56, 0.28));
  border-color: rgba(255, 138, 76, 0.55);
  color: #fff2e8;
}

.btn.accent-tva:hover {
  border-color: #ff9f43;
  box-shadow: 0 0 14px rgba(255, 138, 76, 0.28);
}

.btn.accent-gg {
  background: linear-gradient(135deg, rgba(255, 212, 0, 0.22), rgba(168, 85, 247, 0.24));
  border-color: rgba(255, 212, 0, 0.5);
  color: #fff6cf;
}

.btn.accent-gg:hover {
  border-color: #ffd400;
  box-shadow: 0 0 14px rgba(255, 212, 0, 0.25);
}

.room-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.room-badge-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.room-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--muted);
}

.room-code {
  font-family: 'Black Ops One', cursive;
  font-size: 20px;
  letter-spacing: 2.5px;
  color: var(--accent-2);
  background: rgba(8, 12, 20, 0.78);
  border: 1px solid rgba(255, 179, 71, 0.45);
  padding: 2px 10px;
  border-radius: 7px;
}

.copy-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.copy-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}

.copy-btn.accent {
  border-color: rgba(76, 212, 255, 0.5);
  background: rgba(76, 212, 255, 0.16);
  color: #e6fbff;
}

.copy-btn.danger {
  border-color: rgba(255, 74, 90, 0.45);
  background: rgba(255, 74, 90, 0.14);
  color: #ffc5cb;
}

.room-members {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.member-pill {
  border: 1px solid var(--border);
  background: rgba(10, 15, 25, 0.78);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: default;
}

.member-pill[title] {
  cursor: pointer;
}

.member-pill.host {
  border-color: rgba(255, 179, 71, 0.45);
}

.member-pill.team0 {
  border-color: rgba(90, 176, 255, 0.55);
}

.member-pill.team1 {
  border-color: rgba(255, 98, 98, 0.55);
}

.member-pill em {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
}

.member-pill.team0 em { color: #5ab0ff; }
.member-pill.team1 em { color: #ff6262; }

.member-pill small {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-2);
}

.room-status {
  margin-top: 7px;
  font-size: 12px;
  color: var(--cyan);
}

.room-status:empty {
  display: none;
}

.room-status.err {
  color: #ff7a86;
}

.play-locked {
  opacity: 0.65;
  pointer-events: none;
}

.deploy:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(0.4);
  transform: none;
}

.pause-room {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(76, 212, 255, 0.1);
  border: 1px solid rgba(76, 212, 255, 0.3);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 13px;
}

.room-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.room-mode-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.room-mode-pill {
  background: rgba(12, 18, 28, 0.85);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.room-mode-pill:not(:disabled):hover {
  border-color: var(--cyan);
  color: var(--text);
}

.room-mode-pill.active {
  background: rgba(255, 122, 26, 0.18);
  border-color: var(--accent);
  color: #fff;
}

.room-mode-pill:disabled {
  cursor: default;
}

.room-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.room-meta-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(76, 212, 255, 0.1);
  border: 1px solid rgba(76, 212, 255, 0.25);
  color: var(--cyan);
}

.room-meta-tag.mut {
  background: rgba(255, 212, 0, 0.12);
  border-color: rgba(255, 212, 0, 0.35);
  color: #ffe875;
}

.end-client-note {
  margin-top: 8px;
  font-size: 13px;
  color: var(--cyan);
}

.play-choice {
  padding: 14px 4px 8px;
}

.play-choice-head {
  margin-bottom: 14px;
}

.play-choice-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.play-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.choice-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 20px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(155deg, rgba(16, 24, 38, 0.92), rgba(10, 15, 24, 0.96));
  text-align: left;
  transition: transform 0.14s, border-color 0.14s, box-shadow 0.14s;
}

.choice-card:hover {
  transform: translateY(-2px);
}

.choice-card.bots:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 26px rgba(255, 122, 26, 0.16);
}

.choice-card.global {
  background: linear-gradient(155deg, rgba(14, 34, 28, 0.94), rgba(10, 22, 18, 0.96));
  border-color: rgba(52, 211, 153, 0.4);
}

.choice-card.global:hover {
  border-color: #34d399;
  box-shadow: 0 10px 26px rgba(52, 211, 153, 0.22);
}

.choice-badge.global-badge {
  background: rgba(52, 211, 153, 0.16);
  color: #34d399;
}

.choice-card.friends {
  background: linear-gradient(155deg, rgba(16, 30, 44, 0.92), rgba(12, 18, 30, 0.96));
  border-color: rgba(76, 212, 255, 0.35);
}

.choice-card.friends:hover {
  border-color: var(--cyan);
  box-shadow: 0 10px 26px rgba(76, 212, 255, 0.18);
}

.choice-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 122, 26, 0.16);
  color: var(--accent);
}

.choice-card.friends .choice-badge {
  background: rgba(76, 212, 255, 0.16);
  color: var(--cyan);
}

.choice-card strong {
  font-size: 20px;
  color: #fff;
}

.choice-card > span:last-child {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.play-flow-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(12, 18, 28, 0.72);
  border: 1px solid var(--border);
}

.play-flow-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.play-flow-mode {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent);
}

.play-flow-mode.friends {
  color: var(--cyan);
}

.play-flow-mode.global {
  color: #34d399;
}

.friends-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 700px) {
  .play-choice-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .menu-body {
    grid-template-columns: 1fr;
  }
  .tabs {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .cards.modes,
  .cards.maps,
  .opts,
  .career,
  .settings,
  .controls,
  .loadout-grid,
  .sb-teams,
  .end-stats {
    grid-template-columns: 1fr 1fr;
  }
  .loadout-grid,
  .sb-teams {
    grid-template-columns: 1fr;
  }
}

#tag-modal {
  z-index: 40;
}

.tag-dialog {
  max-width: 400px;
  gap: 12px;
}

.tag-dialog .choice-badge {
  align-self: center;
}

.tag-input {
  width: 100%;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.tag-input:focus {
  border-color: var(--cyan);
}

/* ============================================================
   MOBILE TOUCH CONTROLS & RESPONSIVE HUD
   ============================================================ */

body.touch-ui #game {
  touch-action: none;
}

#touch-controls {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

body.touch-ui:not(.game-paused) #touch-controls {
  display: block;
}

.touch-zone {
  position: fixed;
  pointer-events: auto;
  touch-action: none;
}

#joystick-zone {
  left: 0;
  bottom: 0;
  width: 44vw;
  max-width: 240px;
  height: 46vh;
  max-height: 235px;
  z-index: 5;
}

#look-zone {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 62vw;
  z-index: 2;
  pointer-events: auto;
  touch-action: none;
}

#autofire-indicator {
  display: none;
  position: fixed;
  left: 50%;
  top: calc(50% + 22px);
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ff3838;
  background: rgba(255, 56, 56, 0.15);
  border: 1px solid rgba(255, 56, 56, 0.5);
  padding: 1px 6px;
  border-radius: 4px;
  text-shadow: 0 0 8px rgba(255, 56, 56, 0.8);
  pointer-events: none;
  user-select: none;
  z-index: 10;
}

body.auto-firing #autofire-indicator {
  display: block;
}

body.auto-firing #crosshair i {
  background: #ff3838 !important;
  box-shadow: 0 0 10px rgba(255, 56, 56, 0.95) !important;
}

body.auto-firing #crosshair .dot {
  background: #ff3838 !important;
  box-shadow: 0 0 12px rgba(255, 56, 56, 1) !important;
  transform: scale(1.4);
}

#joystick-base {
  position: absolute;
  left: calc(env(safe-area-inset-left, 0px) + 74px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 74px);
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(10, 15, 25, 0.25);
  transform: translate(-50%, 50%);
  pointer-events: none;
  opacity: 0.55;
  transition: opacity 0.12s, border-color 0.12s;
}

#joystick-knob {
  position: absolute;
  left: calc(env(safe-area-inset-left, 0px) + 74px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 74px);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.26);
  border: 2px solid rgba(255, 255, 255, 0.55);
  transform: translate(-50%, 50%);
  pointer-events: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  opacity: 0.72;
}

#joystick-zone.active #joystick-base {
  opacity: 0.95;
  border-color: rgba(76, 212, 255, 0.55);
  transform: translate(-50%, -50%);
  bottom: auto;
}

#joystick-zone.active #joystick-knob {
  opacity: 1;
  transform: translate(-50%, -50%);
  bottom: auto;
  background: rgba(76, 212, 255, 0.38);
  border-color: var(--cyan);
}

#joystick-zone.sprinting #joystick-knob {
  background: rgba(255, 122, 26, 0.45);
  border-color: var(--accent);
}

.tc-btn {
  position: fixed;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.24);
  background: rgba(10, 15, 25, 0.52);
  color: #fff;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 0;
  touch-action: none;
  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(4px);
  user-select: none;
  -webkit-user-select: none;
}

.tc-btn svg {
  width: 52%;
  height: 52%;
  pointer-events: none;
}

.tc-btn.pressed,
.tc-btn.active {
  border-color: var(--cyan);
  background: rgba(76, 212, 255, 0.28);
  box-shadow: 0 0 14px rgba(76, 212, 255, 0.35);
}

/* Ergonomic competitive mobile layout */
.tc-btn.fire {
  width: 74px;
  height: 74px;
  right: calc(env(safe-area-inset-right, 0px) + 20px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 36px);
  background: radial-gradient(circle at 40% 40%, rgba(255, 75, 85, 0.65), rgba(200, 30, 42, 0.55));
  border-color: rgba(255, 110, 120, 0.8);
}

.tc-btn.fire.pressed {
  background: radial-gradient(circle at 40% 40%, rgba(255, 90, 100, 0.88), rgba(230, 40, 52, 0.8));
  border-color: #fff;
  box-shadow: 0 0 20px rgba(255, 74, 90, 0.75);
}

.tc-btn.fire-left {
  width: 56px;
  height: 56px;
  left: calc(env(safe-area-inset-left, 0px) + 18px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 184px);
  background: radial-gradient(circle at 40% 40%, rgba(255, 75, 85, 0.55), rgba(200, 30, 42, 0.45));
  border-color: rgba(255, 110, 120, 0.75);
}

.tc-btn.fire-left.pressed {
  background: radial-gradient(circle at 40% 40%, rgba(255, 90, 100, 0.88), rgba(230, 40, 52, 0.8));
  border-color: #fff;
  box-shadow: 0 0 18px rgba(255, 74, 90, 0.65);
}

.tc-btn.ads {
  width: 52px;
  height: 52px;
  right: calc(env(safe-area-inset-right, 0px) + 106px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 40px);
}

.tc-btn.ads.active {
  border-color: var(--accent);
  background: rgba(255, 122, 26, 0.36);
  box-shadow: 0 0 14px rgba(255, 122, 26, 0.45);
}

.tc-btn.jump {
  width: 52px;
  height: 52px;
  right: calc(env(safe-area-inset-right, 0px) + 24px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 122px);
}

.tc-btn.crouch {
  width: 48px;
  height: 48px;
  right: calc(env(safe-area-inset-right, 0px) + 94px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 110px);
  font-size: 11px;
}

.tc-btn.reload {
  width: 44px;
  height: 44px;
  right: calc(env(safe-area-inset-right, 0px) + 26px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 186px);
  font-size: 16px;
}

.tc-btn.grenade {
  width: 42px;
  height: 42px;
  right: calc(env(safe-area-inset-right, 0px) + 84px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 172px);
  font-size: 10px;
}

.tc-btn.swap {
  width: 54px;
  height: 34px;
  border-radius: 12px;
  right: calc(env(safe-area-inset-right, 0px) + 170px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  font-size: 17px;
}

.tc-btn.sprint {
  width: 42px;
  height: 42px;
  left: calc(env(safe-area-inset-left, 0px) + 18px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 124px);
  font-size: 10px;
}

.tc-btn.sprint.active {
  border-color: var(--accent);
  background: rgba(255, 122, 26, 0.34);
  color: #fff;
}

.tc-btn.autofire {
  width: auto;
  min-width: 76px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  right: calc(env(safe-area-inset-right, 0px) + 16px);
  top: calc(env(safe-area-inset-top, 0px) + 54px);
  bottom: auto;
  left: auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tc-btn.autofire.active {
  border-color: var(--cyan);
  background: rgba(76, 212, 255, 0.28);
  box-shadow: 0 0 12px rgba(76, 212, 255, 0.4);
  color: #e6fbff;
}

.tc-btn.autofire.firing {
  border-color: #ff3838;
  background: rgba(255, 56, 56, 0.55);
  box-shadow: 0 0 16px rgba(255, 56, 56, 0.75);
  color: #fff;
  animation: afPulse 0.4s infinite alternate;
}

@keyframes afPulse {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

.tc-btn.scope-zoom-btn {
  width: auto;
  min-width: 54px;
  height: 36px;
  padding: 0 11px;
  border-radius: 999px;
  right: calc(env(safe-area-inset-right, 0px) + 140px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 174px);
  border-color: rgba(76, 212, 255, 0.65);
  color: var(--cyan);
  background: rgba(8, 12, 20, 0.82);
}

/* Top-right utility buttons (Scoreboard + Pause) */
.tc-btn.mpause,
.tc-btn.mscore {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
}

.tc-btn.mpause {
  right: calc(env(safe-area-inset-right, 0px) + 8px);
  font-size: 17px;
}

.tc-btn.mscore {
  right: calc(env(safe-area-inset-right, 0px) + 52px);
}

/* Make HUD bars interactable cleanly when touch controls are enabled */
body.touch-ui #topbar {
  z-index: 6;
  pointer-events: auto;
  cursor: pointer;
}

body.touch-ui #weapon-box {
  z-index: 6;
}

body.touch-ui #weapon-slots .slot {
  pointer-events: auto;
  cursor: pointer;
}

body.touch-ui #scoreboard.on {
  z-index: 15;
  pointer-events: auto;
}

body.touch-ui .scope-hint {
  display: none;
}

/* ==========================================================================
   MOBILE COMPETITIVE CROSSHAIR — HIGH PRECISION & PINPOINT ACCURACY
   ========================================================================== */
body.touch-ui #crosshair {
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 25;
}

@media (pointer: coarse) {
  #crosshair {
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 25;
  }
}

/* Base outline & shadows for all crosshair components on mobile */
body.touch-ui #crosshair i {
  background: var(--xhair);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.95), 0 0 3px rgba(0, 0, 0, 0.85);
}

@media (pointer: coarse) {
  #crosshair i {
    background: var(--xhair);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.95), 0 0 3px rgba(0, 0, 0, 0.85);
  }
}

/* 1. Center Precision Dot — 5px laser core with crisp dark border ("To the point") */
body.touch-ui #crosshair .dot {
  width: 5px;
  height: 5px;
  left: -2.5px;
  top: -2.5px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 20%, var(--xhair) 65%);
  box-shadow: 0 0 0 1.2px #000000, 0 0 4px rgba(0, 0, 0, 0.9);
  transition: transform 0.08s ease, background 0.08s ease;
}

@media (pointer: coarse) {
  #crosshair .dot {
    width: 5px;
    height: 5px;
    left: -2.5px;
    top: -2.5px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffffff 20%, var(--xhair) 65%);
    box-shadow: 0 0 0 1.2px #000000, 0 0 4px rgba(0, 0, 0, 0.9);
    transition: transform 0.08s ease, background 0.08s ease;
  }
}

/* 2. Precision Crosshair Ticks — 2.5px solid width with high-contrast borders */
body.touch-ui #crosshair .l,
body.touch-ui #crosshair .r {
  width: 9.5px;
  height: 2.5px;
  top: -1.25px;
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.95), 0 1px 3px rgba(0, 0, 0, 0.7);
}

@media (pointer: coarse) {
  #crosshair .l,
  #crosshair .r {
    width: 9.5px;
    height: 2.5px;
    top: -1.25px;
    border-radius: 1px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.95), 0 1px 3px rgba(0, 0, 0, 0.7);
  }
}

body.touch-ui #crosshair .t,
body.touch-ui #crosshair .b {
  width: 2.5px;
  height: 9.5px;
  left: -1.25px;
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.95), 0 1px 3px rgba(0, 0, 0, 0.7);
}

@media (pointer: coarse) {
  #crosshair .t,
  #crosshair .b {
    width: 2.5px;
    height: 9.5px;
    left: -1.25px;
    border-radius: 1px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.95), 0 1px 3px rgba(0, 0, 0, 0.7);
  }
}

/* Clamp spread gap on mobile so reticle stays tight around the center point */
body.touch-ui #crosshair .l { right: clamp(6px, var(--gap), 18px); }
body.touch-ui #crosshair .r { left: clamp(6px, var(--gap), 18px); }
body.touch-ui #crosshair .t { bottom: clamp(6px, var(--gap), 18px); }
body.touch-ui #crosshair .b { top: clamp(6px, var(--gap), 18px); }

@media (pointer: coarse) {
  #crosshair .l { right: clamp(6px, var(--gap), 18px); }
  #crosshair .r { left: clamp(6px, var(--gap), 18px); }
  #crosshair .t { bottom: clamp(6px, var(--gap), 18px); }
  #crosshair .b { top: clamp(6px, var(--gap), 18px); }
}

/* 3. Tactical Concentric Target Ring — provides clear peripheral hitbox framing */
body.touch-ui #crosshair::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: -11px;
  top: -11px;
  border-radius: 50%;
  border: 1.2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.65), inset 0 0 4px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  transition: transform 0.1s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.1s ease, box-shadow 0.1s ease;
}

@media (pointer: coarse) {
  #crosshair::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: -11px;
    top: -11px;
    border-radius: 50%;
    border: 1.2px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.65), inset 0 0 4px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    transition: transform 0.1s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.1s ease, box-shadow 0.1s ease;
  }
}

/* 4. ADS Aim-Down-Sights on Mobile — Pure CQB Reflex Dot (Unobstructed View) */
body.touch-ui #crosshair[data-mode="dot"] .dot {
  width: 6px;
  height: 6px;
  left: -3px;
  top: -3px;
  box-shadow: 0 0 0 1.5px #000000, 0 0 8px var(--xhair);
  transform: scale(1.15);
}

@media (pointer: coarse) {
  #crosshair[data-mode="dot"] .dot {
    width: 6px;
    height: 6px;
    left: -3px;
    top: -3px;
    box-shadow: 0 0 0 1.5px #000000, 0 0 8px var(--xhair);
    transform: scale(1.15);
  }
}

body.touch-ui #crosshair[data-mode="dot"]::before {
  width: 14px;
  height: 14px;
  left: -7px;
  top: -7px;
  border-color: rgba(255, 255, 255, 0.6);
}

@media (pointer: coarse) {
  #crosshair[data-mode="dot"]::before {
    width: 14px;
    height: 14px;
    left: -7px;
    top: -7px;
    border-color: rgba(255, 255, 255, 0.6);
  }
}

/* 5. Auto-Firing / Enemy Lock-On Feedback on Mobile */
body.touch-ui.auto-firing #crosshair::before {
  border-color: #ff3333;
  transform: scale(0.88);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.9), 0 0 10px rgba(255, 51, 51, 0.95);
}

@media (pointer: coarse) {
  body.auto-firing #crosshair::before {
    border-color: #ff3333;
    transform: scale(0.88);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.9), 0 0 10px rgba(255, 51, 51, 0.95);
  }
}

body.touch-ui.auto-firing #crosshair i {
  background: #ff3333 !important;
  box-shadow: 0 0 0 1px #000000, 0 0 8px rgba(255, 51, 51, 1) !important;
}

@media (pointer: coarse) {
  body.auto-firing #crosshair i {
    background: #ff3333 !important;
    box-shadow: 0 0 0 1px #000000, 0 0 8px rgba(255, 51, 51, 1) !important;
  }
}

body.touch-ui.auto-firing #crosshair .dot {
  background: radial-gradient(circle, #ffffff 15%, #ff2222 65%) !important;
  box-shadow: 0 0 0 1.5px #000000, 0 0 12px rgba(255, 34, 34, 1) !important;
  transform: scale(1.4);
}

@media (pointer: coarse) {
  body.auto-firing #crosshair .dot {
    background: radial-gradient(circle, #ffffff 15%, #ff2222 65%) !important;
    box-shadow: 0 0 0 1.5px #000000, 0 0 12px rgba(255, 34, 34, 1) !important;
    transform: scale(1.4);
  }
}

/* Contract ticks tightly inwards on enemy lock-on */
body.touch-ui.auto-firing #crosshair .l { right: 5px !important; }
body.touch-ui.auto-firing #crosshair .r { left: 5px !important; }
body.touch-ui.auto-firing #crosshair .t { bottom: 5px !important; }
body.touch-ui.auto-firing #crosshair .b { top: 5px !important; }

@media (pointer: coarse) {
  body.auto-firing #crosshair .l { right: 5px !important; }
  body.auto-firing #crosshair .r { left: 5px !important; }
  body.auto-firing #crosshair .t { bottom: 5px !important; }
  body.auto-firing #crosshair .b { top: 5px !important; }
}

/* Touch HUD compact adjustments (works on phones in portrait & landscape) */
body.touch-ui #minimap {
  width: 90px;
  height: 90px;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: calc(env(safe-area-inset-left, 0px) + 8px);
}

body.touch-ui #fps {
  top: calc(env(safe-area-inset-top, 0px) + 104px);
  left: calc(env(safe-area-inset-left, 0px) + 8px);
  font-size: 10px;
  padding: 2px 6px;
}

body.touch-ui #killfeed {
  top: calc(env(safe-area-inset-top, 0px) + 54px);
  right: calc(env(safe-area-inset-right, 0px) + 8px);
  gap: 4px;
}

body.touch-ui .kf {
  font-size: 11px;
  padding: 3px 7px;
}

body.touch-ui #topbar {
  top: calc(env(safe-area-inset-top, 0px) + 6px);
}

body.touch-ui #topbar .ts {
  padding: 4px 8px;
  min-width: 44px;
}

body.touch-ui #topbar .mid {
  min-width: 104px;
}

body.touch-ui #timer {
  font-size: 15px;
}

body.touch-ui #topbar .left {
  font-size: 15px;
}

body.touch-ui #topbar .right {
  font-size: 13px;
}

body.touch-ui #mode-sub {
  font-size: 9px;
}

body.touch-ui #shield-note {
  top: calc(env(safe-area-inset-top, 0px) + 54px);
}

body.touch-ui #announce b {
  font-size: 24px;
}

body.touch-ui #announce span {
  font-size: 13px;
}

body.touch-ui #popup {
  bottom: 32%;
}

body.touch-ui #popup b {
  font-size: 16px;
}

/* Portrait / narrow touch screens: Vitals + Weapon Box safely above thumb controls */
@media (max-width: 720px) {
  body.touch-ui #minimap {
    width: 78px;
    height: 78px;
  }

  body.touch-ui #topbar .ts {
    min-width: 36px;
    padding: 3px 7px;
  }

  body.touch-ui #topbar .mid {
    min-width: 90px;
  }

  body.touch-ui #killfeed {
    top: calc(env(safe-area-inset-top, 0px) + 94px);
    left: calc(env(safe-area-inset-left, 0px) + 8px);
    right: auto;
    align-items: flex-start;
    max-width: 48vw;
  }

  body.touch-ui #streaks {
    top: calc(env(safe-area-inset-top, 0px) + 94px);
    right: calc(env(safe-area-inset-right, 0px) + 8px);
    left: auto;
    transform: none;
    align-items: flex-end;
  }

  body.touch-ui .streak {
    font-size: 10px;
    padding: 2px 6px;
  }

  body.touch-ui #vitals {
    left: calc(env(safe-area-inset-left, 0px) + 10px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 252px);
    min-width: 146px;
    padding: 8px 10px;
  }

  body.touch-ui #hp-num {
    font-size: 20px;
  }

  body.touch-ui #grenades {
    font-size: 11px;
  }

  body.touch-ui #weapon-box {
    right: calc(env(safe-area-inset-right, 0px) + 10px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 252px);
    min-width: 162px;
    padding: 8px 10px;
  }

  body.touch-ui #weapon-slots {
    gap: 3px;
    margin-bottom: 4px;
  }

  body.touch-ui #weapon-slots .slot {
    font-size: 10px;
    padding: 2px 5px;
    max-width: 56px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.touch-ui #ammo-mag {
    font-size: 24px;
  }

  body.touch-ui #ammo-res {
    font-size: 13px;
  }

  body.touch-ui #weapon-name {
    font-size: 10px;
  }

  body.touch-ui #death-screen {
    padding-bottom: 130px;
  }

  body.touch-ui .ds-title {
    font-size: 32px;
  }
}

/* Landscape phones (wide & short viewport): Vitals + Weapon Box centered between thumbs */
@media (max-height: 540px) {
  body.touch-ui #minimap {
    width: 80px;
    height: 80px;
  }

  body.touch-ui #streaks {
    top: calc(env(safe-area-inset-top, 0px) + 52px);
    left: calc(env(safe-area-inset-left, 0px) + 98px);
    right: auto;
    transform: none;
    flex-direction: row;
    flex-wrap: wrap;
    max-width: calc(100vw - 260px);
  }

  body.touch-ui .streak-count {
    margin-bottom: 0;
    margin-right: 4px;
    align-self: center;
  }

  body.touch-ui #vitals {
    left: calc(50% - 144px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
    width: 140px;
    min-width: 0;
    padding: 6px 10px;
  }

  body.touch-ui #hp-num {
    font-size: 18px;
  }

  body.touch-ui #weapon-box {
    left: calc(50% + 4px);
    right: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
    width: 168px;
    max-width: 168px;
    min-width: 0;
    padding: 6px 10px;
    text-align: left;
  }

  body.touch-ui #weapon-slots {
    justify-content: flex-start;
    gap: 3px;
    margin-bottom: 4px;
  }

  body.touch-ui #weapon-slots .slot {
    font-size: 10px;
    padding: 2px 4px;
    max-width: 50px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.touch-ui .ammo {
    justify-content: flex-start;
  }

  body.touch-ui #ammo-mag {
    font-size: 22px;
  }

  body.touch-ui #scope .scope-tag {
    bottom: 27%;
  }

  body.touch-ui .tc-btn.scope-zoom-btn {
    right: calc(env(safe-area-inset-right, 0px) + 136px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 158px);
  }

  body.touch-ui .tc-btn.fire {
    width: 62px;
    height: 62px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 46px);
  }

  body.touch-ui .tc-btn.jump {
    width: 48px;
    height: 48px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 120px);
  }

  body.touch-ui .tc-btn.grenade {
    width: 42px;
    height: 42px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 178px);
  }

  body.touch-ui .tc-btn.ads {
    width: 46px;
    height: 46px;
    right: calc(env(safe-area-inset-right, 0px) + 94px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 50px);
  }

  body.touch-ui .tc-btn.crouch {
    width: 44px;
    height: 44px;
    right: calc(env(safe-area-inset-right, 0px) + 84px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 108px);
  }

  body.touch-ui .tc-btn.reload {
    width: 42px;
    height: 42px;
    right: calc(env(safe-area-inset-right, 0px) + 80px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 162px);
  }

  body.touch-ui .tc-btn.sprint {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 150px);
  }

  body.touch-ui .tc-btn.autofire {
    right: calc(env(safe-area-inset-right, 0px) + 130px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 104px);
    left: auto;
  }

  body.touch-ui #death-screen {
    padding-bottom: 64px;
  }
}

/* ============================================================
   MOBILE MENU & MODAL RESPONSIVENESS
   ============================================================ */

@media (max-width: 900px) {
  #menu {
    padding: 12px 14px 10px;
    height: 100dvh;
  }

  .menu-top {
    margin-bottom: 10px;
  }

  .logo {
    font-size: 28px;
  }

  .menu-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 10px;
  }

  .tabs {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 2px;
  }

  .tab {
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: 12px;
    text-align: center;
  }

  .tab.active {
    box-shadow: inset 0 -2px 0 var(--accent);
  }

  .panels {
    padding: 14px;
    -webkit-overflow-scrolling: touch;
  }

  .weapon-list {
    max-height: 220px;
  }

  .camos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .logo {
    font-size: 23px;
  }

  .tab {
    flex: 1 0 auto;
    padding: 7px 8px;
    font-size: 11px;
    letter-spacing: 0.4px;
  }

  .player-chip {
    min-width: 0;
    padding: 6px 10px;
    gap: 8px;
  }

  .player-chip .lvl {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .chip-name {
    font-size: 13px;
    max-width: 110px;
  }

  .cards.modes,
  .cards.maps,
  .opts,
  .career,
  .settings,
  .controls {
    grid-template-columns: 1fr;
  }

  .join-group {
    min-width: 0;
    width: 100%;
    max-width: none;
  }

  .deploy-row {
    flex-direction: column;
    align-items: stretch;
  }

  .deploy {
    width: 100%;
    justify-content: center;
  }

  .play-flow-bar {
    flex-wrap: wrap;
  }

  .end-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .end-title {
    font-size: 28px;
  }

  .end-actions {
    flex-direction: column;
  }

  .dialog {
    padding: 18px 16px;
  }

  #scoreboard {
    padding: 12px 10px;
    max-height: 78vh;
  }

  #scoreboard th,
  #scoreboard td {
    padding: 5px 4px;
    font-size: 11px;
  }

  .menu-foot {
    display: none;
  }
}

@media (max-height: 540px) {
  #menu {
    padding: 8px 14px;
  }

  .menu-top {
    margin-bottom: 6px;
  }

  .logo {
    font-size: 22px;
  }

  .menu-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 6px;
  }

  .tabs {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
  }

  .tab {
    padding: 6px 10px;
    font-size: 11px;
  }

  .panels {
    padding: 12px;
  }

  .dialog.wide {
    max-height: 92dvh;
    padding: 14px;
  }

  .menu-foot {
    display: none;
  }
}

/* ============================================================
   PRE-MATCH COOLDOWN & TEAM SELECTION
   ============================================================ */

.opt-team-section {
  margin-bottom: 12px;
}

.opt-team-section h2 {
  margin: 0 0 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.seg.team-seg {
  display: flex;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
}

.seg.team-seg button {
  flex: 1;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.seg.team-seg button.team-btn-at.active {
  background: rgba(90, 176, 255, 0.22);
  border-color: #5ab0ff;
  color: #c9e6ff;
  box-shadow: 0 0 12px rgba(90, 176, 255, 0.3);
}

.seg.team-seg button.team-btn-t.active {
  background: rgba(255, 98, 98, 0.22);
  border-color: #ff6262;
  color: #ffd0d0;
  box-shadow: 0 0 12px rgba(255, 98, 98, 0.3);
}

/* Cooldown Modal */
.cooldown-dialog {
  max-width: 720px;
  width: 95%;
  max-height: 92vh;
  overflow-y: auto;
  background: rgba(10, 14, 22, 0.94);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85), 0 0 40px rgba(76, 212, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.cd-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.cd-mode-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
  background: rgba(255, 122, 26, 0.15);
  border: 1px solid rgba(255, 122, 26, 0.35);
  padding: 4px 14px;
  border-radius: 999px;
}

.cd-timer-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 4px 0;
}

.cd-timer-count {
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 900;
  color: #ffd400;
  line-height: 1;
  text-shadow: 0 0 20px rgba(255, 212, 0, 0.5);
  animation: cdPulse 1s ease-in-out infinite;
}

@keyframes cdPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.cd-timer-sub {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 2.5px;
  color: var(--muted);
  font-weight: 700;
}

.cd-progress-bar {
  width: 100%;
  max-width: 320px;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin: 2px 0;
}

.cd-progress-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), #ffd400);
  border-radius: 999px;
  transition: width 0.06s linear;
}

.cd-subtitle {
  font-size: 13px;
  margin: 0;
}

/* Teams Grid */
.cd-teams-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  text-align: left;
}

.cd-team-card {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.cd-team-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.06);
}

.cd-team-card.cd-team-at.active {
  border-color: #5ab0ff;
  background: rgba(90, 176, 255, 0.12);
  box-shadow: 0 0 24px rgba(90, 176, 255, 0.35);
}

.cd-team-card.cd-team-t.active {
  border-color: #ff6262;
  background: rgba(255, 98, 98, 0.12);
  box-shadow: 0 0 24px rgba(255, 98, 98, 0.35);
}

.cd-team-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cd-team-icon {
  font-size: 26px;
}

.cd-team-meta {
  flex: 1;
}

.cd-team-meta h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
}

.cd-team-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.8px;
}

.cd-team-badge.at {
  background: rgba(90, 176, 255, 0.25);
  color: #5ab0ff;
  border: 1px solid rgba(90, 176, 255, 0.4);
}

.cd-team-badge.t {
  background: rgba(255, 98, 98, 0.25);
  color: #ff6262;
  border: 1px solid rgba(255, 98, 98, 0.4);
}

.cd-team-check {
  font-size: 18px;
  font-weight: 900;
  color: #5ab0ff;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.cd-team-card.active .cd-team-check {
  opacity: 1;
}

.cd-team-card.cd-team-t.active .cd-team-check {
  color: #ff6262;
}

.cd-team-weapons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cd-weapon-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

/* Roster Slots */
.cd-team-roster {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 8px;
}

.cd-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 6px;
  color: #ddd;
}

.cd-slot.you {
  background: rgba(255, 212, 0, 0.14);
  border: 1px solid rgba(255, 212, 0, 0.4);
  color: #fff;
  font-weight: 700;
}

.slot-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  background: #5ab0ff;
  color: #04101e;
}

.slot-tag.you-t {
  background: #ff6262;
  color: #fff;
}

.slot-tag.bot {
  background: rgba(255, 255, 255, 0.12);
  color: var(--muted);
}

.slot-role {
  margin-left: auto;
  font-size: 10px;
  color: #ffd400;
  text-transform: uppercase;
}

.cd-team-btn {
  width: 100%;
  padding: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  border-radius: 8px;
}

.cd-team-at.active .cd-team-btn {
  background: #5ab0ff;
  color: #04101e;
  border-color: #5ab0ff;
}

.cd-team-t.active .cd-team-btn {
  background: #ff6262;
  color: #fff;
  border-color: #ff6262;
}

/* Footer */
.cd-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
}

.cd-deploy-btn {
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
}

.cd-cancel-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--muted);
  padding: 12px 18px;
}

.cd-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.cd-hint {
  font-size: 11px;
  color: var(--muted);
}

@media (max-width: 680px) {
  .cooldown-dialog {
    padding: 16px;
    gap: 12px;
  }

  .cd-teams-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .cd-timer-count {
    font-size: 38px;
  }

  .cd-team-card {
    padding: 12px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .cooldown-dialog {
    max-height: 96vh;
    padding: 10px 16px;
    gap: 8px;
  }

  .cd-header {
    gap: 2px;
  }

  .cd-mode-badge {
    font-size: 10px;
    padding: 2px 10px;
  }

  .cd-timer-wrap {
    margin: 0;
    gap: 6px;
  }

  .cd-timer-count {
    font-size: 26px;
  }

  .cd-timer-sub {
    font-size: 10px;
    letter-spacing: 1.5px;
  }

  .cd-progress-bar {
    height: 4px;
    max-width: 220px;
  }

  .cd-subtitle {
    display: none;
  }

  .cd-teams-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px;
  }

  .cd-team-card {
    padding: 8px 10px;
    gap: 6px;
  }

  .cd-team-icon {
    font-size: 18px;
  }

  .cd-team-meta h3 {
    font-size: 12px;
  }

  .cd-team-badge {
    font-size: 9px;
    padding: 1px 5px;
  }

  .cd-team-weapons {
    display: none;
  }

  .cd-team-roster {
    gap: 3px;
    padding: 4px 6px;
  }

  .cd-slot {
    font-size: 11px;
    padding: 2px 4px;
  }

  .cd-team-btn {
    padding: 6px;
    font-size: 11px;
  }

  .cd-footer {
    margin-top: 0;
    gap: 8px;
  }

  .cd-deploy-btn {
    padding: 8px 18px;
    font-size: 13px;
  }

  .cd-cancel-btn {
    padding: 8px 14px;
    font-size: 12px;
  }

  .cd-hint {
    display: none;
  }
}

/* Auto-Fire setting row is dedicated to Mobile & Tablet touch devices */
#s-autofire-row {
  display: none;
}
body.touch-ui #s-autofire-row {
  display: flex;
}


