/* One device controls one hero; both cameras fill their own screens. */
body:not([data-local-player]) .player-ui { display: none; }
.player-ui, .player-ui.blue, .player-ui.red,
#game-shell.portrait .player-ui, #game-shell.portrait .player-ui.red {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
body[data-local-player="0"] .red .mobile-controls,
body[data-local-player="1"] .blue .mobile-controls { display: none; }
#pause-button, #pause-button[hidden] { display: none; }
#game-shell.portrait #global-bar {
  top: max(6px, env(safe-area-inset-top)); left: 50%;
  transform: translateX(-50%); height: auto; padding: 4px 8px;
}
#game-shell.portrait #global-bar .brand { display: inline; }
#game-shell.portrait .hero-hud { top: 48px; }
#game-shell.portrait .red .hero-hud { top: 48px; }
#game-shell.portrait .mobile-controls { bottom: max(10px, env(safe-area-inset-bottom)); }
.player-ui .mobile-controls { bottom: max(10px, env(safe-area-inset-bottom)); }
.hero-hud { width: min(230px, 34vw); }
.red .hero-hud { left: auto; right: max(12px, env(safe-area-inset-right)); }
.blue .hero-hud { left: max(12px, env(safe-area-inset-left)); }
.menu-card { width: min(790px, 100%); }
.menu-card h2 { margin: 4px 0 10px; font: 800 22px 'Barlow Condensed', Impact, sans-serif; }
.menu-card .hero-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.server-row { display: block; margin-top: 12px; color: #a9c7cc; font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.server-row input {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px;
  border-radius: 9px; border: 1px solid #779fa58a;
  background: #081d26; color: #e6f7f4; font: 600 14px Inter, Arial, sans-serif;
  outline: none;
}
.server-row input:focus { border-color: #f7ce79; box-shadow: 0 0 0 2px #f7ce792c; }
.queue-actions { display: flex; align-items: center; gap: 8px; }
.queue-actions .secondary { margin: 0; }
#cancel-button[hidden] { display: none; }
#queue-status { max-width: 400px; color: #c8e0e0; }
#queue-status.error { color: #ff9eaa; }
#queue-status.waiting { color: #f6d691; }
.menu-card { max-height: calc(100dvh - 12px); display: flex; flex-direction: column; overflow: hidden; }
.menu-scroll { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.menu-bottom { flex: none; padding: 9px 0 2px; background: #0d232d; }
.update-status { margin: -4px 0 8px; color: #88cdb6; font-size: 11px; font-weight: 700; }
.role-filters, .shop-filters { display: flex; gap: 5px; overflow-x: auto; padding: 2px 0 7px; scrollbar-width: thin; }
.filter-chip { flex: none; padding: 5px 9px; border: 1px solid #6b8e8f77; border-radius: 999px; background: #102b34; color: #bdd8d8; font: 800 11px Inter, Arial, sans-serif; white-space: nowrap; }
.filter-chip.active { border-color: #f2ca7e; color: #19262c; background: #f2ca7e; }
.menu-card .hero-list { grid-template-columns: repeat(5, minmax(0, 1fr)); max-height: min(28vh, 215px); overflow-y: auto; padding: 2px; scrollbar-width: thin; }
.hero-option.custom-art, .hero-option.custom-art:hover, .hero-option.custom-art.selected { background-size: 100% 100%, auto 105%; background-position: center, center; background-repeat: no-repeat; }
.hero-details { display: grid; gap: 3px; padding: 8px 10px; margin: 7px 0; border: 1px solid #6b8d8766; border-radius: 9px; background: #061922aa; color: #bbd5d3; font-size: 11px; line-height: 1.25; }
.hero-details strong { color: #f7d993; font-size: 13px; }
.hero-details b { color: #d9e9db; }
.emblem-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.emblem-option { min-width: 0; padding: 7px 6px; border: 1px solid #6b8e8f77; border-radius: 8px; background: #112b34; color: #e6f4ec; text-align: left; }
.emblem-option.selected { border-color: #f2ca7e; background: #4d412d; box-shadow: inset 0 0 0 1px #f2ca7e88; }
.emblem-option strong, .emblem-option small { display: block; }
.emblem-option strong { font-size: 11px; }
.emblem-option small { margin-top: 2px; color: #abcac8; font-size: 9px; line-height: 1.15; }
.shop-card { width: min(680px, 96vw); }
.shop-filters { margin-bottom: 6px; }
.shop-card #shop-items { max-height: min(49vh, 410px); overflow-y: auto; }
.shop-card .item-card { min-height: 71px; }
.joystick-zone { position: absolute; left: max(0px, env(safe-area-inset-left)); bottom: 0; width: min(42vw, 400px); height: min(43vh, 260px); pointer-events: auto; touch-action: none; z-index: 2; }
.joystick-zone .stick { position: absolute; left: 88px; top: calc(100% - 72px); transform: translate(-50%, -50%); pointer-events: none; opacity: .72; transition: opacity .12s; }
.joystick-zone.active .stick { opacity: 1; box-shadow: inset 0 0 18px #0006, 0 0 25px #78dce777; }
.joystick-zone .stick-knob { pointer-events: none; }
.mobile-controls .actions { position: relative; z-index: 3; margin-left: auto; }
.apk-download { display: inline-block; margin-top: 8px; color: #f4d38e; font-size: 12px; font-weight: 800; text-decoration: underline; }
.android-app .apk-download { display: none; }
@media (max-height: 700px) and (orientation: landscape) {
  .menu-card { padding: 10px 16px; }
  .menu-card .hero-option { min-height: 72px; }
  .menu-card .hero-list { gap: 5px; }
  .server-row { margin-top: 6px; }
  .server-row input { padding: 6px 10px; }
  .menu-bottom { margin-top: 7px; }
  #last-result { display: none; }
  .menu-card .hero-list { max-height: min(27vh, 190px); }
  .hero-details { font-size: 9px; padding: 4px 7px; }
  .emblem-option { padding: 4px; }
  .emblem-option small { font-size: 8px; }
}
@media (max-width: 700px) {
  .hero-hud { top: 39px; width: min(43vw, 190px); }
  .menu-card .hero-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu-card .hero-option { min-height: 78px; }
  .menu-bottom { display: flex; flex-wrap: wrap; }
  .queue-actions { width: 100%; }
  .queue-actions .primary { flex: 1; }
  .menu-card .hero-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .emblem-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .joystick-zone { width: 50vw; height: min(38vh, 230px); }
  .joystick-zone .stick { left: 65px; top: calc(100% - 55px); }
}
