:root {
  --vh: 1vh;

  --bg0: #160914;
  --bg1: #5a243d;
  --panel: rgba(58, 20, 34, 0.86);
  --panel2: rgba(91, 30, 43, 0.92);
  --panel3: rgba(8, 24, 42, 0.78);

  --tq: #2ef3e0;
  --tq2: #19d9ff;
  --vi: #9a78ff;
  --vi2: #d34fff;
  --gold: #ffd166;
  --red: #ff4d5f;

  --ink: rgba(255, 249, 235, 0.96);
  --ink2: rgba(241, 233, 255, 0.78);
  --line: rgba(46, 243, 224, 0.42);
  --line2: rgba(255, 77, 95, 0.42);

  --btn: linear-gradient(135deg, #ff4d5f 0%, #ff8a3d 48%, #ffd166 100%);
  --btnShadow: rgba(66, 8, 25, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 177, 90, 0.26), transparent 45%),
    radial-gradient(circle at 70% 30%, rgba(226, 56, 63, 0.22), transparent 55%),
    var(--bg0);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  user-select: none;
}

body {
  touch-action: none;
}

canvas {
  display: block;
}

body,
#game-root {
  width: 100vw;
  height: calc(var(--vh) * 100);
  height: 100dvh;
}

.menu-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 177, 90, 0.34), transparent 34%),
    radial-gradient(circle at 82% 24%, rgba(213, 64, 49, 0.38), transparent 38%),
    radial-gradient(circle at 50% 105%, rgba(255, 209, 102, 0.18), transparent 42%),
    linear-gradient(145deg, rgba(22, 9, 20, 0.96), rgba(91, 29, 42, 0.92));
  backdrop-filter: blur(10px);
  z-index: 50;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.menu-box {
  width: min(480px, 94vw);
  background:
    linear-gradient(160deg, rgba(101, 34, 43, 0.96), rgba(30, 22, 34, 0.94));
  border-radius: 28px 28px 12px 28px;
  border: 2px solid rgba(255, 209, 102, 0.72);
  border-left: 7px solid var(--red);
  box-shadow: 0 24px 70px rgba(2, 2, 14, 0.54), 0 0 0 5px rgba(46, 243, 224, 0.07);
  padding: 24px 22px 22px;
  text-align: center;
  color: var(--ink);
}

h1.logo {
  margin: 0 0 6px;
  font-size: 48px;
  font-weight: 1000;
  color: #fff3cf;
  background: linear-gradient(180deg, #fff7dc 0%, #ffd166 38%, #ff8a3d 66%, #ff4d5f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  text-shadow: 5px 7px 0 rgba(79, 15, 66, 0.5);
  letter-spacing: -1px;
  line-height: 0.98;
  transform: skewX(-5deg) rotate(-1deg);
}

.build-version {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 14px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(46, 243, 224, 0.22);
  background: rgba(46, 243, 224, 0.08);
  color: rgba(225, 248, 255, 0.7);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sub {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink2);
  letter-spacing: 0.4px;
}

.pitch {
  margin: 0 auto 14px;
  max-width: 430px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink2);
}

.mp-box {
  width: min(360px, 90%);
  margin: 12px auto 0;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(46, 243, 224, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

.menu-main-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 12px;
  width: min(400px, 100%);
  margin: 14px auto 0;
}

.menu-main-actions .btn {
  width: 100%;
  margin: 0;
}

.menu-status {
  width: min(360px, 90%);
  margin: 10px auto 0;
  text-align: center;
}

.menu-hidden-config {
  display: none;
}

.mp-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.mp-toggle input {
  accent-color: var(--tq);
}

.mp-box input[type="text"] {
  width: 100%;
  margin-top: 8px;
  font-size: 14px;
  padding: 10px 12px;
}

.mp-lobby {
  text-align: left;
  margin-bottom: 10px;
}

.mp-lobby-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.mp-lobby-title {
  color: var(--tq);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.8px;
}

.mp-current-match {
  color: var(--ink2);
  font-size: 11px;
  font-weight: 900;
  text-align: right;
}

.match-list {
  display: grid;
  gap: 10px;
}

.match-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(46, 243, 224, 0.18);
  background: rgba(6, 12, 28, 0.48);
}

.match-card.is-selected {
  border-color: rgba(139, 92, 255, 0.52);
  box-shadow: inset 0 0 0 1px rgba(139, 92, 255, 0.24);
}

.match-card.is-active {
  border-color: rgba(46, 243, 224, 0.58);
  box-shadow: inset 0 0 0 1px rgba(46, 243, 224, 0.24);
}

.match-copy {
  min-width: 0;
}

.match-name {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.match-meta-line {
  color: var(--ink2);
  font-size: 12px;
  font-weight: 800;
  margin-top: 2px;
}

.match-btn {
  width: auto;
  min-width: 138px;
  margin-top: 0;
  padding: 10px 14px;
  font-size: 12px;
}

.match-btn.is-active {
  border-color: rgba(46, 243, 224, 0.55);
  background: linear-gradient(135deg, rgba(46, 243, 224, 0.24), rgba(139, 92, 255, 0.28));
}

.mp-actions {
  margin-top: 10px;
}

.mp-actions .btn {
  width: 100%;
  margin-top: 0;
}

.menu-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 16px;
}

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(46, 243, 224, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

input[type="text"] {
  width: min(360px, 90%);
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 999px;
  border: 2px solid rgba(46, 243, 224, 0.35);
  outline: none;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  color: var(--ink);
  background: rgba(10, 10, 25, 0.55);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

input[type="text"]:focus {
  border-color: rgba(46, 243, 224, 0.8);
  box-shadow: 0 0 0 4px rgba(46, 243, 224, 0.15);
}

.btn {
  width: min(360px, 90%);
  margin-top: 0;
  padding: 14px 18px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  color: white;
  background: var(--btn);
  box-shadow: 0 10px 0 rgba(139, 92, 255, 0.28);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.12s ease;
}

.btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 rgba(139, 92, 255, 0.24);
  filter: brightness(0.98);
}

.btn:focus-visible,
.icon-btn:focus-visible,
.action-btn:focus-visible,
input[type="text"]:focus-visible {
  outline: 2px solid rgba(46, 243, 224, 0.85);
  outline-offset: 2px;
}

.btn.secondary {
  background: linear-gradient(135deg, rgba(46, 243, 224, 0.35), rgba(139, 92, 255, 0.45));
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.25);
  font-size: 14px;
  padding: 12px 16px;
}

.btn.tertiary {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(46, 243, 224, 0.18));
  border: 1px solid rgba(46, 243, 224, 0.35);
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.18);
  font-size: 14px;
  padding: 12px 16px;
}

.btn-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.btn-row .btn {
  margin-top: 0;
}

.lb {
  margin-top: 14px;
  text-align: left;
  background: rgba(10, 10, 25, 0.35);
  border: 1px solid rgba(46, 243, 224, 0.28);
  border-radius: 18px;
  padding: 12px;
}

.lb h2 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.lb .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-weight: 800;
  font-size: 12px;
  color: var(--ink);
  padding: 4px 6px;
  border-radius: 10px;
}

.lb .row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.06);
}

.lb .muted {
  color: rgba(240, 245, 255, 0.65);
  font-weight: 800;
  font-size: 12px;
  margin-top: 6px;
}

#game-ui {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10;
}

#announcer {
  position: absolute;
  top: 18px;
  left: 50%;
  width: min(92vw, 440px);
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(46, 243, 224, 0.3);
  background: rgba(10, 14, 30, 0.82);
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  transform: translate(-50%, -18px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.16s ease, opacity 0.16s ease;
  z-index: 31;
}

#announcer.is-visible {
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
}

#announcer[data-tone="warning"] {
  border-color: rgba(241, 197, 64, 0.7);
  box-shadow: 0 18px 40px rgba(241, 197, 64, 0.12);
}

#announcer[data-tone="danger"] {
  border-color: rgba(255, 77, 95, 0.75);
  box-shadow: 0 18px 40px rgba(255, 77, 95, 0.14);
}

#announcer[data-tone="pickup"] {
  border-color: rgba(46, 243, 224, 0.8);
}

#announcer[data-tone="system"] {
  border-color: rgba(139, 92, 255, 0.75);
}

#ui-overlay {
  position: absolute;
  top: 14px;
  left: 14px;
  pointer-events: none;
}

.stats-box {
  background: linear-gradient(150deg, rgba(40, 11, 58, 0.92), rgba(5, 30, 46, 0.88));
  padding: 14px 14px 12px;
  border-radius: 18px 18px 8px 18px;
  border: 1px solid rgba(255, 209, 102, 0.48);
  border-left: 5px solid var(--red);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38), inset 0 2px rgba(46, 243, 224, 0.12);
  backdrop-filter: blur(10px);
  color: var(--ink);
  min-width: 236px;
}

.stats-title {
  font-size: 14px;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 4px;
  letter-spacing: 0.12em;
}

.alive-counter {
  font-size: 24px;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(241, 197, 64, 0.25);
  text-align: center;
  margin-bottom: 8px;
  border-bottom: 2px solid rgba(46, 243, 224, 0.22);
  padding-bottom: 6px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.02em;
  color: rgba(240, 245, 255, 0.74);
}
.stat-row span:last-child { color: rgba(255, 255, 255, 0.96); }

#instructions {
  max-width: 250px;
  padding-top: 9px;
  border-top: 1px solid rgba(46, 243, 224, 0.2);
  font-size: 9px;
  line-height: 1.45;
  color: rgba(240, 245, 255, 0.66);
  font-weight: 800;
  text-align: left;
  margin-top: 9px;
}

#crosshair {
  position: absolute;
  top: 57.5%;
  left: 58%;
  width: 30px;
  height: 30px;
  border: 2px solid rgba(255, 209, 102, 0.9);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-8deg);
  pointer-events: none;
  background: radial-gradient(circle, transparent 45%, rgba(46, 243, 224, 0.08) 48%, transparent 68%);
  box-shadow: 0 0 0 3px rgba(46, 243, 224, 0.13), 0 0 18px rgba(46, 243, 224, 0.32);
}

#crosshair::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background: var(--tq);
  box-shadow: 0 0 12px rgba(46, 243, 224, 0.9);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

#hit-marker {
  position: absolute;
  top: 57.5%;
  left: 58%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.08s ease-out;
  z-index: 12;
  pointer-events: none;
}

#hit-marker::before,
#hit-marker::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 4px;
  background: rgba(46, 243, 224, 0.9);
  border-radius: 5px;
}

#hit-marker::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

#hit-marker::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

#headshot-marker {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: transform 0.18s ease, opacity 0.18s ease;
  z-index: 13;
  font-weight: 900;
  font-size: 30px;
  color: rgba(240, 245, 255, 0.95);
  text-transform: uppercase;
  -webkit-text-stroke: 1px rgba(46, 243, 224, 0.25);
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 0 12px 30px rgba(139, 92, 255, 0.18);
}

#vignette {
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  background: radial-gradient(circle at 50% 48%,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0) 58%,
    rgba(0, 0, 0, 0.18) 86%,
    rgba(0, 0, 0, 0.35) 100%);
  opacity: 0.65;
}

#vignette::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(34, 18, 45, 0.72) 0 1px, transparent 1.35px);
  background-size: 8px 8px;
  opacity: 0.16;
  -webkit-mask-image: radial-gradient(circle at 52% 50%, transparent 0 55%, #000 86%);
  mask-image: radial-gradient(circle at 52% 50%, transparent 0 55%, #000 86%);
}

#mob-melee {
  font-size: 9px;
}

.action-btn.is-cooling {
  opacity: 0.48;
  filter: saturate(0.35);
}
#damage-arrow {
  position: absolute;
  inset: 0;
  z-index: 11;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease-out;
}

#damage-arrow::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 22px solid transparent;
  border-right: 22px solid transparent;
  border-bottom: 42px solid rgba(139, 92, 255, 0.78);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
}

#water-warning {
  position: absolute;
  bottom: 18%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 14, 30, 0.78);
  border: 2px solid rgba(46, 243, 224, 0.35);
  color: rgba(240, 245, 255, 0.92);
  font-weight: 900;
  font-size: 18px;
  padding: 8px 18px;
  border-radius: 999px;
  display: none;
  z-index: 12;
  pointer-events: none;
  text-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.mobile-controls {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  height: 210px;
  z-index: 25;
  pointer-events: none;
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-controls.is-on {
  display: block;
}

#joystick-zone {
  position: absolute;
  bottom: 14px;
  left: 14px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0);
  border: 2px solid rgba(46, 243, 224, 0.25);
  pointer-events: auto;
  touch-action: none;
}

#joystick-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0);
  border: 2px solid rgba(139, 92, 255, 0.55);
  touch-action: none;
}

#touch-look-zone {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: calc(100% - 220px);
  z-index: 5;
  pointer-events: auto;
  touch-action: none;
}

#mobile-buttons {
  position: absolute;
  bottom: 18px;
  right: 14px;
  display: grid;
  grid-template-columns: repeat(2, 68px);
  grid-template-rows: repeat(2, 68px);
  gap: 9px;
  pointer-events: auto;
  touch-action: none;
  z-index: 20;
}

.action-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid rgba(46, 243, 224, 0.25);
  background: rgba(0, 0, 0, 0);
  font-weight: 900;
  color: rgba(240, 245, 255, 0.92);
  text-transform: uppercase;
  font-size: 14px;
  touch-action: none;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  text-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

#mob-fire {
  width: 74px;
  height: 74px;
  margin: -3px;
  border-color: rgba(255, 72, 83, 0.82);
  background: radial-gradient(circle at 35% 25%, rgba(255, 107, 95, 0.46), rgba(100, 8, 25, 0.18));
}

#mob-mustard {
  border-color: rgba(255, 222, 68, 0.92);
  color: #fff18a;
  background: radial-gradient(circle at 35% 25%, rgba(255, 218, 56, 0.42), rgba(103, 61, 3, 0.15));
}

#mob-melee {
  border-color: rgba(114, 244, 214, 0.82);
  color: #9effe9;
}

#mob-jump {
  border-color: rgba(177, 123, 255, 0.82);
}

#top-right {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 30;
  pointer-events: auto;
  display: flex;
  gap: 8px;
  touch-action: manipulation;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 2px solid rgba(46, 243, 224, 0.22);
  background: rgba(0, 0, 0, 0);
  cursor: pointer;
  font-size: 18px;
  display: grid;
  place-items: center;
  color: rgba(240, 245, 255, 0.92);
  text-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.icon-btn.label {
  width: 46px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.4px;
}

.icon-btn.wide {
  width: auto;
  min-width: 84px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.6px;
}

.icon-btn:active {
  transform: translateY(2px);
}

[hidden] {
  display: none !important;
}

.dev-hud {
  position: absolute;
  top: 62px;
  right: 12px;
  width: 220px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(46, 243, 224, 0.22);
  background: linear-gradient(180deg, rgba(8, 14, 34, 0.84), rgba(18, 10, 50, 0.74));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
  color: var(--ink);
  z-index: 30;
  pointer-events: none;
}

.dev-title {
  margin-bottom: 8px;
  color: var(--tq);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
}

#dev-map {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(46, 243, 224, 0.18);
  background: rgba(0, 0, 0, 0.24);
}

#dev-readout {
  margin: 8px 0 0;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  line-height: 1.45;
  color: rgba(240, 245, 255, 0.9);
}

#game-over-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  background:
    radial-gradient(circle at 35% 25%, rgba(46, 243, 224, 0.2), transparent 50%),
    radial-gradient(circle at 70% 25%, rgba(194, 75, 255, 0.18), transparent 55%),
    rgba(7, 10, 26, 0.86);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

#game-over-screen .menu-box {
  max-width: 560px;
}

#go-title {
  margin: 0 0 8px;
  font-size: 42px;
  font-weight: 900;
  color: var(--tq);
  text-transform: uppercase;
}

.go-sub {
  margin: 0 0 16px;
  color: var(--ink2);
  font-weight: 800;
  line-height: 1.5;
}

#go-stats {
  font-weight: 900;
  color: var(--ink);
  line-height: 1.7;
}

@media (max-width: 720px) {
  h1.logo {
    font-size: 38px;
  }

  .menu-box {
    padding: 18px;
    border-radius: 24px;
  }

  .btn,
  .btn.secondary,
  .btn.tertiary {
    width: 100%;
  }

  .menu-main-actions {
    grid-template-columns: 1fr;
  }

  .btn-row {
    flex-direction: column;
  }

  .match-card {
    grid-template-columns: 1fr;
  }

  .match-btn {
    width: 100%;
  }

  #announcer {
    top: 14px;
    font-size: 13px;
    padding: 11px 14px;
  }

  .dev-hud {
    top: auto;
    right: 10px;
    left: 10px;
    bottom: 10px;
    width: auto;
  }

  #ui-overlay {
    top: 8px;
    left: 8px;
  }

  .stats-box {
    min-width: 174px;
    width: 174px;
    padding: 9px 10px 8px;
    border-left-width: 3px;
    border-radius: 13px 13px 6px 13px;
    backdrop-filter: blur(6px);
  }

  .stats-title {
    font-size: 10px;
  }

  .alive-counter {
    font-size: 18px;
    margin-bottom: 5px;
    padding-bottom: 4px;
  }

  .stat-row {
    gap: 8px;
    margin-bottom: 2px;
    font-size: 9px;
  }

  #instructions {
    max-width: 154px;
    padding-top: 5px;
    margin-top: 5px;
    font-size: 7px;
    line-height: 1.25;
  }
}

/* Compact combat HUD v12 */
.stats-box {
  min-width: 0;
  width: 226px;
  padding: 11px;
  border-radius: 15px 15px 7px 15px;
  border: 1px solid rgba(255, 209, 102, 0.52);
  border-left: 4px solid var(--red);
  background: rgba(18, 20, 42, 0.88);
  box-shadow: 0 12px 32px rgba(22, 8, 27, 0.28);
  backdrop-filter: blur(7px);
}

.hud-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 7px;
}

.alive-counter {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--gold);
  text-align: left;
  line-height: 1;
  text-shadow: none;
}

.alive-counter strong {
  font-size: 24px;
  font-weight: 950;
}

.alive-counter span {
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.10em;
}

.hud-timer {
  color: rgba(255, 249, 235, 0.92);
  font-size: 13px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.health-hud {
  padding: 7px 8px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
}

.health-copy {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  color: rgba(255, 249, 235, 0.72);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

#health {
  color: var(--tq);
  font-size: 11px;
  letter-spacing: 0;
}

.health-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(4, 8, 24, 0.62);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

#health-bar-fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--tq);
  transition: width 0.14s ease-out, background-color 0.14s ease-out;
}

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

.hud-chip {
  min-width: 0;
  padding: 6px 4px 5px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  text-align: center;
}

.hud-chip span,
.hud-chip strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-chip span {
  color: rgba(255, 249, 235, 0.58);
  font-size: 7px;
  font-weight: 950;
  letter-spacing: 0.06em;
}

.hud-chip strong {
  margin-top: 2px;
  color: white;
  font-size: 13px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.hud-chip.ammo strong { color: #ff5968; }
.hud-chip.kills strong { color: var(--gold); }
.hud-chip.mustard strong { color: #ffe33d; font-size: 9px; line-height: 16px; }
.hud-chip.mustard.is-cooling strong { color: #ff9a3d; }

.respawn-pill {
  margin-top: 7px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(20, 12, 38, 0.88);
  color: #ff9a3d;
  font-size: 11px;
  font-weight: 950;
  text-align: center;
}

#instructions.control-hint {
  max-width: 226px;
  margin-top: 6px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: rgba(18, 20, 42, 0.55);
  color: rgba(255, 249, 235, 0.72);
  font-size: 7px;
  line-height: 1.3;
  text-align: center;
  animation: controlHintFade 12s forwards;
}

@keyframes controlHintFade {
  0%, 68% { opacity: 1; }
  100% { opacity: 0; }
}

@media (max-width: 720px) {
  .stats-box {
    width: 178px;
    min-width: 0;
    padding: 8px;
    border-left-width: 3px;
    border-radius: 12px 12px 6px 12px;
  }

  .alive-counter strong { font-size: 20px; }
  .alive-counter span { font-size: 8px; }
  .hud-timer { font-size: 11px; }
  .health-hud { padding: 5px 6px 6px; }
  .health-copy { font-size: 7px; margin-bottom: 4px; }
  #health { font-size: 9px; }
  .health-track { height: 6px; }
  .hud-chips { gap: 3px; margin-top: 4px; }
  .hud-chip { padding: 4px 2px; border-radius: 7px; }
  .hud-chip span { font-size: 6px; }
  .hud-chip strong { font-size: 11px; }
  .hud-chip.mustard strong { font-size: 7px; line-height: 13px; }
  #instructions.control-hint { max-width: 178px; font-size: 6px; padding: 5px; }
}
/* Generic mobile action diamond v14 */
#mobile-buttons {
  right: 6px;
  bottom: 8px;
  display: block;
  width: 178px;
  height: 178px;
}

#mobile-buttons .action-btn {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin: 0;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  background: rgba(14, 15, 35, 0.82);
  color: white;
  box-shadow: 0 6px 0 rgba(6, 7, 19, 0.55), 0 8px 18px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  touch-action: none;
}

#mobile-buttons .action-btn:active,
#mobile-buttons .action-btn.is-pressed {
  transform: translateY(4px) scale(0.94);
  box-shadow: 0 2px 0 rgba(6, 7, 19, 0.55), 0 4px 10px rgba(0, 0, 0, 0.18);
}

#mobile-buttons .action-symbol {
  display: block;
  font-family: Arial, "Segoe UI Symbol", sans-serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 0.72;
}

#mobile-buttons .action-label {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.94);
  font-size: 6px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

#mob-mustard {
  top: 0;
  left: 60px;
  border-color: #7cff77 !important;
}
#mob-mustard .action-symbol { color: #7cff77; }

#mob-melee {
  top: 60px;
  left: 0;
  border-color: #ff75bd !important;
}
#mob-melee .action-symbol { color: #ff75bd; }

#mob-fire {
  top: 60px;
  right: 0;
  left: auto;
  border-color: #ff6675 !important;
}
#mob-fire .action-symbol { color: #ff6675; }

#mob-jump {
  bottom: 0;
  left: 60px;
  border-color: #69b9ff !important;
}
#mob-jump .action-symbol { color: #69b9ff; }

#mobile-buttons .action-btn.is-cooling {
  opacity: 0.62;
  filter: saturate(0.65);
}

@media (max-width: 350px), (max-height: 620px) {
  #mobile-buttons {
    right: 3px;
    bottom: 5px;
    width: 158px;
    height: 158px;
  }

  #mobile-buttons .action-btn {
    width: 52px;
    height: 52px;
  }

  #mob-mustard { left: 53px; }
  #mob-melee { top: 53px; }
  #mob-fire { top: 53px; }
  #mob-jump { left: 53px; }
  #mobile-buttons .action-symbol { font-size: 23px; }
  #mobile-buttons .action-label { margin-top: 5px; font-size: 5px; }
}