/* Instrumentos da arena: contraste constante sobre qualquer parte do cenário. */
:root {
  --hud-cream: #f3f0df;
  --hud-lime: #d6f266;
  --hud-orange: #ff824c;
  --hud-muted: #acb89e;
  --hud-panel: #1c251bf2;
  --hud-line: #82976480;
  --hud-edge: 14px;
  --hud-board: 184px;
  --hud-radar: 84px;
  --hud-ability: 78px;
}

#hud {
  font-weight: 550;
  color: var(--hud-cream);
}

#hud-top,
#hud-stats,
#hud-right,
#btn-pause,
#btn-skills {
  border: 1px solid var(--hud-line);
  border-radius: 5px;
  background: var(--hud-panel);
  box-shadow: 0 3px 12px #0002;
  color: var(--hud-cream);
  text-shadow: none;
}

#hud-top {
  left: 50%;
  top: var(--hud-edge);
  width: clamp(210px, 26vw, 350px);
  height: 58px;
  padding: 0;
  gap: 0;
  overflow: hidden;
}

#lvl-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  align-self: stretch;
  flex: none;
  min-width: 55px;
  padding: 6px 12px;
  border-radius: 0;
  background: var(--hud-lime);
  color: #26301b;
}

#lvl-box small {
  font-size: 7px;
  letter-spacing: 1.3px;
  font-weight: 800;
}

#lvl-box #lvl {
  font-size: 29px;
  line-height: 1;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -1px;
}

.hud-evolution {
  flex: 1;
  min-width: 0;
  padding: 10px 13px;
}

.hud-xp-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 1.2px;
  color: var(--hud-muted);
  margin-bottom: 8px;
  white-space: nowrap;
}

#xp-label {
  color: var(--hud-cream);
  font: 8px monospace;
  letter-spacing: 0;
}

#hud-top .xpbar {
  height: 6px;
  border: 0;
  border-radius: 1px;
  background: #ffffff1a;
}

#xp-fill {
  background: var(--hud-lime);
  border-radius: 1px;
  box-shadow: 0 0 12px #d6f26635;
  transition: width .18s linear;
}

#hud-stats {
  left: var(--hud-edge);
  top: var(--hud-edge);
  min-width: 150px;
  padding: 10px 12px;
}

.hud-identity {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #c3cdb7;
}

.hud-signal {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--hud-lime);
  box-shadow: 0 0 8px #d6f26666;
}

.hud-score-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.hud-score-row>div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hud-score-row small {
  color: #a4b494;
  font-size: 7px;
  letter-spacing: 1.1px;
}

.hud-score-row b {
  font-size: 19px;
  line-height: 1;
  letter-spacing: -.6px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.hud-score-row>div:last-child b {
  color: var(--hud-orange);
}

#hud-right {
  right: calc(var(--hud-edge) + env(safe-area-inset-right));
  top: var(--hud-edge);
  width: var(--hud-board);
  padding: 9px 10px 6px;
  font-size: 10px;
  line-height: 1.3;
}

.hud-board-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  margin-bottom: 5px;
  border-bottom: 1px solid #ffffff20;
}

.hud-board-head>span {
  font-size: 7px;
  color: #b5c2a5;
  letter-spacing: 1px;
  white-space: nowrap;
}

.hud-clock {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--hud-lime);
}

.hud-clock .ui-icon {
  width: 11px;
  height: 11px;
}

#timer {
  margin: 0;
  font: 700 12px monospace;
  font-variant-numeric: tabular-nums;
  color: var(--hud-lime);
}

#timer.urgent {
  color: var(--hud-orange);
}

#board li {
  align-items: center;
  gap: 6px;
  min-height: 20px;
  padding: 2px 0;
  font-size: 10px;
}

#board .board-rank {
  flex: none;
  width: 16px;
  color: #94a483;
  font: 8px monospace;
}

#board .board-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e0e6d5;
}

#board li>b {
  flex: none;
  font: 700 10px monospace;
  color: #c2ceb4;
}

#board li:first-child .board-rank,
#board li:first-child>b {
  color: var(--hud-orange);
}

#board li.me .board-name,
#board li.me>b,
#board li.me .board-rank {
  color: var(--hud-lime);
}

#board li.dead {
  opacity: .45;
}

#board li.sep {
  border-color: #82976466;
  margin-top: 3px;
  padding-top: 5px !important;
}

#btn-pause {
  right: calc(var(--hud-board) + var(--hud-edge) + 9px + env(safe-area-inset-right));
  top: var(--hud-edge);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 43px;
  padding: 7px;
  pointer-events: auto;
  cursor: pointer;
}

#btn-pause .ui-icon {
  width: 22px;
  height: 22px;
  stroke-width: 3px;
  color: var(--hud-cream);
}

#btn-pause kbd:not(.pad-on) {
  position: absolute;
  top: calc(100% + 4px);
  color: #c9d4bd;
  background: #1d281ad9;
  padding: 2px 4px;
  border: 1px solid #73865a;
  border-radius: 2px;
  font: 7px monospace;
}

#btn-pause:hover {
  background: #35442b;
  border-color: var(--hud-lime);
}

#btn-pause:active {
  transform: translateY(1px);
}



/* Radar e coleção ficam lado a lado, abaixo do placar. O JS calcula apenas o topo. */
#minimap {
  right: calc(var(--hud-edge) + env(safe-area-inset-right));
  width: var(--hud-radar);
  height: var(--hud-radar);
}

#btn-skills {
  right: calc(var(--hud-edge) + var(--hud-radar) + 6px + env(safe-area-inset-right));
  width: calc(var(--hud-board) - var(--hud-radar) - 6px);
  min-width: 0;
  height: var(--hud-radar);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 6px 2px;
  z-index: 14;
  touch-action: none;
  cursor: pointer;
}

#btn-skills>.ui-icon {
  color: var(--hud-lime);
  width: 21px;
  height: 21px;
}

.skills-label {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .6px;
}

#btn-skills #sk-n {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 14px;
  height: 14px;
  padding: 1px 3px;
  font: 700 9px monospace;
  border-radius: 2px;
  color: #232e1c;
  background: var(--hud-lime);
}

#btn-skills kbd:not(.pad-on) {
  color: #8fa17c;
  font: 7px monospace;
}

#btn-skills:hover {
  background: #35442b;
  border-color: var(--hud-lime);
}

/* Especial: carga no aro, estado escrito e elemento sempre identificável. */
#btn-ability {
  right: calc(var(--hud-edge) + env(safe-area-inset-right));
  bottom: calc(var(--hud-edge) + env(safe-area-inset-bottom));
  width: var(--hud-ability);
  height: var(--hud-ability);
  padding: 4px;
  border-radius: 50%;
  background: conic-gradient(var(--hud-lime) calc(var(--p, 0) * 1%), #445038 0);
  border: 1px solid #b0c18b;
  filter: none;
  box-shadow: 0 4px 18px #0004;
  color: var(--hud-cream);
  cursor: pointer;
}

#btn-ability .in {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid #ffffff20;
  background: #202b1c;
  gap: 4px;
  color: var(--hud-cream);
}

#btn-ability .ic {
  font-size: 26px;
  line-height: 1;
}

#btn-ability .nm {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  max-width: 95%;
  white-space: nowrap;
}

#btn-ability kbd:not(.pad-on) {
  left: -3px;
  top: -1px;
  min-width: 17px;
  padding: 2px 4px;
  border: 1px solid #809461;
  border-radius: 3px;
  color: var(--hud-cream);
  background: #26331f;
  font: 8px monospace;
}

.ability-status {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  transform: translateX(-50%);
  padding: 4px 7px;
  background: #202b1cf2;
  border: 1px solid #7b8e60;
  border-radius: 3px;
  color: #dce6d0;
  font: 8px monospace;
  letter-spacing: .5px;
  white-space: nowrap;
  pointer-events: none;
}

#btn-ability.ready {
  background: var(--hud-lime);
  animation: hud-ready 1.7s ease-in-out infinite;
}

#btn-ability.ready .in {
  background: #354b24;
  color: var(--hud-lime);
}

#btn-ability.ready .ability-status {
  background: var(--hud-lime);
  border-color: var(--hud-lime);
  color: #26301a;
  font-weight: 800;
}

#btn-ability.burst {
  background: conic-gradient(var(--hud-orange) calc(var(--p, 0) * 1%), #493b2e 0);
  border-color: #ffac80;
}

#btn-ability.burst .in {
  background: #3b2c1d;
}

#btn-ability.burst .ability-status {
  color: var(--hud-orange);
  border-color: #bd8150;
}

#btn-ability:active {
  transform: scale(.96);
}

@keyframes hud-ready {
  50% {
    box-shadow: 0 0 0 5px #d6f26620, 0 0 20px #d6f26635;
  }
}

#elem-chips {
  right: calc(var(--hud-edge) + env(safe-area-inset-right));
  bottom: calc(var(--hud-edge) + var(--hud-ability) + 39px + env(safe-area-inset-bottom));
  gap: 5px;
}

#elem-chips button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #83976a;
  background: #202a1bef;
  filter: none;
  box-shadow: 0 2px 8px #0002;
  border-radius: 4px;
  opacity: .85;
  font-size: 17px;
  transform: none;
}

#elem-chips button.on {
  color: var(--hud-cream);
  background: #42552d;
  border-color: var(--hud-lime);
  box-shadow: inset 0 -3px var(--hud-lime);
  transform: none;
  opacity: 1;
}

/* Escolher a próxima melhoria: cartas táticas, acessíveis sem soltar o joystick. */
#levelup {
  bottom: calc(20px + env(safe-area-inset-bottom));
  gap: 9px;
}

#lu-title {
  background: #1f2b1bf5;
  border: 1px solid #a2b66b;
  border-radius: 3px;
  padding: 5px 16px;
  color: var(--hud-lime);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 2px;
  text-shadow: none;
  box-shadow: 0 3px 12px #0003;
}

#lu-cards {
  gap: 10px;
  align-items: stretch;
}

.lu-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 8px;
  width: 172px;
  min-height: 175px;
  padding: 14px;
  background: #222c1ff7;
  border: 1px solid #8d9f68;
  border-top: 3px solid var(--hud-lime);
  border-radius: 5px;
  box-shadow: 0 5px 18px #0004;
  color: var(--hud-cream);
  text-align: left;
}

.lu-card:hover {
  transform: translateY(-5px);
  background: #35472a;
  border-color: var(--hud-lime);
}

.lu-card:active {
  transform: translateY(1px);
}

.lu-card .lu-index {
  color: #9cac88;
  font: 7px monospace;
  letter-spacing: 1px;
}

.lu-card .ico {
  font-size: 28px;
  line-height: 1;
  align-self: flex-start;
}

.lu-card .lu-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.lu-card b {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.2px;
  text-transform: none;
  color: var(--hud-cream);
}

.lu-card small {
  display: block;
  color: #c0cdb2;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 500;
}

.lu-card .lu-desc {
  min-height: 30px;
}

.lu-card .lu-footer {
  display: flex;
  flex-direction: column;
  gap: 7px;
  border-top: 1px solid #ffffff20;
  padding-top: 9px;
  margin-top: auto;
}

.lu-card .dim {
  font-size: 9px;
  color: var(--hud-lime);
  font-weight: 750;
  margin: 0;
}

.lu-card .lu-pips {
  display: flex;
  gap: 3px;
}

.lu-card .lu-pips i {
  flex: 1;
  height: 3px;
  background: #ffffff1a;
}

.lu-card .lu-pips i.on {
  background: var(--hud-lime);
}

.lu-card.maxed {
  border-top-color: var(--hud-orange);
}

.lu-card.maxed .dim {
  color: #ffaf80;
}

.lu-card.maxed .lu-pips i.on {
  background: var(--hud-orange);
}

.lu-card kbd:not(.pad-on) {
  position: absolute;
  top: 10px;
  right: 10px;
  left: auto;
  min-width: 17px;
  padding: 2px 4px;
  font: 8px monospace;
  line-height: 1;
  background: #34442b;
  border: 1px solid #809463;
  border-radius: 2px;
  color: var(--hud-lime);
}

#btn-pause:focus-visible,
#btn-skills:focus-visible,
#btn-ability:focus-visible,
#elem-chips button:focus-visible,
.lu-card:focus-visible {
  outline: 3px solid var(--hud-orange);
  outline-offset: 3px;
}

/* Avisos durante a partida. */
#hud-ver,
#hud-ping {
  left: calc(var(--hud-edge) + env(safe-area-inset-left));
  padding: 3px 6px;
  border-radius: 2px;
  background: #20291dd9;
  color: #c4d2b5;
  text-shadow: none;
  opacity: 1;
  font: 8px monospace;
}

#hud-ver {
  bottom: calc(7px + env(safe-area-inset-bottom));
}

#hud-ping {
  bottom: calc(24px + env(safe-area-inset-bottom));
}

#net-banner {
  top: calc(var(--hud-edge) + 68px);
  background: #412e20f2;
  border: 1px solid #bf8657;
  border-radius: 3px;
  color: #ffd1aa;
  padding: 7px 14px;
  font-size: 11px;
  box-shadow: 0 4px 15px #0003;
}

#respawn-note {
  background: #212d1cf2;
  border: 1px solid #a0b56a;
  border-radius: 5px;
  color: var(--hud-cream);
  padding: 13px 20px;
  font-size: 13px;
  box-shadow: 0 6px 20px #0004;
}

.zone .base {
  border: 2px solid #b8ce8bab;
  background: #1e2a1b3b;
  box-shadow: 0 0 0 5px #1e2a1b1a;
}

.zone .knob {
  background: #d6e6bbd9;
  border: 2px solid #7e965f;
  box-shadow: 0 3px 8px #0002;
}

@media (max-height:520px) {
  :root {
    --hud-edge: 10px;
    --hud-board: 144px;
    --hud-radar: 72px;
    --hud-ability: 64px;
  }

  #hud-top {
    width: clamp(172px, 27vw, 240px);
    height: 43px;
  }

  #lvl-box {
    min-width: 39px;
    padding: 5px 8px;
  }

  #lvl-box small {
    font-size: 5px;
    letter-spacing: .7px;
  }

  #lvl-box #lvl {
    font-size: 23px;
  }

  .hud-evolution {
    padding: 7px 10px;
  }

  .hud-xp-label {
    font-size: 6px;
    letter-spacing: .8px;
    gap: 5px;
    margin-bottom: 6px;
  }

  #xp-label {
    font-size: 6px;
  }

  #hud-top .xpbar {
    height: 4px;
  }

  #hud-stats {
    min-width: 116px;
    padding: 7px 9px;
  }

  .hud-identity {
    font-size: 6px;
    letter-spacing: .7px;
    margin-bottom: 6px;
  }

  .hud-score-row {
    gap: 15px;
  }

  .hud-score-row small {
    font-size: 5px;
    letter-spacing: .8px;
  }

  .hud-score-row b {
    font-size: 16px;
  }

  #hud-right {
    padding: 6px 7px 4px;
  }

  .hud-board-head {
    padding-bottom: 5px;
    margin-bottom: 3px;
    gap: 5px;
  }

  .hud-board-head>span {
    font-size: 5.5px;
    letter-spacing: .6px;
  }

  .hud-clock {
    gap: 3px;
  }

  .hud-clock .ui-icon {
    width: 9px;
    height: 9px;
  }

  #timer {
    font-size: 10px;
  }

  #board li {
    min-height: 15px;
    padding: 1px 0;
    gap: 4px;
    font-size: 10px;
  }

  #board .board-rank {
    width: 12px;
    font-size: 7px;
  }

  #board li>b {
    font-size: 9px;
  }

  #board li.sep {
    margin-top: 1px;
    padding-top: 3px !important;
  }

  #btn-pause {
    width: 40px;
    height: 40px;
    padding: 8px;
    right: calc(var(--hud-board) + var(--hud-edge) + 7px + env(safe-area-inset-right));
  }

  #btn-pause .ui-icon {
    width: 20px;
    height: 20px;
  }

  #btn-pause kbd:not(.pad-on) {
    font-size: 5px;
    padding: 1px 3px;
    top: calc(100% + 3px);
  }

  #btn-skills {
    padding: 6px 2px;
    gap: 5px;
  }

  #btn-skills>.ui-icon {
    width: 18px;
    height: 18px;
  }

  .skills-label {
    font-size: 8px;
    letter-spacing: .2px;
  }

  #btn-skills #sk-n {
    top: 4px;
    right: 4px;
    font-size: 8px;
    height: 13px;
    min-width: 13px;
  }

  #btn-skills kbd:not(.pad-on) {
    font-size: 6px;
  }

  #btn-ability .in {
    gap: 3px;
  }

  #btn-ability .ic {
    font-size: 22px;
  }

  #btn-ability .nm {
    font-size: 8px;
  }

  #btn-ability kbd:not(.pad-on) {
    font-size: 7px;
    min-width: 15px;
  }

  .ability-status {
    padding: 3px 6px;
    bottom: calc(100% + 6px);
    font-size: 8px;
    letter-spacing: .3px;
  }

  #elem-chips {
    bottom: calc(var(--hud-edge) + var(--hud-ability) + 35px + env(safe-area-inset-bottom));
    gap: 4px;
  }

  #elem-chips button {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  #levelup {
    bottom: calc(14px + env(safe-area-inset-bottom));
    gap: 6px;
  }

  #lu-title {
    padding: 4px 12px;
    font-size: 8px;
    letter-spacing: 1.5px;
  }

  #lu-cards {
    gap: 7px;
  }

  .lu-card {
    width: 132px;
    min-height: 131px;
    padding: 10px;
    gap: 6px;
  }

  .lu-card .lu-index {
    font-size: 6px;
    letter-spacing: .7px;
  }

  .lu-card .ico {
    font-size: 23px;
  }

  .lu-card b {
    font-size: 11px;
  }

  .lu-card .lu-copy {
    gap: 4px;
  }

  .lu-card small {
    font-size: 10px;
  }

  .lu-card .lu-desc {
    min-height: 27px;
  }

  .lu-card .lu-footer {
    padding-top: 7px;
    gap: 5px;
  }

  .lu-card .dim {
    font-size: 8px;
  }

  .lu-card kbd:not(.pad-on) {
    right: 7px;
    top: 7px;
    font-size: 7px;
  }

  #hud-ver,
  #hud-ping {
    font-size: 6px;
    padding: 2px 4px;
  }

  #hud-ping {
    bottom: calc(21px + env(safe-area-inset-bottom));
  }

  #net-banner {
    top: 61px;
    font-size: 9px;
  }

  #respawn-note {
    font-size: 11px;
    padding: 10px 14px;
  }
}

@media (max-width:650px) and (max-height:520px) {
  :root {
    --hud-edge: 8px;
    --hud-board: 124px;
    --hud-radar: 64px;
    --hud-ability: 58px;
  }

  #hud-top {
    width: 172px;
  }

  #hud-stats {
    min-width: 102px;
    padding: 7px 8px;
  }

  .hud-score-row {
    gap: 12px;
  }

  #hud-right {
    padding: 5px 6px 4px;
  }

  #board li {
    min-height: 13px;
    font-size: 9px;
  }

  #board li>b {
    font-size: 8px;
  }

  .hud-board-head>span {
    font-size: 5px;
    letter-spacing: .3px;
  }

  #timer {
    font-size: 9px;
  }

  #btn-pause {
    width: 40px;
    height: 40px;
    right: calc(var(--hud-board) + var(--hud-edge) + 6px + env(safe-area-inset-right));
  }

  #btn-skills>.ui-icon {
    width: 16px;
    height: 16px;
  }

  .skills-label {
    font-size: 7px;
    letter-spacing: 0;
  }

  #btn-ability {
    padding: 3px;
  }

  #btn-ability .ic {
    font-size: 20px;
  }

  #btn-ability .nm {
    font-size: 8px;
  }

  .ability-status {
    left: -8px;
    top: 50%;
    bottom: auto;
    transform: translate(-100%, -50%);
  }

  #elem-chips {
    bottom: calc(var(--hud-edge) + var(--hud-ability) + 22px + env(safe-area-inset-bottom));
    gap: 4px;
  }

  #elem-chips button {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .lu-card {
    width: 94px;
    min-height: 124px;
    padding: 8px;
    gap: 5px;
  }

  .lu-card .ico {
    font-size: 21px;
  }

  .lu-card b {
    font-size: 10px;
  }

  .lu-card small {
    font-size: 9px;
  }

  .lu-card .lu-index {
    font-size: 5px;
  }

  .lu-card .dim {
    font-size: 7px;
  }
}

@media (pointer:coarse) {

  #btn-pause kbd:not(.pad-on),
  #btn-skills kbd:not(.pad-on),
  #btn-ability kbd:not(.pad-on),
  .lu-card kbd:not(.pad-on) {
    display: none;
  }
}

@media (prefers-reduced-motion:reduce) {
  #btn-ability.ready {
    animation: none;
  }

  #xp-fill {
    transition: none;
  }

  .lu-card:hover {
    transform: none;
  }
}

/* Top 3 abre a classificação completa sem ocupar a arena. */
#hud-right {
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

#hud-right:hover {
  border-color: var(--hud-lime);
}

#hud-right:focus-visible {
  outline: 3px solid var(--hud-orange);
  outline-offset: 3px;
}

@media (max-height:520px) {
  :root {
    --hud-board: 132px;
  }

  #hud-right {
    padding: 5px 6px 3px;
  }

  #board li {
    min-height: 13px;
    font-size: 9px;
  }

  #btn-skills {
    height: 44px;
    padding: 4px 2px;
    gap: 3px;
  }

  #btn-skills>.ui-icon {
    width: 14px;
    height: 14px;
  }

  .skills-label {
    font-size: 6px;
    letter-spacing: 0;
  }

  #btn-skills #sk-n {
    top: 2px;
    right: 2px;
    height: 12px;
    min-width: 12px;
    font-size: 7px;
  }

  #btn-skills kbd:not(.pad-on) {
    display: none;
  }

  #levelup {
    gap: 4px;
    bottom: calc(10px + env(safe-area-inset-bottom));
  }

  #lu-title {
    font-size: 7px;
    padding: 3px 9px;
    letter-spacing: 1px;
  }

  #lu-cards {
    gap: 5px;
  }

  .lu-card {
    width: 110px;
    min-height: 0;
    padding: 7px;
    gap: 5px;
    border-top-width: 2px;
  }

  .lu-card .lu-index {
    display: none;
  }

  .lu-card .ico {
    font-size: 18px;
  }

  .lu-card .lu-copy {
    gap: 3px;
  }

  .lu-card b {
    font-size: 10px;
    line-height: 1.15;
  }

  .lu-card small {
    font-size: 9px;
    line-height: 1.2;
  }

  .lu-card .lu-desc {
    min-height: 22px;
  }

  .lu-card .lu-footer {
    padding-top: 5px;
    gap: 4px;
  }

  .lu-card .dim {
    font-size: 7px;
  }

  .lu-card .lu-pips {
    gap: 2px;
  }

  .lu-card .lu-pips i {
    height: 2px;
  }

  .lu-card kbd:not(.pad-on) {
    top: 5px;
    right: 5px;
    font-size: 6px;
  }
}

@media (max-width:650px) and (max-height:520px) {
  :root {
    --hud-board: 116px;
  }

  .lu-card {
    width: 84px;
    padding: 6px;
    gap: 4px;
  }

  .lu-card .ico {
    font-size: 16px;
  }

  .lu-card b {
    font-size: 9px;
  }

  .lu-card small {
    font-size: 8px;
  }
}

/* Mais espaço para a arena no celular, preservando o tamanho no desktop. */
@media (max-width:1024px) and (max-height:520px) {
  #hud-top {
    width: 150px;
    height: 30px;
  }

  #lvl-box {
    min-width: 31px;
    padding: 2px 4px;
  }

  #lvl-box #lvl {
    font-size: 19px;
  }

  .hud-evolution {
    padding: 3px 5px;
  }

  .hud-xp-label {
    gap: 4px;
    margin-bottom: 4px;
    letter-spacing: .3px;
  }

  #hud-top .xpbar {
    height: 3px;
  }

  #hud-stats {
    min-width: 92px;
    padding: 5px 7px;
  }

  .hud-identity {
    margin-bottom: 4px;
    letter-spacing: .4px;
  }

  .hud-score-row {
    gap: 10px;
  }

  .hud-score-row>div {
    gap: 2px;
  }

  .hud-score-row b {
    font-size: 14px;
  }

  .lu-card {
    width: 98px;
    padding: 5px;
    gap: 3px;
  }

  .lu-card .ico {
    font-size: 16px;
  }

  .lu-card .lu-copy {
    gap: 2px;
  }

  .lu-card .lu-footer {
    padding-top: 4px;
    gap: 3px;
  }
}

@media (max-width:650px) and (max-height:520px) {
  #hud-top {
    width: 136px;
  }

  .lu-card {
    width: 78px;
  }

  .lu-card .ico {
    font-size: 14px;
  }
}

/* Placar de Capture a Bandeira (#hud-ctf) */
#hud-ctf {
  position: fixed;
  left: 50%;
  top: calc(var(--hud-edge) + 64px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 12px;
  border: 1px solid var(--hud-line);
  border-radius: 5px;
  background: var(--hud-panel);
  box-shadow: 0 3px 12px #0003;
  z-index: 12;
  pointer-events: none;
  white-space: nowrap;
}

#hud-ctf .ctf-scores {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .6px;
}

#hud-ctf .ctf-team {
  display: flex;
  align-items: center;
  gap: 5px;
}

#hud-ctf .ctf-team.t0 {
  color: #60a5fa;
}

#hud-ctf .ctf-team.t1 {
  color: #f87171;
}

#hud-ctf .ctf-pts {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 3px;
  font: 900 12px monospace;
  color: #fff;
}

#hud-ctf .ctf-team.t0 .ctf-pts {
  background: #1d4ed8;
  border: 1px solid #60a5fa;
}

#hud-ctf .ctf-team.t1 .ctf-pts {
  background: #b91c1c;
  border: 1px solid #f87171;
}

#hud-ctf .ctf-vs {
  font-size: 9px;
  color: var(--hud-muted);
  font-weight: 700;
}

#hud-ctf .ctf-flags {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 8.5px;
  color: #cbd5c0;
  letter-spacing: .2px;
}

#hud-ctf .ctf-fstat.carried {
  color: var(--hud-lime);
  font-weight: 800;
}

#hud-ctf .ctf-fstat.dropped {
  color: var(--hud-orange);
  font-weight: 800;
}

.team-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.team-dot.t0 {
  background: #3b82f6;
  box-shadow: 0 0 4px #3b82f688;
}

.team-dot.t1 {
  background: #ef4444;
  box-shadow: 0 0 4px #ef444488;
}

@media (max-height:520px) {
  #hud-ctf {
    top: calc(var(--hud-edge) + 34px);
    padding: 3px 8px;
    gap: 1px;
  }

  #hud-ctf .ctf-scores {
    font-size: 9px;
    gap: 6px;
  }

  #hud-ctf .ctf-pts {
    min-width: 16px;
    height: 14px;
    font-size: 10px;
  }

  #hud-ctf .ctf-flags {
    font-size: 7px;
    gap: 6px;
  }
}
/* Objetivos do CTF: visíveis sem disputar toque com os controles flutuantes. */
#flag-directions { pointer-events:none; }
.flag-direction {
  position:absolute; bottom:calc(var(--hud-edge) + 32px + env(safe-area-inset-bottom));
  display:flex; align-items:center; gap:8px; padding:7px 10px 7px 7px;
  color:var(--flag-color); background:#14212bea; border:1px solid var(--flag-color);
  border-radius:7px; box-shadow:0 3px 12px #0003; text-shadow:none;
}
#flag-direction-own { right:calc(var(--hud-edge) + var(--hud-ability) + 12px + env(safe-area-inset-right)); background:#291d28ed; }
.flag-pointer { display:grid; place-items:center; width:34px; height:34px; flex:none; border-radius:50%; background:#ffffff0c; }
.flag-pointer svg { width:30px; height:30px; fill:none; stroke:currentColor; stroke-width:3; stroke-linecap:round; stroke-linejoin:round; transform:rotate(var(--flag-angle)); }
.flag-direction-copy { display:flex; flex-direction:column; gap:3px; text-align:left; }
.flag-direction-copy small { font:750 9px Arial,sans-serif; letter-spacing:1px; }
.flag-direction-copy b { color:#f4f4ed; font:800 10px Arial,sans-serif; white-space:nowrap; }
@media (max-width:650px), (max-height:360px) {
  .flag-direction { gap:5px; padding:5px 7px 5px 5px; }
  .flag-pointer { width:28px; height:28px; }
  .flag-pointer svg { width:25px; height:25px; }
  .flag-direction-copy small { font-size:8px; }
  .flag-direction-copy b { font-size:9px; }
}

/* Destino de captura ativo, independente da cor do território invadido. */
.ctf-destination { margin-top: 3px; color: #e8f1c8; font-size: 8px; line-height: 1.25; letter-spacing: .2px; }
.ctf-destination b { color: #d6f266; }
