/* Mobile web layer. Loaded last so the game has a dedicated touch layout. */
:root {
  --mobile-hud-height: 58px;
  --mobile-action-rail-width: 66px;
  --mobile-bottom-nav-height: 64px;
  --mobile-sheet-height: 156px;
  --mobile-touch-size: 48px;
}

body.mobile-ui.match-active {
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

body.mobile-ui.match-active .shell {
  display: block;
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

body.mobile-ui.match-active .brand,
body.mobile-ui.match-active .account-panel,
body.mobile-ui.match-active .setup-panel,
body.mobile-ui.match-active .locked-class {
  display: none !important;
}

body.mobile-ui.match-active .game-area {
  display: grid;
  grid-template-rows: var(--mobile-hud-height) minmax(0, 1fr);
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  gap: 6px;
  overflow: hidden;
  padding:
    calc(env(safe-area-inset-top) + 5px)
    calc(env(safe-area-inset-right) + 7px)
    calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom) + 7px)
    calc(env(safe-area-inset-left) + 7px);
}

body.mobile-ui.match-active .mobile-top-bar {
  position: relative;
  z-index: 52;
  display: grid;
  grid-template-columns: minmax(120px, 0.75fr) minmax(0, 1.95fr) minmax(50px, auto);
  align-items: stretch;
  gap: 6px;
  min-height: var(--mobile-hud-height);
  padding: 5px;
  border: 1px solid rgba(215, 169, 74, 0.32);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.1), transparent 58%),
    rgba(7, 12, 9, 0.93);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
}

body.mobile-ui.match-active .mobile-player-chip {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
}

body.mobile-ui.match-active .mobile-status-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
}

body.mobile-ui.match-active .mobile-player-chip strong,
body.mobile-ui.match-active .mobile-player-chip span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui.match-active .mobile-player-chip strong {
  color: #fff8e8;
  font-size: 0.88rem;
  line-height: 1.05;
}

body.mobile-ui.match-active .mobile-player-chip span {
  color: #9fd7ff;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.05;
}

body.mobile-ui.match-active .mobile-player-book-button,
body.mobile-ui.match-active .mobile-player-traits-button,
body.mobile-ui.match-active .mobile-menu-button,
body.mobile-ui.match-active .mobile-close-button,
body.mobile-ui.match-active .mobile-action-button {
  min-width: var(--mobile-touch-size);
  min-height: var(--mobile-touch-size);
  border: 1px solid rgba(215, 169, 74, 0.38);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.12), transparent 58%),
    rgba(9, 14, 11, 0.95);
  color: #fff8e8;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 950;
  line-height: 1.05;
  cursor: pointer;
  touch-action: manipulation;
}

body.mobile-ui.match-active .mobile-status-buttons .mobile-player-book-button,
body.mobile-ui.match-active .mobile-status-buttons .mobile-player-traits-button {
  min-width: 0;
  min-height: 46px;
  padding: 0;
}

body.mobile-ui.match-active .mobile-player-traits-button {
  color: #f0dcff;
}

body.mobile-ui.match-active .mobile-hud-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
}

body.mobile-ui.match-active .mobile-stat {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 46px;
  padding: 4px 3px;
  border: 1px solid rgba(151, 184, 211, 0.12);
  border-radius: 8px;
  background: rgba(3, 7, 5, 0.62);
  text-align: center;
}

body.mobile-ui.match-active .mobile-stat span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.54rem;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

body.mobile-ui.match-active .mobile-stat strong {
  min-width: 0;
  overflow: hidden;
  color: #fff8e8;
  font-size: 0.72rem;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui.match-active .mobile-stat--life strong { color: #ff8b84; }
body.mobile-ui.match-active .mobile-stat--gold strong { color: var(--gold); }
body.mobile-ui.match-active .mobile-stat--income strong { color: #dff4ba; }
body.mobile-ui.match-active .mobile-stat--level strong,
body.mobile-ui.match-active .mobile-stat--xp strong,
body.mobile-ui.match-active .mobile-stat--timer strong { color: #9ff7ff; }

body.mobile-ui.match-active .mobile-stat-button {
  width: 100%;
  border-color: rgba(98, 234, 208, 0.34);
}

body.mobile-ui.match-active .mobile-stat-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

body.mobile-ui.match-active .mobile-menu-button {
  min-width: 54px;
  padding-inline: 6px;
}

body.mobile-ui.match-active .topbar {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 6px);
  right: calc(env(safe-area-inset-right) + 8px);
  z-index: 70;
  display: block;
  width: 0;
  height: 0;
  min-height: 0;
  padding: 0;
  overflow: visible;
  pointer-events: none;
}

body.mobile-ui.match-active .topbar > .scoreboard,
body.mobile-ui.match-active .topbar > .round-widget,
body.mobile-ui.match-active .topbar .tool-button {
  display: none;
}

body.mobile-ui.match-active .topbar .toolbar,
body.mobile-ui.match-active .topbar .game-menu {
  pointer-events: auto;
}

body.mobile-ui.match-active .game-menu {
  position: fixed;
  top: calc(env(safe-area-inset-top) + var(--mobile-hud-height) + 14px);
  right: calc(env(safe-area-inset-right) + 8px);
  width: min(320px, calc(100vw - 16px));
  max-height: min(70dvh, 560px);
  overflow: auto;
}

body.mobile-ui.match-active .canvas-wrap {
  grid-row: 2;
  flex: none;
  min-height: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  border: 1px solid rgba(215, 169, 74, 0.18);
  border-radius: 10px;
  touch-action: none;
  -webkit-overflow-scrolling: touch;
}

body.mobile-ui.match-active .board-visibility-toggle {
  right: calc(env(safe-area-inset-right) + 8px);
  top: calc(env(safe-area-inset-top) + var(--mobile-hud-height) + 10px);
  width: 38px;
  height: 38px;
  z-index: 54;
}

body.mobile-ui.match-active canvas {
  width: clamp(2300px, 560vw, 3900px);
  max-width: none;
  height: auto;
  aspect-ratio: 3 / 2;
}

body.mobile-ui.match-active .hintbar,
body.mobile-ui.match-active .minimap-panel {
  display: none !important;
}

body.mobile-ui.match-active .mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 58;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  min-height: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom));
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(215, 169, 74, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.08), transparent 44%),
    rgba(5, 9, 7, 0.96);
  box-shadow: 0 -14px 34px rgba(0, 0, 0, 0.38);
}

body.mobile-ui.match-active .mobile-action-button {
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0 5px;
}

body.mobile-ui.match-active .mobile-action-button.is-active {
  border-color: rgba(98, 234, 208, 0.7);
  color: #9ff7ff;
  box-shadow: inset 0 0 0 1px rgba(98, 234, 208, 0.18), 0 0 18px rgba(98, 234, 208, 0.12);
}

body.mobile-ui.match-active .mobile-action-button--danger {
  border-color: rgba(255, 115, 106, 0.5);
  color: #ffd8d8;
}

body.mobile-ui.match-active .sidebar {
  position: fixed;
  top: auto;
  left: calc(env(safe-area-inset-left) + 8px);
  right: calc(env(safe-area-inset-right) + 8px);
  bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom) + 8px);
  z-index: 56;
  width: auto;
  max-width: none;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 38px minmax(0, 1fr);
  gap: 7px;
  height: min(54dvh, 520px);
  max-height: min(54dvh, 520px);
  min-height: 0;
  padding: 8px;
  overflow: hidden;
  border: 1px solid rgba(215, 169, 74, 0.32);
  border-radius: 14px 14px 10px 10px;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.08), transparent 54%),
    rgba(6, 10, 8, 0.97);
  box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.48);
  transform: translateY(calc(100% + var(--mobile-bottom-nav-height) + 24px));
  transition: transform 180ms ease, height 180ms ease, max-height 180ms ease;
}

body.mobile-ui.match-active.mobile-sheet-open .sidebar {
  transform: translateY(0);
}

body.mobile-ui.match-active.mobile-sheet-expanded .sidebar {
  height: calc(100dvh - var(--mobile-hud-height) - var(--mobile-bottom-nav-height) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 22px);
  max-height: calc(100dvh - var(--mobile-hud-height) - var(--mobile-bottom-nav-height) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 22px);
}

body.mobile-ui.match-active .mobile-bottom-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 0;
  padding: 0 2px 4px;
}

body.mobile-ui.match-active .mobile-bottom-sheet-header span {
  display: block;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

body.mobile-ui.match-active .mobile-bottom-sheet-header strong {
  color: #fff8e8;
  font-size: 0.92rem;
  line-height: 1.05;
}

body.mobile-ui.match-active .mobile-sheet-actions {
  display: flex;
  gap: 6px;
}

body.mobile-ui.match-active .mobile-close-button {
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  font-size: 1rem;
}

body.mobile-ui.match-active .sidebar > :not(.mobile-bottom-sheet-header) {
  display: none !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .tower-panel,
body.mobile-ui.match-active[data-mobile-panel="towers"] .bench-panel,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks-panel,
body.mobile-ui.match-active[data-mobile-panel="upgrades"] .selected-panel:not([hidden]),
body.mobile-ui.match-active[data-mobile-panel="upgrades"] .stats-panel,
body.mobile-ui.match-active[data-mobile-panel="augments"] .mobile-augments-panel,
body.mobile-ui.match-active[data-mobile-panel="players"] .mobile-players-panel {
  display: grid !important;
}

body.mobile-ui.match-active .sidebar .panel {
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 8px;
}

body.mobile-ui.match-active .tower-list,
body.mobile-ui.match-active .barracks,
body.mobile-ui.match-active .bench-list,
body.mobile-ui.match-active .mobile-player-list {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

body.mobile-ui.match-active .tower-list,
body.mobile-ui.match-active .barracks {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-flow: row;
  gap: 8px;
  padding-right: 2px;
}

body.mobile-ui.match-active .choice-button,
body.mobile-ui.match-active .bench-slot,
body.mobile-ui.match-active .mode-button,
body.mobile-ui.match-active .primary-button,
body.mobile-ui.match-active .danger-button {
  min-height: var(--mobile-touch-size);
}

body.mobile-ui.match-active .tower-panel .choice-button,
body.mobile-ui.match-active .barracks .choice-button {
  position: relative;
  height: auto;
  min-height: 106px;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  grid-template-rows: none;
  align-items: start;
  justify-items: stretch;
  gap: 8px;
  padding: 8px;
  text-align: left;
}

body.mobile-ui.match-active .choice-icon {
  width: 50px;
  height: 50px;
}

body.mobile-ui.match-active .shop-card .choice-main,
body.mobile-ui.match-active .unit-shop-card .choice-main {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
  padding-right: 0;
}

body.mobile-ui.match-active .shop-card .choice-name,
body.mobile-ui.match-active .unit-shop-card .choice-name {
  min-width: 0;
  overflow: hidden;
  color: #fff8e8;
  font-size: 0.78rem;
  line-height: 1.08;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui.match-active .mobile-shop-rarity,
body.mobile-ui.match-active .tower-meta-row,
body.mobile-ui.match-active .tower-trait-list--compact {
  display: none !important;
}

body.mobile-ui.match-active .tower-stat-grid,
body.mobile-ui.match-active .unit-shop-primary,
body.mobile-ui.match-active .unit-shop-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
}

body.mobile-ui.match-active .tower-stat-grid > .stat-pill,
body.mobile-ui.match-active .unit-shop-pill,
body.mobile-ui.match-active .unit-shop-details > span {
  min-width: 0;
  min-height: 22px;
  padding: 3px 5px;
  border: 1px solid rgba(151, 184, 211, 0.14);
  border-radius: 5px;
  background: rgba(4, 8, 6, 0.48);
  font-size: 0.6rem;
  line-height: 1.05;
}

body.mobile-ui.match-active .shop-card .choice-cost,
body.mobile-ui.match-active .unit-shop-card .choice-cost {
  position: static;
  align-self: start;
  min-width: 40px;
  padding: 5px 6px;
  border: 1px solid rgba(242, 184, 75, 0.34);
  border-radius: 999px;
  background: rgba(4, 7, 5, 0.86);
  color: var(--gold);
  font-size: 0.76rem;
  text-align: center;
}

body.mobile-ui.match-active .bench-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

body.mobile-ui.match-active .bench-slot {
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 6px;
  padding: 7px;
}

body.mobile-ui.match-active .bench-slot .choice-icon {
  width: 42px;
  height: 42px;
}

body.mobile-ui.match-active .resource-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.mobile-ui.match-active .selected-panel {
  gap: 8px;
}

body.mobile-ui.match-active .selected-panel .mode-button,
body.mobile-ui.match-active .selected-panel .danger-button,
body.mobile-ui.match-active #buyXpButton {
  width: 100%;
}

body.mobile-ui.match-active .mobile-player-list {
  display: grid;
  gap: 7px;
}

body.mobile-ui.match-active .mobile-player-row {
  display: grid;
  grid-template-columns: minmax(82px, 1fr) repeat(4, minmax(38px, auto)) 68px;
  align-items: center;
  gap: 7px;
  min-height: 54px;
  padding: 7px 8px;
  border: 1px solid rgba(151, 184, 211, 0.14);
  border-radius: 9px;
  background: rgba(7, 12, 9, 0.72);
  color: #fff8e8;
  text-align: left;
}

body.mobile-ui.match-active .mobile-player-main {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
}

body.mobile-ui.match-active .mobile-player-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--player-color, var(--gold));
}

body.mobile-ui.match-active .mobile-player-row.is-local {
  border-color: rgba(98, 234, 208, 0.52);
}

body.mobile-ui.match-active .mobile-player-row.is-dead {
  opacity: 0.56;
  filter: grayscale(1);
}

body.mobile-ui.match-active .mobile-player-row strong,
body.mobile-ui.match-active .mobile-player-stat b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui.match-active .mobile-player-stat {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 3px 4px;
  border: 1px solid rgba(151, 184, 211, 0.1);
  border-radius: 6px;
  background: rgba(3, 7, 5, 0.42);
  text-align: center;
}

body.mobile-ui.match-active .mobile-player-stat small {
  color: var(--muted);
  font-size: 0.5rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

body.mobile-ui.match-active .mobile-player-stat b {
  color: #fff8e8;
  font-size: 0.66rem;
  line-height: 1;
}

body.mobile-ui.match-active .mobile-player-actions {
  display: grid;
  grid-template-columns: repeat(2, 32px);
  gap: 4px;
  justify-content: end;
}

body.mobile-ui.match-active .mobile-player-actions button {
  min-width: 32px;
  min-height: 32px;
  border: 1px solid rgba(215, 169, 74, 0.28);
  border-radius: 8px;
  background: rgba(4, 8, 6, 0.58);
  color: #efe0ad;
  font: inherit;
  font-size: 0.62rem;
  font-weight: 950;
}

body.mobile-ui.match-active .mobile-placement-toolbar {
  position: fixed;
  left: calc(env(safe-area-inset-left) + 10px);
  right: calc(env(safe-area-inset-right) + 10px);
  top: calc(var(--mobile-hud-height) + env(safe-area-inset-top) + 14px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  padding: 7px 8px;
  border: 1px solid rgba(98, 234, 208, 0.48);
  border-radius: 10px;
  background: rgba(5, 12, 10, 0.94);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
}

body.mobile-ui.match-active .mobile-placement-toolbar[hidden] {
  display: none !important;
}

body.mobile-ui.match-active .mobile-placement-toolbar span {
  min-width: 0;
  overflow: hidden;
  color: #9ff7ff;
  font-size: 0.8rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui.match-active .chat-panel {
  display: none !important;
  pointer-events: none;
}

body.mobile-ui.match-active.chat-panel-open .chat-panel:not([hidden]) {
  position: fixed;
  right: calc(var(--mobile-action-rail-width) + env(safe-area-inset-right) + 10px);
  bottom: calc(env(safe-area-inset-bottom) + 10px);
  z-index: 88;
  display: grid !important;
  width: min(342px, calc(100vw - var(--mobile-action-rail-width) - 24px));
  max-height: calc(100dvh - var(--mobile-hud-height) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 22px);
  overflow: auto;
  pointer-events: auto;
}

body.mobile-ui.match-active.chat-panel-open .chat-panel.is-collapsed {
  display: none !important;
  pointer-events: none;
}

body.mobile-ui.match-active .augment-panel,
body.mobile-ui.match-active .augment-book-panel,
body.mobile-ui.match-active .traits-panel,
body.mobile-ui.match-active .end-modal {
  width: min(620px, calc(100vw - 18px));
  max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 18px);
  overflow: auto;
}

body.mobile-ui.tutorial-active.mobile-landscape::after {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.2), transparent 28%, rgba(0, 0, 0, 0.18)),
    rgba(0, 0, 0, 0.1);
}

body.mobile-ui.tutorial-active.mobile-landscape #gameCanvas {
  margin-top: 0 !important;
}

body.mobile-ui.tutorial-active.mobile-landscape .dynamic-game-canvas,
body.mobile-ui.tutorial-active.mobile-landscape .placement-preview-canvas {
  top: 0 !important;
}

body.mobile-ui.tutorial-active.mobile-landscape .tutorial-coach {
  top: calc(env(safe-area-inset-top) + var(--mobile-hud-height) + 8px) !important;
  right: calc(var(--mobile-action-rail-width) + env(safe-area-inset-right) + 10px) !important;
  bottom: auto !important;
  left: calc(env(safe-area-inset-left) + 8px) !important;
  z-index: 1810;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(172px, 0.34fr);
  grid-template-rows: auto auto auto auto;
  gap: 3px 10px;
  width: auto !important;
  max-height: 122px !important;
  padding: 8px 10px 9px !important;
  overflow: hidden !important;
  border-radius: 10px;
}

body.mobile-ui.tutorial-active.mobile-landscape.mobile-sheet-open .tutorial-coach {
  top: auto !important;
  bottom: calc(var(--mobile-sheet-height) + env(safe-area-inset-bottom) + 8px) !important;
  max-height: 122px !important;
}

body.mobile-ui.tutorial-active.mobile-landscape .tutorial-coach-header {
  grid-column: 1;
  gap: 8px;
  min-width: 0;
}

body.mobile-ui.tutorial-active.mobile-landscape .tutorial-coach-header [data-tutorial-count] {
  flex: 0 0 auto;
}

body.mobile-ui.tutorial-active.mobile-landscape .tutorial-coach-header [data-tutorial-close] {
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  font-size: 0.68rem;
}

body.mobile-ui.tutorial-active.mobile-landscape .tutorial-coach h2 {
  grid-column: 1;
  margin: 0 !important;
  overflow: hidden;
  font-size: 0.8rem !important;
  line-height: 1.05 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui.tutorial-active.mobile-landscape .tutorial-coach p:not(.tutorial-requirement) {
  display: -webkit-box !important;
  grid-column: 1;
  margin: 0 !important;
  overflow: hidden;
  color: #f2ead4;
  font-size: 0.58rem;
  line-height: 1.18;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.mobile-ui.tutorial-active.mobile-landscape .tutorial-requirement {
  grid-column: 1;
  min-height: 0;
  margin: 0 !important;
  overflow: hidden;
  font-size: 0.6rem;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui.tutorial-active.mobile-landscape .tutorial-coach-actions {
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: stretch;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 0 !important;
}

body.mobile-ui.tutorial-active.mobile-landscape .tutorial-coach-actions .mode-button,
body.mobile-ui.tutorial-active.mobile-landscape .tutorial-coach-actions .primary-button {
  min-height: 0 !important;
  height: 100%;
  padding: 4px 8px !important;
  font-size: 0.72rem !important;
}

body.mobile-ui.tutorial-active.mobile-landscape[data-tutorial-coach="bottom"] .tutorial-coach,
body.mobile-ui.tutorial-active.mobile-landscape[data-tutorial-coach="sheet"] .tutorial-coach {
  top: auto !important;
  bottom: calc(var(--mobile-sheet-height) + env(safe-area-inset-bottom) + 8px) !important;
}

body.mobile-ui.tutorial-active.mobile-landscape[data-tutorial-coach="augment"].augment-choice-active .tutorial-coach {
  z-index: 1810;
  top: calc(env(safe-area-inset-top) + 6px) !important;
  right: calc(env(safe-area-inset-right) + 8px) !important;
  bottom: auto !important;
  left: calc(env(safe-area-inset-left) + 8px) !important;
  max-height: 78px !important;
  pointer-events: none;
}

body.mobile-ui.tutorial-active.mobile-landscape[data-tutorial-coach="augment"].augment-choice-active .tutorial-coach p:not(.tutorial-requirement) {
  display: none !important;
}

body.mobile-ui.match-active.mobile-landscape .end-overlay {
  padding:
    calc(env(safe-area-inset-top) + 10px)
    calc(var(--mobile-action-rail-width) + env(safe-area-inset-right) + 10px)
    calc(env(safe-area-inset-bottom) + 10px)
    calc(env(safe-area-inset-left) + 10px);
}

body.mobile-ui.match-active.mobile-landscape .augment-book-overlay,
body.mobile-ui.match-active.mobile-landscape .traits-overlay,
body.mobile-ui.match-active.mobile-landscape .end-overlay:not(.augment-overlay) {
  z-index: 126;
}

body.mobile-ui.match-active.mobile-landscape .augment-overlay {
  align-content: center;
  place-items: center;
  background: rgba(1, 5, 4, 0.38);
  backdrop-filter: blur(3px);
}

body.mobile-ui.match-active.mobile-landscape.tutorial-active[data-tutorial-coach="augment"] .augment-overlay {
  padding:
    calc(env(safe-area-inset-top) + 84px)
    calc(var(--mobile-action-rail-width) + env(safe-area-inset-right) + 10px)
    calc(env(safe-area-inset-bottom) + 8px)
    calc(env(safe-area-inset-left) + 10px) !important;
}

body.mobile-ui.match-active.mobile-landscape .augment-panel {
  width: min(760px, calc(100vw - var(--mobile-action-rail-width) - env(safe-area-inset-left) - env(safe-area-inset-right) - 28px)) !important;
  max-width: none !important;
  max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px) !important;
  padding: 12px !important;
  overflow: hidden !important;
}

body.mobile-ui.match-active.mobile-landscape.tutorial-active[data-tutorial-coach="augment"] .augment-panel {
  max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 102px) !important;
}

body.mobile-ui.match-active.mobile-landscape .augment-panel h2 {
  margin: 6px 0 10px;
  font-size: 1.28rem;
  line-height: 1.05;
}

body.mobile-ui.match-active.mobile-landscape .augment-panel > .eyebrow,
body.mobile-ui.match-active.mobile-landscape .augment-card .augment-rarity {
  font-size: 0.58rem;
  line-height: 1;
}

body.mobile-ui.match-active.mobile-landscape .augment-choice-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
  min-height: 0;
}

body.mobile-ui.match-active.mobile-landscape .augment-card {
  display: grid;
  grid-template-rows: auto auto minmax(42px, 1fr) auto;
  min-width: 0;
  min-height: 0;
  gap: 6px !important;
  padding: 8px !important;
}

body.mobile-ui.match-active.mobile-landscape .augment-card h3 {
  margin: 0;
  overflow: hidden;
  font-size: 0.78rem !important;
  line-height: 1.05 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui.match-active.mobile-landscape .augment-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 0.62rem !important;
  line-height: 1.16 !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

body.mobile-ui.match-active.mobile-landscape .augment-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 6px;
}

body.mobile-ui.match-active.mobile-landscape .augment-actions > button {
  min-height: 34px !important;
  padding: 4px 8px;
  font-size: 0.68rem;
}

body.mobile-ui.match-active.mobile-landscape .augment-book-panel,
body.mobile-ui.match-active.mobile-landscape .traits-panel,
body.mobile-ui.match-active.mobile-landscape .end-modal {
  width: min(720px, calc(100vw - var(--mobile-action-rail-width) - env(safe-area-inset-left) - env(safe-area-inset-right) - 28px)) !important;
  max-width: none !important;
  max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px) !important;
}

body.mobile-ui.match-active.mobile-landscape .augment-book-panel,
body.mobile-ui.match-active.mobile-landscape .traits-panel {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 9px;
  padding: 11px !important;
  overflow: hidden !important;
}

body.mobile-ui.match-active.mobile-landscape .augment-book-head,
body.mobile-ui.match-active.mobile-landscape .traits-panel-header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center !important;
  gap: 10px;
  min-width: 0;
  margin: 0 !important;
}

body.mobile-ui.match-active.mobile-landscape .augment-book-head > div,
body.mobile-ui.match-active.mobile-landscape .traits-panel-header > div:first-child {
  min-width: 0;
}

body.mobile-ui.match-active.mobile-landscape .augment-book-head .eyebrow,
body.mobile-ui.match-active.mobile-landscape .traits-panel-header .eyebrow {
  margin: 0 0 3px !important;
  overflow: hidden;
  font-size: 0.56rem !important;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui.match-active.mobile-landscape .augment-book-head h2,
body.mobile-ui.match-active.mobile-landscape .traits-panel-header h2 {
  margin: 0 !important;
  overflow: hidden;
  font-size: 1.04rem !important;
  line-height: 1.05 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui.match-active.mobile-landscape .augment-book-head .mode-button,
body.mobile-ui.match-active.mobile-landscape .traits-panel-actions .mode-button {
  width: auto !important;
  min-width: 84px !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding: 5px 11px !important;
  font-size: 0.68rem !important;
  line-height: 1;
  white-space: nowrap;
}

body.mobile-ui.match-active.mobile-landscape .augment-book-list,
body.mobile-ui.match-active.mobile-landscape .traits-panel-content {
  min-height: 0;
  max-height: none !important;
  overflow: auto !important;
  overscroll-behavior: contain;
  padding-right: 3px;
  -webkit-overflow-scrolling: touch;
}

body.mobile-ui.match-active.mobile-landscape .augment-book-list {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

body.mobile-ui.match-active.mobile-landscape .augment-book-entry {
  min-height: 0 !important;
  gap: 5px !important;
  padding: 8px !important;
}

body.mobile-ui.match-active.mobile-landscape .augment-book-entry h3 {
  margin: 0;
  overflow: hidden;
  font-size: 0.78rem !important;
  line-height: 1.05 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui.match-active.mobile-landscape .augment-book-entry p,
body.mobile-ui.match-active.mobile-landscape .augment-book-empty {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 0.62rem !important;
  line-height: 1.18 !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel-content {
  display: grid;
  gap: 9px !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-section {
  gap: 6px !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-section h3 {
  margin: 0 !important;
  font-size: 0.66rem !important;
  line-height: 1;
  letter-spacing: 0;
}

body.mobile-ui.match-active.mobile-landscape .traits-card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 7px !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .element-resistance-overview {
  gap: 5px !important;
  padding: 6px !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .element-resistance-overview-head {
  gap: 6px !important;
  font-size: 0.52rem !important;
  line-height: 1 !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .element-resistance-overview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 4px !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .element-resistance-overview-cell {
  grid-template-columns: minmax(0, 1fr) 1.6ch !important;
  gap: 3px !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .element-resistance-overview-cell em {
  font-size: 0.5rem !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .element-resistance-chip {
  min-width: 0 !important;
  min-height: 17px !important;
  grid-template-columns: 12px minmax(0, 1fr) !important;
  gap: 2px !important;
  padding: 1px 3px !important;
  font-size: 0.46rem !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .element-resistance-chip strong {
  min-width: 0 !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .element-resistance-icon {
  width: 12px !important;
  height: 12px !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-card-toggle {
  min-height: 42px !important;
  padding: 6px 8px !important;
  gap: 7px !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-icon {
  flex-basis: 27px;
  width: 27px;
  height: 27px;
  border-radius: 7px;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-icon svg {
  width: 17px;
  height: 17px;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-card-main {
  gap: 7px;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-card-main strong {
  font-size: 0.72rem;
  line-height: 1.05;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-card-main em,
body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-summary-preview {
  font-size: 0.56rem;
  line-height: 1.05;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-tier {
  min-width: 28px;
  padding: 3px 6px;
  font-size: 0.58rem;
  line-height: 1;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-toggle-indicator {
  flex-basis: 22px;
  width: 22px;
  height: 22px;
  font-size: 0.86rem;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-card-detail {
  gap: 6px !important;
  padding: 0 8px 8px !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-card-detail p,
body.mobile-ui.match-active.mobile-landscape .traits-panel .traits-empty,
body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-tower-list {
  font-size: 0.62rem !important;
  line-height: 1.2 !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-progress,
body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-requirement,
body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-tower-list {
  gap: 5px !important;
  padding: 5px 6px !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-progress > span,
body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-requirement > span,
body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-tower-list > span {
  font-size: 0.62rem !important;
  line-height: 1.1 !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-progress > strong,
body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-requirement > strong,
body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-tower-list > strong {
  font-size: 0.72rem !important;
  line-height: 1.05 !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-bonus-block,
body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-requirements,
body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-tier-roadmap {
  gap: 5px !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-bonus-block h4,
body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-tier-roadmap h4 {
  font-size: 0.58rem !important;
  line-height: 1;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-bonus-block > span,
body.mobile-ui.match-active.mobile-landscape .traits-panel .tower-trait-chip {
  min-height: 18px !important;
  padding: 2px 5px !important;
  font-size: 0.54rem !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-tier-row {
  gap: 5px !important;
  padding: 6px !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-tier-row-head,
body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-tier-row-body {
  grid-template-columns: minmax(82px, 0.4fr) minmax(0, 1fr) !important;
  gap: 6px !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-tier-row-head strong {
  font-size: 0.64rem !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-tier-row-head span,
body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-tier-row-body em {
  font-size: 0.54rem !important;
  line-height: 1.1;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .trait-reference-towers {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .reference-tower-card {
  grid-template-columns: 32px minmax(0, 1fr) !important;
  min-height: 42px !important;
  gap: 6px !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .reference-tower-card .choice-icon {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  min-height: 30px !important;
}

body.mobile-ui.match-active.mobile-landscape .traits-panel .reference-tower-card strong {
  font-size: 0.58rem !important;
  line-height: 1;
}

body.mobile-ui.match-active.mobile-landscape .end-modal {
  padding: 14px !important;
  overflow: auto;
}

body.mobile-ui.match-active.mobile-landscape .end-modal h2 {
  font-size: 1.28rem !important;
  line-height: 1.08;
}

body.mobile-ui.match-active.mobile-landscape .end-modal p {
  font-size: 0.76rem;
  line-height: 1.25;
}

body.mobile-ui.match-active.mobile-landscape .end-actions {
  gap: 7px;
}

body.mobile-ui.match-active.mobile-landscape .end-actions .primary-button,
body.mobile-ui.match-active.mobile-landscape .end-actions .mode-button {
  min-height: 38px !important;
  margin: 0 !important;
  font-size: 0.72rem;
}

body.mobile-ui.match-active.end-screen-open .game-area,
body.mobile-ui.match-active.end-screen-open .sidebar,
body.mobile-ui.match-active.end-screen-open .mobile-bottom-nav,
body.mobile-ui.match-active.end-screen-open .mobile-placement-toolbar,
body.mobile-ui.match-active.end-screen-open .board-visibility-toggle {
  filter: blur(2px) saturate(0.68);
  opacity: 0.18;
  pointer-events: none !important;
}

body.mobile-ui.match-active #endOverlay,
body.mobile-ui.match-active #surrenderOverlay {
  z-index: 2200;
  place-items: stretch;
  padding:
    calc(env(safe-area-inset-top) + 10px)
    calc(env(safe-area-inset-right) + 10px)
    calc(env(safe-area-inset-bottom) + 10px)
    calc(env(safe-area-inset-left) + 10px) !important;
  background:
    radial-gradient(circle at 50% 18%, rgba(98, 234, 208, 0.12), transparent 34%),
    rgba(1, 5, 4, 0.82);
  backdrop-filter: blur(7px) saturate(0.92);
}

body.mobile-ui.match-active #endOverlay .end-modal,
body.mobile-ui.match-active #surrenderOverlay .end-modal {
  align-self: stretch;
  justify-self: center;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  width: min(620px, 100%) !important;
  max-height: none !important;
  min-height: 0;
  padding: 14px !important;
  overflow: hidden !important;
  border-color: rgba(98, 234, 208, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.08), transparent 58%),
    rgba(5, 10, 8, 0.96);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.58);
}

body.mobile-ui.match-active #surrenderOverlay .end-modal {
  align-self: center;
  grid-template-rows: auto auto auto;
  min-height: 0;
  max-height: min(360px, calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px)) !important;
}

body.mobile-ui.match-active #endOverlay .end-modal > .eyebrow,
body.mobile-ui.match-active #surrenderOverlay .end-modal > .eyebrow {
  margin: 0 0 4px;
  font-size: 0.62rem;
}

body.mobile-ui.match-active #endOverlay .end-modal h2,
body.mobile-ui.match-active #surrenderOverlay .end-modal h2 {
  margin: 0;
  font-size: clamp(1.35rem, 5vw, 1.9rem) !important;
  line-height: 1.04;
}

body.mobile-ui.match-active #endOverlay .end-modal > p:not(.eyebrow),
body.mobile-ui.match-active #surrenderOverlay .end-modal > p:not(.eyebrow) {
  margin: 7px 0 9px;
  color: rgba(242, 234, 212, 0.86);
  font-size: 0.78rem;
  line-height: 1.28;
}

body.mobile-ui.match-active #endOverlay .end-recap {
  min-height: 0;
  margin: 0;
  padding: 2px 2px 8px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

body.mobile-ui.match-active #endOverlay .end-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

body.mobile-ui.match-active #endOverlay .end-stat {
  padding: 6px;
  border-radius: 6px;
}

body.mobile-ui.match-active #endOverlay .end-stat span,
body.mobile-ui.match-active #endOverlay .end-standing span {
  font-size: 0.58rem;
  line-height: 1.05;
}

body.mobile-ui.match-active #endOverlay .end-stat strong {
  margin-top: 2px;
  font-size: 0.78rem;
}

body.mobile-ui.match-active #endOverlay .end-insight {
  gap: 4px;
  padding: 7px;
}

body.mobile-ui.match-active #endOverlay .end-insight p,
body.mobile-ui.match-active #endOverlay .end-insight span {
  font-size: 0.62rem;
  line-height: 1.22;
}

body.mobile-ui.match-active #endOverlay .end-standing {
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 6px;
  min-height: 30px;
  padding: 5px 6px;
}

body.mobile-ui.match-active #endOverlay .end-standing span:nth-of-type(3),
body.mobile-ui.match-active #endOverlay .end-standing .end-standing-defense {
  display: none;
}

body.mobile-ui.match-active #endOverlay .end-actions,
body.mobile-ui.match-active #surrenderOverlay .end-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 -2px -2px;
  padding: 9px 2px 2px;
  background:
    linear-gradient(180deg, transparent, rgba(5, 10, 8, 0.94) 28%),
    rgba(5, 10, 8, 0.88);
}

body.mobile-ui.match-active #endOverlay .end-actions .primary-button,
body.mobile-ui.match-active #endOverlay .end-actions .mode-button,
body.mobile-ui.match-active #surrenderOverlay .end-actions .danger-button,
body.mobile-ui.match-active #surrenderOverlay .end-actions .mode-button {
  min-height: 46px !important;
  margin: 0 !important;
  padding: 9px 10px !important;
  border-radius: 9px;
  font-size: 0.78rem;
  line-height: 1.05;
}

body.mobile-ui.match-active #endOverlay .end-actions .mode-button[hidden] {
  display: none !important;
}

body.mobile-ui.match-active #endOverlay .end-actions:has(.mode-button[hidden]) {
  grid-template-columns: 1fr;
}

body.mobile-ui.match-active.mobile-landscape #endOverlay .end-modal {
  width: min(760px, 100%) !important;
}

body.mobile-ui.match-active.mobile-landscape #endOverlay .end-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* Landscape is the primary mobile game layout. */
body.mobile-ui.match-active.mobile-landscape {
  --mobile-hud-height: 56px;
  --mobile-action-rail-width: 66px;
  --mobile-sheet-height: clamp(112px, 32dvh, 132px);
  --mobile-touch-size: 46px;
}

body.mobile-ui.match-active.mobile-landscape .game-area {
  grid-template-rows: var(--mobile-hud-height) minmax(0, 1fr);
  padding:
    calc(env(safe-area-inset-top) + 5px)
    calc(var(--mobile-action-rail-width) + env(safe-area-inset-right) + 8px)
    calc(env(safe-area-inset-bottom) + 8px)
    calc(env(safe-area-inset-left) + 8px);
}

body.mobile-ui.match-active.mobile-landscape .mobile-top-bar {
  grid-template-columns: minmax(132px, 0.72fr) minmax(360px, 2fr) 58px;
  min-height: var(--mobile-hud-height);
}

body.mobile-ui.match-active.mobile-landscape .mobile-player-chip {
  grid-template-columns: 80px minmax(0, 1fr);
}

body.mobile-ui.match-active.mobile-landscape .mobile-hud-stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

body.mobile-ui.match-active.mobile-landscape .mobile-stat {
  min-height: 44px;
  padding: 4px 3px;
}

body.mobile-ui.match-active.mobile-landscape .canvas-wrap {
  border-radius: 10px;
}

body.mobile-ui.match-active.mobile-landscape canvas {
  width: clamp(2480px, 520vw, 3900px);
}

body.mobile-ui.match-active.mobile-landscape .mobile-bottom-nav {
  top: calc(env(safe-area-inset-top) + var(--mobile-hud-height) + 7px);
  right: 0;
  bottom: 0;
  left: auto;
  width: calc(var(--mobile-action-rail-width) + env(safe-area-inset-right));
  min-height: 0;
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(54px, 1fr);
  align-content: stretch;
  gap: 8px;
  padding: 8px calc(env(safe-area-inset-right) + 7px) calc(env(safe-area-inset-bottom) + 8px) 7px;
  border-top: 0;
  border-left: 1px solid rgba(215, 169, 74, 0.32);
  border-radius: 16px 0 0 0;
}

body.mobile-ui.match-active.mobile-landscape .mobile-bottom-nav .mobile-action-button {
  min-width: 0;
  min-height: 52px;
  padding: 0 3px;
  font-size: 0;
}

body.mobile-ui.match-active.mobile-landscape .mobile-bottom-nav .mobile-action-button::before {
  display: block;
  font-size: 0.66rem;
  line-height: 1.05;
  text-align: center;
}

body.mobile-ui.match-active.mobile-landscape .mobile-bottom-nav [data-mobile-panel="towers"]::before { content: "Tours"; }
body.mobile-ui.match-active.mobile-landscape .mobile-bottom-nav [data-mobile-panel="monsters"]::before { content: "Units"; }
body.mobile-ui.match-active.mobile-landscape .mobile-bottom-nav [data-mobile-panel="upgrades"]::before { content: "Evo"; }
body.mobile-ui.match-active.mobile-landscape .mobile-bottom-nav [data-mobile-panel="augments"]::before { content: "Aug"; }
body.mobile-ui.match-active.mobile-landscape .mobile-bottom-nav [data-mobile-panel="players"]::before { content: "Joueurs"; }

body.mobile-ui.match-active.mobile-landscape .sidebar {
  top: auto !important;
  left: calc(env(safe-area-inset-left) + 8px) !important;
  right: calc(var(--mobile-action-rail-width) + env(safe-area-inset-right) + 10px) !important;
  bottom: calc(env(safe-area-inset-bottom) + 8px) !important;
  width: auto !important;
  max-width: none !important;
  height: var(--mobile-sheet-height) !important;
  max-height: var(--mobile-sheet-height) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  padding: 7px !important;
  border-radius: 12px;
}

body.mobile-ui.match-active.mobile-landscape.mobile-sheet-expanded .sidebar {
  height: clamp(210px, 58dvh, 300px);
  max-height: clamp(210px, 58dvh, 300px);
}

body.mobile-ui.match-active.mobile-landscape .mobile-bottom-sheet-header {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 2;
  display: block !important;
  min-height: 0;
  padding: 0;
  pointer-events: none;
}

body.mobile-ui.match-active.mobile-landscape .mobile-bottom-sheet-header > div:first-child,
body.mobile-ui.match-active.mobile-landscape .mobile-bottom-sheet-header #mobileSheetCloseButton {
  display: none !important;
}

body.mobile-ui.match-active.mobile-landscape .mobile-bottom-sheet-header .mobile-sheet-actions {
  display: block;
}

body.mobile-ui.match-active.mobile-landscape .mobile-bottom-sheet-header strong {
  font-size: 0.84rem;
}

body.mobile-ui.match-active.mobile-landscape .mobile-bottom-sheet-header span {
  font-size: 0.5rem;
}

body.mobile-ui.match-active.mobile-landscape .mobile-close-button {
  min-width: 32px;
  min-height: 32px;
}

body.mobile-ui.match-active.mobile-landscape #mobileSheetExpandButton {
  display: grid !important;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 10px;
  pointer-events: auto;
}

body.mobile-ui.match-active.mobile-landscape.selected-tower-panel-floating #selectedTowerPanel:not([hidden]) {
  position: fixed !important;
  top: auto !important;
  right: auto !important;
  bottom: calc(env(safe-area-inset-bottom) + 10px) !important;
  left: calc(env(safe-area-inset-left) + 10px) !important;
  z-index: 68 !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 6px !important;
  width: min(386px, calc(100vw - var(--mobile-action-rail-width) - env(safe-area-inset-left) - env(safe-area-inset-right) - 26px)) !important;
  max-width: none !important;
  max-height: min(43dvh, 164px) !important;
  padding: 7px !important;
  overflow: auto !important;
  border-radius: 12px !important;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.08), transparent 60%),
    rgba(5, 10, 8, 0.94) !important;
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.38);
  pointer-events: auto;
  -webkit-overflow-scrolling: touch;
}

body.mobile-ui.match-active.mobile-landscape.selected-tower-panel-floating #selectedTowerPanel[data-kind="creep"]:not([hidden]) {
  max-height: min(52dvh, 196px) !important;
}

body.mobile-ui.match-active.mobile-landscape.selected-tower-panel-floating #selectedTowerPanel .panel-title {
  grid-column: 1 / -1;
  grid-row: 1;
  min-height: 0;
  margin: 0 !important;
}

body.mobile-ui.match-active.mobile-landscape.selected-tower-panel-floating #selectedTowerPanel .panel-title h2 {
  margin: 0;
  overflow: hidden;
  font-size: 0.62rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui.match-active.mobile-landscape.selected-tower-panel-floating #selectedTowerPanel #sellValueLabel {
  display: none;
}

body.mobile-ui.match-active.mobile-landscape.selected-tower-panel-floating #placedTowerName {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
  overflow: hidden;
  font-size: 0.74rem !important;
  line-height: 1.05 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui.match-active.mobile-landscape.selected-tower-panel-floating #selectedTowerPanel .selected-tower-stats {
  grid-column: 1 / -1;
  grid-row: 3;
  max-height: 42px;
  margin: 0 !important;
  overflow: auto;
  font-size: 0.54rem !important;
  line-height: 1.15 !important;
}

body.mobile-ui.match-active.mobile-landscape.selected-tower-panel-floating #selectedTowerPanel[data-kind="creep"] .selected-tower-stats {
  max-height: 88px;
}

body.mobile-ui.match-active.mobile-landscape.selected-tower-panel-floating #selectedTowerPanel[data-kind="creep"] .selected-stat-row--resistances > span:last-child {
  display: grid;
  gap: 3px;
}

body.mobile-ui.match-active.mobile-landscape.selected-tower-panel-floating #selectedTowerPanel[data-kind="creep"] .element-resistance-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
}

body.mobile-ui.match-active.mobile-landscape.selected-tower-panel-floating #selectedTowerPanel[data-kind="creep"] .element-resistance-chip {
  min-width: 0;
  min-height: 16px;
  grid-template-columns: 11px minmax(0, 1fr);
  gap: 2px;
  padding: 1px 3px;
  font-size: 0.44rem;
}

body.mobile-ui.match-active.mobile-landscape.selected-tower-panel-floating #selectedTowerPanel[data-kind="creep"] .element-resistance-chip strong {
  min-width: 0;
}

body.mobile-ui.match-active.mobile-landscape.selected-tower-panel-floating #selectedTowerPanel[data-kind="creep"] .element-resistance-icon {
  width: 11px;
  height: 11px;
}

body.mobile-ui.match-active.mobile-landscape.selected-tower-panel-floating #selectedTowerPanel .mode-button,
body.mobile-ui.match-active.mobile-landscape.selected-tower-panel-floating #selectedTowerPanel .danger-button {
  grid-row: 4;
  align-self: stretch;
  min-width: 0;
  min-height: 38px !important;
  height: auto;
  margin: 0 !important;
  padding: 4px 6px !important;
  font-size: 0.58rem !important;
  line-height: 1.05;
  white-space: normal;
}

body.mobile-ui.match-active.mobile-landscape.selected-tower-panel-floating #benchTowerButton {
  grid-column: 2;
  order: 0;
  border-color: rgba(98, 234, 208, 0.64);
  background:
    linear-gradient(180deg, rgba(98, 234, 208, 0.16), transparent),
    rgba(5, 16, 15, 0.9);
  color: #9ff7ff;
}

body.mobile-ui.match-active.mobile-landscape.selected-tower-panel-floating #upgradeTowerButton {
  grid-column: 3;
}

body.mobile-ui.match-active.mobile-landscape.selected-tower-panel-floating #sellTowerButton {
  grid-column: 4;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .sidebar {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.38fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .mobile-bottom-sheet-header {
  display: none !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel {
  grid-column: 1;
  grid-row: 1;
  align-self: stretch;
  position: relative;
  height: 100% !important;
  min-width: 0;
  padding: 4px !important;
  padding-left: 46px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-panel {
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  height: 100% !important;
  min-width: 0;
  padding: 4px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .panel-title,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-panel .panel-title,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .barracks-panel .panel-title {
  display: none;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .shop-toolbar {
  position: absolute;
  top: auto !important;
  right: auto !important;
  left: 7px;
  bottom: 7px;
  z-index: 3;
  display: block !important;
  width: 34px;
  height: 34px;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .odds-preview {
  display: none !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] #rerollTowerShopButton,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] #rerollUnitShopButton {
  display: grid !important;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  margin: 0 !important;
  padding: 0 !important;
  place-items: center !important;
  border-radius: 10px !important;
  font-size: 0 !important;
  line-height: 1 !important;
  pointer-events: auto;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] #rerollTowerShopButton > span:first-child,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] #rerollUnitShopButton > span:first-child {
  font-size: 0.94rem !important;
  line-height: 1 !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] #rerollTowerShopButton .action-cost,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] #rerollUnitShopButton .action-cost {
  display: none !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-list {
  grid-auto-flow: column;
  grid-auto-columns: minmax(88px, 1fr) !important;
  grid-template-columns: none !important;
  width: 100% !important;
  height: 100% !important;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 2px 2px 0;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .choice-button {
  grid-template-columns: 1fr !important;
  grid-template-rows: 34px 13px 14px 15px !important;
  justify-items: center;
  align-content: start;
  min-height: 0;
  height: 100% !important;
  gap: 2px;
  padding: 4px;
  text-align: center;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .choice-icon {
  grid-row: 1;
  width: 34px;
  height: 34px;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .choice-main {
  display: contents;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .choice-name {
  display: block !important;
  grid-row: 2;
  width: 100%;
  font-size: 0.52rem;
  line-height: 1;
  text-align: center;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .tower-stat-grid {
  display: contents !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .tower-stat-grid > .stat-pill {
  display: none !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .tower-stat-grid > .stat-pill:first-child {
  grid-row: 3;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  justify-self: center;
  min-width: 42px;
  max-width: 100%;
  min-height: 14px;
  padding: 1px 4px;
  gap: 2px;
  overflow: hidden;
  border-radius: 999px;
  font-size: 0.46rem;
  line-height: 1;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .tower-stat-grid > .stat-pill:first-child .stat-icon {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .tower-stat-grid > .stat-pill:first-child strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .choice-cost {
  grid-row: 4;
  justify-self: center;
  min-width: 32px;
  min-height: 15px;
  padding: 1px 5px;
  font-size: 0.52rem;
  line-height: 1;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-list {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  grid-auto-flow: row !important;
  grid-auto-columns: auto !important;
  gap: 5px !important;
  width: 100% !important;
  height: 100%;
  overflow: auto;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-slot {
  min-height: 0 !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: 30px 16px !important;
  justify-items: center;
  gap: 2px !important;
  padding: 4px !important;
  overflow: hidden;
  text-align: center;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-slot .choice-icon {
  width: 30px !important;
  height: 30px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-main {
  display: block !important;
  min-width: 0;
  width: 100%;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-title {
  display: block !important;
  min-width: 0;
  overflow: hidden;
  font-size: 0.5rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-title strong {
  display: none;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-slot .tower-stat-grid,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-slot .tower-meta-row {
  display: none;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .sidebar {
  height: clamp(130px, 34dvh, 150px) !important;
  max-height: clamp(130px, 34dvh, 150px) !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .barracks-panel {
  position: relative;
  min-width: 0;
  padding: 4px 4px 4px 46px !important;
  overflow: hidden !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .mobile-bottom-sheet-header {
  display: none !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .barracks-panel .panel-title {
  position: absolute;
  left: 7px;
  bottom: 7px;
  z-index: 3;
  display: block !important;
  width: 34px;
  height: 34px;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .barracks-panel .panel-title h2 {
  display: none !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .barracks {
  grid-auto-flow: column !important;
  grid-auto-columns: clamp(188px, 28vw, 214px) !important;
  grid-template-columns: none !important;
  height: 100% !important;
  gap: 7px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .barracks .choice-button {
  grid-template-columns: 42px minmax(0, 1fr) 34px !important;
  grid-template-rows: 16px 18px 17px 21px !important;
  align-items: center !important;
  min-height: 0 !important;
  height: 100% !important;
  gap: 5px !important;
  padding: 6px !important;
  overflow: hidden !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .barracks .choice-icon {
  grid-column: 1 !important;
  grid-row: 1 / 4 !important;
  width: 40px !important;
  height: 40px !important;
  align-self: center !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .barracks .choice-main {
  display: contents !important;
  min-width: 0 !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .barracks .choice-name {
  grid-column: 2 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  font-size: 0.62rem !important;
  line-height: 1 !important;
  text-align: left !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .mobile-shop-rarity {
  display: none !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .unit-shop-primary {
  grid-column: 2 !important;
  grid-row: 2 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 3px !important;
  overflow: hidden !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .unit-shop-details {
  grid-column: 2 !important;
  grid-row: 3 !important;
  display: flex !important;
  gap: 3px !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .unit-shop-pill {
  display: inline-flex !important;
  flex: 0 1 auto !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 36px !important;
  min-height: 16px !important;
  max-width: none !important;
  padding: 1px 3px !important;
  gap: 2px !important;
  font-size: 0.48rem !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .unit-shop-pill strong {
  display: inline-block !important;
  min-width: 0 !important;
  overflow: hidden !important;
  color: #fff8e8 !important;
  font-size: 0.48rem !important;
  line-height: 1 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .unit-shop-pill .selected-stat-icon,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .unit-shop-pill .income-icon {
  flex: 0 0 12px !important;
  width: 12px !important;
  min-width: 12px !important;
  height: 12px !important;
  min-height: 12px !important;
  padding: 1px !important;
  border-radius: 3px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .unit-shop-pill .selected-stat-icon .stat-icon {
  width: 9px !important;
  height: 9px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .unit-shop-details > span {
  display: inline-flex !important;
  flex: 1 1 0 !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0 !important;
  min-height: 16px !important;
  padding: 1px 3px !important;
  gap: 2px !important;
  border-radius: 5px !important;
  font-size: 0.47rem !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .unit-shop-resistances {
  grid-column: 1 / -1 !important;
  grid-row: 4 !important;
  display: block !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .unit-shop-resistance-full {
  display: none !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .unit-shop-resistance-compact {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .unit-shop-resistance-compact .element-resistance-chip {
  flex: 0 1 auto !important;
  min-width: 58px !important;
  min-height: 18px !important;
  grid-template-columns: 12px minmax(0, 1fr) !important;
  gap: 2px !important;
  padding: 1px 4px !important;
  font-size: 0.48rem !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .unit-shop-resistance-compact .element-resistance-chip strong {
  min-width: 0 !important;
  font-size: 0.48rem !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .unit-shop-resistance-compact .element-resistance-icon {
  width: 12px !important;
  height: 12px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .unit-shop-card .choice-cost {
  grid-column: 3 !important;
  grid-row: 1 / 4 !important;
  align-self: center !important;
  justify-self: center !important;
  min-width: 30px !important;
  min-height: 18px !important;
  padding: 2px 4px !important;
  font-size: 0.54rem !important;
  line-height: 1 !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="upgrades"] .sidebar {
  width: min(370px, calc(100vw - var(--mobile-action-rail-width) - 24px));
  right: auto;
  height: auto;
  max-height: min(52dvh, 260px);
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="upgrades"] .selected-panel,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="upgrades"] .stats-panel {
  overflow: hidden;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="players"] .sidebar,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="augments"] .sidebar {
  height: clamp(170px, 46dvh, 260px) !important;
  max-height: clamp(170px, 46dvh, 260px) !important;
}

body.mobile-ui.match-active.mobile-landscape .mobile-placement-toolbar {
  top: calc(env(safe-area-inset-top) + var(--mobile-hud-height) + 8px);
  right: calc(var(--mobile-action-rail-width) + env(safe-area-inset-right) + 10px);
  left: auto;
  width: min(190px, calc(100vw - var(--mobile-action-rail-width) - 24px));
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(5, 12, 10, 0.9);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

body.mobile-ui.match-active.mobile-landscape .mobile-placement-toolbar span {
  font-size: 0.54rem;
}

body.mobile-ui.match-active.mobile-landscape .mobile-placement-toolbar .mobile-action-button {
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  overflow: hidden;
  border-radius: 999px;
  font-size: 0;
}

body.mobile-ui.match-active.mobile-landscape .mobile-placement-toolbar .mobile-action-button::before {
  content: "X";
  font-size: 0.64rem;
  line-height: 1;
}

body.mobile-ui.match-active.mobile-landscape .mobile-placement-toolbar[hidden] {
  display: none !important;
}

/* Portrait remains usable, but the intended mobile mode is landscape. */
body.mobile-ui.match-active.mobile-portrait::after {
  content: "Paysage recommandé";
  position: fixed;
  top: calc(var(--mobile-hud-height) + env(safe-area-inset-top) + 10px);
  left: 50%;
  z-index: 80;
  transform: translateX(-50%);
  padding: 6px 10px;
  border: 1px solid rgba(98, 234, 208, 0.42);
  border-radius: 999px;
  background: rgba(5, 12, 10, 0.88);
  color: #9ff7ff;
  font-size: 0.68rem;
  font-weight: 950;
  pointer-events: none;
}

@media (max-width: 430px) {
  body.mobile-ui.match-active {
    --mobile-hud-height: 128px;
    --mobile-bottom-nav-height: 64px;
    --mobile-touch-size: 44px;
  }

  body.mobile-ui.match-active .game-area {
    grid-template-rows: var(--mobile-hud-height) minmax(0, 1fr);
  }

  body.mobile-ui.match-active .mobile-top-bar {
    grid-template-columns: minmax(0, 1fr) 52px;
    grid-template-rows: auto auto;
  }

  body.mobile-ui.match-active .mobile-player-chip {
    grid-column: 1;
    grid-row: 1;
  }

  body.mobile-ui.match-active .mobile-menu-button {
    grid-column: 2;
    grid-row: 1;
  }

  body.mobile-ui.match-active .mobile-hud-stats {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.mobile-ui.match-active .mobile-stat {
    min-height: 34px;
    grid-template-columns: minmax(28px, auto) minmax(0, 1fr);
    align-items: center;
    gap: 4px;
    text-align: left;
  }

  body.mobile-ui.match-active .mobile-stat strong {
    text-align: right;
  }

  body.mobile-ui.match-active .tower-stat-grid,
  body.mobile-ui.match-active .unit-shop-primary,
  body.mobile-ui.match-active .unit-shop-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.mobile-ui.match-active .mobile-player-row {
    grid-template-columns: minmax(92px, 1fr) repeat(3, minmax(40px, auto)) 66px;
  }

  body.mobile-ui.match-active .mobile-player-stat--score {
    display: none;
  }
}

body.mobile-ui.match-active .unit-shop-card:disabled.is-too-expensive {
  filter: none !important;
  opacity: 1 !important;
}

body.mobile-ui.match-active .unit-shop-card:disabled.is-too-expensive .choice-icon,
body.mobile-ui.match-active .unit-shop-card:disabled.is-too-expensive .choice-main {
  filter: grayscale(1) brightness(0.48) contrast(0.85) !important;
  opacity: 0.46 !important;
}

body.mobile-ui.match-active .unit-shop-card:disabled.is-too-expensive .choice-cost {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 42px !important;
  min-height: 22px !important;
  border: 1px solid rgba(255, 183, 77, 0.86) !important;
  background: rgba(48, 28, 4, 0.96) !important;
  color: #ffd36b !important;
  filter: none !important;
  opacity: 1 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.82) !important;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.42), 0 0 14px rgba(242, 184, 75, 0.24) !important;
  visibility: visible !important;
  z-index: 8 !important;
}

body.mobile-ui.match-active .unit-shop-card:disabled.is-too-expensive {
  border-color: rgba(255, 183, 77, 0.34) !important;
  background: rgba(4, 6, 5, 0.94) !important;
  filter: none !important;
  opacity: 1 !important;
  box-shadow: inset 0 0 0 1px rgba(255, 240, 190, 0.08) !important;
}

body.mobile-ui.match-active .unit-shop-card:disabled.is-too-expensive::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 7 !important;
  border-radius: inherit !important;
  background: rgba(0, 0, 0, 0.34) !important;
  pointer-events: none !important;
}

body.mobile-ui.match-active .unit-shop-card:disabled.is-too-expensive::after {
  content: none !important;
}

body.mobile-ui.match-active .unit-shop-card:disabled.is-too-expensive .choice-icon,
body.mobile-ui.match-active .unit-shop-card:disabled.is-too-expensive .choice-main,
body.mobile-ui.match-active .unit-shop-card:disabled.is-too-expensive .unit-shop-floating-stats {
  filter: grayscale(1) brightness(0.42) contrast(0.82) !important;
  opacity: 0.42 !important;
}

body.mobile-ui.match-active .unit-shop-card:disabled.is-too-expensive .choice-cost {
  position: absolute !important;
  inset: 5px 5px auto auto !important;
  grid-column: auto !important;
  grid-row: auto !important;
  align-self: auto !important;
  justify-self: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 42px !important;
  min-height: 22px !important;
  padding: 3px 6px !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: scale(1.08) !important;
  transform-origin: top right !important;
  z-index: 30 !important;
  border-width: 2px !important;
  border-color: rgba(255, 202, 103, 0.92) !important;
  background: linear-gradient(180deg, rgba(86, 48, 7, 0.98), rgba(40, 22, 3, 0.98)) !important;
  color: #ffe08a !important;
  font-size: 0.66rem !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.9) !important;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.54), 0 0 16px rgba(242, 184, 75, 0.3) !important;
}

/* Mobile TFT-style shop refresh. Scoped to mobile only so desktop keeps its layout. */
body.mobile-ui.match-active[data-mobile-panel="towers"] .tower-panel .choice-button,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks .choice-button {
  position: relative !important;
  overflow: hidden !important;
  border-color: color-mix(in srgb, var(--rarity-color, var(--gold)) 52%, rgba(255, 240, 190, 0.14)) !important;
  border-radius: 9px !important;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--rarity-color, var(--gold)) 18%, transparent), transparent 48%),
    radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--rarity-color, var(--gold)) 28%, transparent), transparent 44%),
    rgba(4, 8, 7, 0.94) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 -28px 42px rgba(0, 0, 0, 0.34) !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .tower-panel .choice-button::before,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks .choice-button::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 0 !important;
  display: block !important;
  border-radius: inherit !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 28%),
    linear-gradient(90deg, var(--rarity-color, var(--gold)) 0 4px, transparent 4px) !important;
  opacity: 0.92 !important;
  pointer-events: none !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .tower-panel .choice-icon,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks .choice-icon {
  position: relative !important;
  z-index: 1 !important;
  border: 0 !important;
  background:
    radial-gradient(circle at 50% 25%, color-mix(in srgb, var(--rarity-color, var(--gold)) 24%, transparent), transparent 52%),
    rgba(2, 5, 5, 0.26) !important;
  box-shadow: inset 0 -18px 28px rgba(0, 0, 0, 0.38) !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .tower-panel .tower-premium-icon img,
body.mobile-ui.match-active[data-mobile-panel="towers"] .tower-panel .tower-rendered-icon img,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks .unit-premium-icon img,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks .unit-sheet-sprite {
  filter: drop-shadow(0 7px 8px rgba(0, 0, 0, 0.54)) !important;
  transform: scale(1.12) !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .tower-panel .choice-main,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks .choice-main {
  position: relative !important;
  z-index: 2 !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .tower-panel .choice-name,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks .choice-name {
  color: #fff8e8 !important;
  font-weight: 950 !important;
  letter-spacing: 0 !important;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.78) !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .tower-panel .choice-cost,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks .choice-cost {
  position: relative !important;
  z-index: 4 !important;
  border: 1px solid rgba(255, 210, 117, 0.58) !important;
  background: rgba(7, 8, 5, 0.88) !important;
  color: #ffd978 !important;
  font-weight: 950 !important;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.32), 0 0 12px rgba(242, 184, 75, 0.18) !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .mobile-shop-rarity,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .mobile-shop-rarity {
  display: none !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-landscape) .sidebar {
  height: min(42dvh, 380px) !important;
  max-height: min(42dvh, 380px) !important;
  grid-template-rows: 34px minmax(154px, 1.35fr) minmax(70px, 0.52fr) !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-landscape) .tower-list {
  grid-auto-columns: minmax(138px, 42vw) !important;
  gap: 7px !important;
  padding: 0 2px 4px 0 !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-landscape) .tower-panel .choice-button {
  grid-template-columns: 1fr !important;
  grid-template-rows: minmax(78px, 1fr) auto 23px !important;
  align-items: stretch !important;
  justify-items: stretch !important;
  gap: 0 !important;
  min-height: 146px !important;
  padding: 6px !important;
  text-align: center !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-landscape) .tower-panel .choice-icon {
  justify-self: stretch !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 76px !important;
  border-radius: 7px 7px 3px 3px !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-landscape) .tower-panel .choice-main {
  display: grid !important;
  gap: 3px !important;
  min-height: 50px !important;
  margin-top: -12px !important;
  padding: 14px 4px 4px !important;
  border-radius: 0 0 7px 7px !important;
  background: linear-gradient(180deg, transparent, rgba(1, 4, 4, 0.86) 18%, rgba(1, 4, 4, 0.96)) !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-landscape) .tower-panel .choice-name {
  display: -webkit-box !important;
  overflow: hidden !important;
  font-size: 0.62rem !important;
  line-height: 1.05 !important;
  text-align: center !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-landscape) .tower-stat-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 3px !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-landscape) .tower-stat-grid > .stat-pill {
  min-height: 17px !important;
  padding: 2px 3px !important;
  background: rgba(0, 0, 0, 0.34) !important;
  font-size: 0.48rem !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-landscape) .tower-meta-row,
body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-landscape) .tower-trait-list--compact {
  display: none !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-landscape) .tower-panel .choice-cost {
  align-self: center !important;
  justify-self: center !important;
  min-width: 42px !important;
  min-height: 20px !important;
  margin-top: 3px !important;
  padding: 2px 6px !important;
  font-size: 0.62rem !important;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"]:not(.mobile-landscape) .sidebar {
  height: 158px !important;
  max-height: 158px !important;
  grid-template-rows: 24px minmax(0, 1fr) !important;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"]:not(.mobile-landscape).mobile-sheet-expanded .sidebar {
  height: clamp(220px, 32dvh, 300px) !important;
  max-height: clamp(220px, 32dvh, 300px) !important;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"]:not(.mobile-landscape) .barracks {
  height: 122px !important;
  grid-auto-columns: calc((100% - 10px) / 3) !important;
  gap: 5px !important;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"]:not(.mobile-landscape) .barracks .choice-button.unit-shop-card {
  grid-template-columns: 1fr !important;
  grid-template-rows: minmax(58px, 1fr) auto 19px !important;
  align-items: stretch !important;
  justify-items: stretch !important;
  gap: 0 !important;
  height: 122px !important;
  padding: 5px !important;
  text-align: center !important;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"]:not(.mobile-landscape) .barracks .choice-button.unit-shop-card .choice-icon {
  justify-self: stretch !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 56px !important;
  border-radius: 7px 7px 3px 3px !important;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"]:not(.mobile-landscape) .barracks .choice-button.unit-shop-card .choice-main {
  display: grid !important;
  gap: 3px !important;
  margin-top: -10px !important;
  padding: 12px 3px 3px !important;
  border-radius: 0 0 7px 7px !important;
  background: linear-gradient(180deg, transparent, rgba(1, 4, 4, 0.86) 18%, rgba(1, 4, 4, 0.96)) !important;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"]:not(.mobile-landscape) .barracks .choice-button.unit-shop-card .choice-name {
  display: block !important;
  overflow: hidden !important;
  font-size: 0.54rem !important;
  line-height: 1 !important;
  text-align: center !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"]:not(.mobile-landscape) .unit-shop-primary {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 2px !important;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"]:not(.mobile-landscape) .unit-shop-pill {
  min-height: 15px !important;
  padding: 1px 2px !important;
  gap: 1px !important;
  background: rgba(0, 0, 0, 0.34) !important;
  font-size: 0.46rem !important;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"] .unit-shop-hp {
  background: linear-gradient(180deg, rgba(255, 116, 126, 0.18), rgba(36, 8, 12, 0.74)) !important;
  color: #ffadb4 !important;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"] .unit-shop-eco {
  background: linear-gradient(180deg, rgba(114, 225, 143, 0.17), rgba(7, 31, 15, 0.74)) !important;
  color: #dff4ba !important;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"] .unit-shop-decision-row {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-start !important;
  gap: 2px !important;
  max-height: 34px !important;
  overflow: hidden !important;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"] .unit-shop-decision-row .shop-decision-badge {
  min-height: 15px !important;
  padding: 1px 4px !important;
  font-size: 0.46rem !important;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"]:not(.mobile-landscape) .unit-shop-pill .selected-stat-icon,
body.mobile-ui.match-active[data-mobile-panel="monsters"]:not(.mobile-landscape) .unit-shop-pill .income-icon {
  width: 10px !important;
  height: 10px !important;
  min-width: 10px !important;
  padding: 1px !important;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"]:not(.mobile-landscape) .unit-shop-pill .heart-icon {
  width: 9px !important;
  height: 9px !important;
  min-width: 9px !important;
  margin-right: 2px !important;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"]:not(.mobile-landscape) .unit-shop-pill .heart-icon::before,
body.mobile-ui.match-active[data-mobile-panel="monsters"]:not(.mobile-landscape) .unit-shop-pill .heart-icon::after {
  width: 9px !important;
  height: 9px !important;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"]:not(.mobile-landscape) .unit-shop-pill .heart-icon::before {
  top: -4.5px !important;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"]:not(.mobile-landscape) .unit-shop-pill .heart-icon::after {
  left: 4.5px !important;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"]:not(.mobile-landscape) .unit-shop-pill .stat-icon {
  width: 8px !important;
  height: 8px !important;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"]:not(.mobile-landscape) .unit-shop-details,
body.mobile-ui.match-active[data-mobile-panel="monsters"]:not(.mobile-landscape) .unit-shop-resistances {
  display: none !important;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"]:not(.mobile-landscape) .unit-shop-card .choice-cost {
  align-self: center !important;
  justify-self: center !important;
  min-width: 38px !important;
  min-height: 17px !important;
  margin-top: 3px !important;
  padding: 1px 5px !important;
  font-size: 0.54rem !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .choice-button {
  border-radius: 8px !important;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--rarity-color, var(--gold)) 18%, transparent), transparent 50%),
    rgba(4, 8, 7, 0.94) !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .choice-icon {
  width: 42px !important;
  height: 42px !important;
  border-radius: 7px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .choice-button {
  grid-template-rows: 40px 13px 14px 13px !important;
  gap: 2px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .choice-icon {
  width: 40px !important;
  height: 40px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .choice-cost {
  min-width: 30px !important;
  min-height: 13px !important;
  padding: 1px 4px !important;
  font-size: 0.5rem !important;
  line-height: 1 !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .barracks {
  grid-auto-columns: clamp(196px, 30vw, 226px) !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .barracks .choice-button {
  grid-template-columns: 54px minmax(0, 1fr) 34px !important;
  grid-template-rows: 17px 18px 17px 20px !important;
  border-radius: 9px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .barracks .choice-icon {
  width: 52px !important;
  height: 52px !important;
  border-radius: 7px !important;
}

body.mobile-ui.match-active .unit-shop-card:disabled.is-too-expensive {
  border-color: rgba(255, 183, 77, 0.38) !important;
}

body.mobile-ui.match-active .unit-shop-card:disabled.is-too-expensive::before {
  z-index: 6 !important;
}

body.mobile-ui.match-active .unit-shop-card:disabled.is-too-expensive::after {
  z-index: 30 !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-landscape):not(.mobile-sheet-expanded) .tower-panel .choice-button {
  grid-template-columns: 52px minmax(0, 1fr) auto !important;
  grid-template-rows: 1fr !important;
  align-items: center !important;
  justify-items: stretch !important;
  gap: 7px !important;
  width: 100% !important;
  height: 64px !important;
  min-height: 64px !important;
  padding: 5px !important;
  text-align: left !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-landscape):not(.mobile-sheet-expanded) .tower-panel .choice-icon {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 52px !important;
  height: 52px !important;
  min-height: 52px !important;
  border-radius: 7px !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-landscape):not(.mobile-sheet-expanded) .tower-panel .choice-main {
  grid-column: 2 !important;
  grid-row: 1 !important;
  display: grid !important;
  align-content: center !important;
  gap: 3px !important;
  min-height: 0 !important;
  margin-top: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: none !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-landscape):not(.mobile-sheet-expanded) .tower-panel .choice-name {
  display: block !important;
  overflow: hidden !important;
  font-size: 0.62rem !important;
  line-height: 1.04 !important;
  text-align: left !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-landscape):not(.mobile-sheet-expanded) .tower-panel .tower-stat-grid {
  display: block !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-landscape):not(.mobile-sheet-expanded) .tower-panel .tower-stat-grid > .stat-pill {
  display: none !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-landscape):not(.mobile-sheet-expanded) .tower-panel .tower-stat-grid > .stat-pill:first-child {
  display: inline-flex !important;
  max-width: 100% !important;
  min-height: 17px !important;
  padding: 2px 5px !important;
  gap: 3px !important;
  font-size: 0.5rem !important;
  vertical-align: top !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-landscape):not(.mobile-sheet-expanded) .tower-panel .choice-cost {
  grid-column: 3 !important;
  grid-row: 1 !important;
  align-self: center !important;
  justify-self: end !important;
  min-width: 38px !important;
  min-height: 20px !important;
  margin-top: 0 !important;
  padding: 2px 6px !important;
  font-size: 0.6rem !important;
}

/* Keep the same arena backdrop visible behind the mobile HUD and bottom shop. */
body.mobile-ui.match-active {
  background:
    linear-gradient(180deg, rgba(5, 8, 6, 0.12), rgba(5, 8, 6, 0.64)),
    url("assets/arena-sky-islands-calm-bg.jpg?v=20260519-cache-fix1") center center / cover no-repeat,
    #050908;
  background-attachment: fixed;
}

body.mobile-ui.match-active .game-area,
body.mobile-ui.match-active .canvas-wrap {
  background-color: transparent;
}

body.mobile-ui.match-active .mobile-top-bar,
body.mobile-ui.match-active .mobile-bottom-nav,
body.mobile-ui.match-active .sidebar {
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.055), transparent 58%),
    rgba(5, 9, 7, 0.42);
  backdrop-filter: blur(3px) saturate(1.05);
}

body.mobile-ui.match-active .mobile-bottom-nav {
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.24);
}

/* Gameplay mobile is tuned for landscape. Portrait keeps the UI usable, but
   shows a lightweight rotation cue so accidental orientation changes do not
   look like the intended layout. */
body.mobile-ui.match-active.mobile-portrait::before {
  content: "Tourne ton téléphone";
  position: fixed;
  top: calc(var(--mobile-hud-height) + env(safe-area-inset-top) + 10px);
  left: 50%;
  z-index: 1800;
  transform: translateX(-50%);
  max-width: calc(100vw - 28px);
  padding: 8px 12px;
  border: 1px solid rgba(98, 234, 208, 0.52);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(98, 234, 208, 0.14), transparent),
    rgba(5, 10, 8, 0.9);
  color: #cffff7;
  font-size: 0.76rem;
  font-weight: 950;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}

body.mobile-ui.match-active.mobile-landscape {
  --mobile-hud-height: 52px;
  --mobile-action-rail-width: 60px;
  --mobile-sheet-height: clamp(96px, 27dvh, 112px);
}

body.mobile-ui.match-active.mobile-landscape .mobile-top-bar {
  min-height: var(--mobile-hud-height);
}

body.mobile-ui.match-active.mobile-landscape .mobile-bottom-nav {
  width: calc(var(--mobile-action-rail-width) + env(safe-area-inset-right));
  gap: 6px;
}

body.mobile-ui.match-active.mobile-landscape .mobile-bottom-nav .mobile-action-button {
  min-height: 46px;
}

body.mobile-ui.match-active.mobile-landscape .sidebar {
  right: calc(var(--mobile-action-rail-width) + env(safe-area-inset-right) + 8px) !important;
  height: var(--mobile-sheet-height) !important;
  max-height: var(--mobile-sheet-height) !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .sidebar,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .sidebar {
  height: var(--mobile-sheet-height) !important;
  max-height: var(--mobile-sheet-height) !important;
}

body.mobile-ui.match-active.mobile-landscape.mobile-sheet-expanded .sidebar,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"].mobile-sheet-expanded .sidebar,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"].mobile-sheet-expanded .sidebar {
  height: clamp(190px, 52dvh, 270px) !important;
  max-height: clamp(190px, 52dvh, 270px) !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .choice-button {
  grid-template-rows: 30px 12px 13px 14px !important;
  padding: 3px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .choice-icon {
  width: 30px !important;
  height: 30px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .tower-panel .shop-decision-row--plan {
  display: none !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-slot {
  grid-template-rows: 26px 14px !important;
  padding: 3px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-slot .choice-icon {
  width: 26px !important;
  height: 26px !important;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks .choice-button.unit-shop-card:disabled.is-too-expensive .choice-cost,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .barracks .choice-button.unit-shop-card:disabled.is-too-expensive .choice-cost {
  position: absolute !important;
  inset: 5px 5px auto auto !important;
  grid-column: auto !important;
  grid-row: auto !important;
  align-self: auto !important;
  justify-self: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 42px !important;
  min-height: 22px !important;
  padding: 3px 6px !important;
  font-size: 0.66rem !important;
  font-weight: 950 !important;
  line-height: 1 !important;
}

body.mobile-ui.match-active .mobile-hud-stats {
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 0.9fr) minmax(0, 1.28fr);
}

body.mobile-ui.match-active.mobile-landscape .mobile-hud-stats {
  grid-template-columns:
    minmax(0, 0.72fr)
    minmax(0, 0.82fr)
    minmax(0, 1.46fr)
    minmax(0, 0.62fr)
    minmax(0, 0.86fr)
    minmax(0, 0.92fr);
}

body.mobile-ui.match-active .mobile-stat--income {
  border-color: rgba(223, 244, 186, 0.22);
  background: rgba(14, 26, 11, 0.68);
}

body.mobile-ui.match-active .mobile-stat--income strong {
  font-size: clamp(0.66rem, 2.45vw, 0.82rem);
  font-variant-numeric: tabular-nums;
  text-overflow: clip;
}

/* Mobile clean pass: launcher shortcuts, portrait interstitial, and denser landscape play. */
.mobile-quick-play {
  display: none;
}

@media (max-width: 980px) and (hover: none), (max-width: 760px) {
  body.is-authenticated:not(.match-active) .launcher-nav {
    gap: 8px;
    padding: 10px 12px;
  }

  body.is-authenticated:not(.match-active) .launcher-mark {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 8px;
  }

  body.is-authenticated:not(.match-active) .launcher-mark-icon {
    width: 38px;
    height: 38px;
  }

  body.is-authenticated:not(.match-active) .mobile-quick-play {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 0.82fr));
    gap: 6px;
    order: 2;
  }

  body.is-authenticated:not(.match-active) .mobile-quick-play .primary-button,
  body.is-authenticated:not(.match-active) .mobile-quick-play .mode-button {
    min-height: 40px;
    padding: 7px 8px;
    border-radius: 8px;
    font-size: 0.72rem;
    line-height: 1.05;
    white-space: nowrap;
  }

  body.is-authenticated:not(.match-active) .profile-card {
    order: 3;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    min-height: 0;
    padding: 8px;
  }

  body.is-authenticated:not(.match-active) .profile-avatar {
    width: 40px;
    height: 40px;
    font-size: 0.85rem;
  }

  body.is-authenticated:not(.match-active) .profile-status {
    min-width: 74px;
    padding: 5px 6px;
  }

  body.is-authenticated:not(.match-active) .profile-live-stats {
    display: none;
  }

  body.is-authenticated:not(.match-active) .launcher-tabs {
    order: 4;
    display: flex;
    grid-template-columns: none;
    gap: 6px;
    margin-inline: -2px;
    padding: 2px 2px 7px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  body.is-authenticated:not(.match-active) .launcher-tabs::-webkit-scrollbar {
    display: none;
  }

  body.is-authenticated:not(.match-active) .launcher-tabs .tab-button {
    flex: 0 0 auto;
    min-width: 92px;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 999px;
    border-left: 1px solid rgba(215, 169, 74, 0.22);
    font-size: 0.64rem;
    scroll-snap-align: start;
  }

  body.is-authenticated:not(.match-active) .launcher-audio {
    order: 5;
    display: grid;
    grid-template-columns: minmax(62px, 0.72fr) minmax(0, 1.5fr);
    align-items: center;
    gap: 6px;
    padding-top: 0;
  }

  body.is-authenticated:not(.match-active) .launcher-audio .setting-row {
    min-height: 32px;
    margin: 0;
    padding: 6px 8px;
  }

  body.is-authenticated:not(.match-active) .launcher-audio .mode-button {
    min-height: 32px;
    padding: 6px 8px;
    font-size: 0.62rem;
  }

  body.is-authenticated:not(.match-active) .launcher-audio #saveSettingsButton,
  body.is-authenticated:not(.match-active) .launcher-audio #logoutButton {
    display: none;
  }

  body.is-authenticated:not(.match-active) .launcher-page-header {
    min-height: 0;
    padding: 10px 12px;
  }

  body.is-authenticated:not(.match-active) .launcher-brand-title {
    font-size: clamp(1.34rem, 7vw, 1.9rem);
  }

  body.is-authenticated:not(.match-active) .launcher-page-subtitle {
    margin-top: 2px;
  }

  body.is-authenticated:not(.match-active) .launcher-hero-tags {
    gap: 5px;
    margin-top: 6px;
  }

  body.is-authenticated:not(.match-active) .launcher-hero-tags span {
    padding: 4px 7px;
    font-size: 0.54rem;
  }

  body.is-authenticated:not(.match-active) .launcher-content {
    padding: 10px 12px 14px;
  }
}

body.mobile-ui.match-active.mobile-portrait .canvas-wrap,
body.mobile-ui.match-active.mobile-portrait .board-visibility-toggle {
  filter: blur(2px) saturate(0.72);
  opacity: 0.2;
  pointer-events: none !important;
}

body.mobile-ui.match-active.mobile-portrait .sidebar,
body.mobile-ui.match-active.mobile-portrait .mobile-bottom-nav,
body.mobile-ui.match-active.mobile-portrait .mobile-placement-toolbar {
  filter: blur(2px) saturate(0.72);
  opacity: 0.2;
}

body.mobile-ui.match-active.mobile-portrait .mobile-top-bar {
  z-index: 1802;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.mobile-ui.match-active.mobile-portrait .mobile-top-bar > :not(.mobile-menu-button) {
  opacity: 0;
  pointer-events: none;
}

body.mobile-ui.match-active.mobile-portrait .mobile-menu-button {
  justify-self: end;
  border-color: rgba(98, 234, 208, 0.45);
  background: rgba(5, 12, 10, 0.86);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

body.mobile-ui.match-active.mobile-portrait .topbar,
body.mobile-ui.match-active.mobile-portrait .game-menu {
  z-index: 1900;
}

body.mobile-ui.match-active.mobile-portrait::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1700;
  display: block;
  background:
    radial-gradient(circle at 50% 35%, rgba(98, 234, 208, 0.18), transparent 34%),
    rgba(1, 5, 4, 0.76);
  backdrop-filter: blur(6px) saturate(0.92);
  pointer-events: none;
}

body.mobile-ui.match-active.mobile-portrait::before {
  content: "Tourne ton telephone\A\ALe jeu mobile est optimise en paysage.";
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1801;
  transform: translate(-50%, -50%);
  width: min(318px, calc(100vw - 42px));
  max-width: calc(100vw - 42px);
  padding: 20px 18px;
  border: 1px solid rgba(98, 234, 208, 0.52);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.08), transparent 62%),
    rgba(5, 10, 8, 0.94);
  color: #cffff7;
  font-size: 0.9rem;
  font-weight: 950;
  line-height: 1.35;
  text-align: center;
  white-space: pre-line;
  pointer-events: none;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.48);
}

body.mobile-ui.match-active.mobile-landscape {
  --mobile-action-rail-width: 56px;
  --mobile-sheet-height: clamp(88px, 24dvh, 104px);
}

body.mobile-ui.match-active.mobile-landscape .game-area {
  padding-right: calc(var(--mobile-action-rail-width) + env(safe-area-inset-right) + 28px);
  padding-bottom: calc(env(safe-area-inset-bottom) + 7px);
}

body.mobile-ui.match-active.mobile-landscape .mobile-bottom-nav {
  width: calc(var(--mobile-action-rail-width) + env(safe-area-inset-right));
  gap: 5px;
  padding: 7px calc(env(safe-area-inset-right) + 6px) calc(env(safe-area-inset-bottom) + 7px) 6px;
}

body.mobile-ui.match-active.mobile-landscape .mobile-bottom-nav .mobile-action-button {
  min-height: 44px;
  padding: 0 2px;
}

body.mobile-ui.match-active.mobile-landscape .mobile-bottom-nav .mobile-action-button::before {
  font-size: 0.58rem;
  letter-spacing: 0;
}

body.mobile-ui.match-active.mobile-landscape .mobile-bottom-nav [data-mobile-panel="towers"]::before { content: "Tours"; }
body.mobile-ui.match-active.mobile-landscape .mobile-bottom-nav [data-mobile-panel="monsters"]::before { content: "Monstres"; }
body.mobile-ui.match-active.mobile-landscape .mobile-bottom-nav [data-mobile-panel="upgrades"]::before { content: "Evos"; }
body.mobile-ui.match-active.mobile-landscape .mobile-bottom-nav [data-mobile-panel="augments"]::before { content: "Augments"; }
body.mobile-ui.match-active.mobile-landscape .mobile-bottom-nav [data-mobile-panel="players"]::before { content: "Joueurs"; }

body.mobile-ui.match-active.mobile-landscape .mobile-top-bar {
  grid-template-columns: minmax(116px, 0.62fr) minmax(0, 2.12fr) 54px;
  gap: 5px;
  padding: 4px;
}

body.mobile-ui.match-active.mobile-landscape .mobile-player-chip {
  grid-template-columns: 70px minmax(0, 1fr);
}

body.mobile-ui.match-active.mobile-landscape .mobile-status-buttons .mobile-player-book-button,
body.mobile-ui.match-active.mobile-landscape .mobile-status-buttons .mobile-player-traits-button {
  min-height: 42px;
}

body.mobile-ui.match-active.mobile-landscape .mobile-stat {
  min-height: 42px;
}

body.mobile-ui.match-active.mobile-landscape .mobile-menu-button {
  min-width: 54px;
  min-height: 44px;
}

body.mobile-ui.match-active.mobile-landscape .board-visibility-toggle {
  top: calc(env(safe-area-inset-top) + var(--mobile-hud-height) + 8px);
  right: calc(var(--mobile-action-rail-width) + env(safe-area-inset-right) + 32px);
  width: 36px;
  height: 36px;
}

body.mobile-ui.match-active.mobile-landscape .sidebar {
  right: calc(var(--mobile-action-rail-width) + env(safe-area-inset-right) + 28px) !important;
  min-height: 0;
  border-radius: 10px;
}

body.mobile-ui.match-active.mobile-landscape .mobile-bottom-sheet-header {
  position: relative;
  padding-top: 6px;
}

body.mobile-ui.match-active.mobile-landscape .mobile-bottom-sheet-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 42px;
  height: 3px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(207, 255, 247, 0.34);
}

body.mobile-ui.match-active.mobile-landscape.mobile-sheet-expanded .sidebar,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"].mobile-sheet-expanded .sidebar,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"].mobile-sheet-expanded .sidebar {
  height: clamp(184px, 50dvh, 258px) !important;
  max-height: clamp(184px, 50dvh, 258px) !important;
}

body.mobile-ui.match-active.mobile-landscape.selected-tower-panel-floating #selectedTowerPanel:not([hidden]) {
  top: calc(env(safe-area-inset-top) + var(--mobile-hud-height) + 12px) !important;
  bottom: auto !important;
  left: calc(env(safe-area-inset-left) + 10px) !important;
  width: min(340px, calc(100vw - var(--mobile-action-rail-width) - env(safe-area-inset-left) - env(safe-area-inset-right) - 120px)) !important;
  max-height: min(42dvh, 158px) !important;
  z-index: 64 !important;
}

body.mobile-ui.match-active.mobile-landscape.selected-tower-panel-floating.mobile-sheet-open #selectedTowerPanel:not([hidden]) {
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
}

body.mobile-ui.match-active.mobile-landscape.selected-tower-panel-floating #selectedTowerPanel[data-kind="creep"]:not([hidden]) {
  max-height: min(50dvh, 188px) !important;
}

body.mobile-ui.match-active.mobile-landscape.game-menu-open .canvas-wrap,
body.mobile-ui.match-active.mobile-landscape.game-menu-open .sidebar,
body.mobile-ui.match-active.mobile-landscape.game-menu-open .mobile-bottom-nav,
body.mobile-ui.match-active.mobile-landscape.game-menu-open .mobile-placement-toolbar,
body.mobile-ui.match-active.mobile-landscape.game-menu-open #selectedTowerPanel:not([hidden]) {
  filter: blur(1.5px) saturate(0.72);
  opacity: 0.24;
  pointer-events: none !important;
}

body.mobile-ui.match-active.mobile-landscape.game-menu-open .mobile-top-bar {
  z-index: 180;
}

body.mobile-ui.match-active.mobile-landscape.game-menu-open .game-menu {
  z-index: 190;
  border-color: rgba(98, 234, 208, 0.52);
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.08), transparent 58%),
    rgba(5, 10, 8, 0.96);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.52);
}

body.mobile-ui.match-active.mobile-landscape.augment-choice-active .mobile-top-bar,
body.mobile-ui.match-active.mobile-landscape.augment-choice-active .mobile-bottom-nav,
body.mobile-ui.match-active.mobile-landscape.augment-choice-active .sidebar,
body.mobile-ui.match-active.mobile-landscape.augment-choice-active .board-visibility-toggle {
  filter: blur(1.5px) saturate(0.72);
  opacity: 0.18;
  pointer-events: none !important;
}

body.mobile-ui.match-active.mobile-landscape.augment-choice-active .augment-overlay {
  z-index: 1700;
  background: rgba(1, 5, 4, 0.58);
  backdrop-filter: blur(5px) saturate(0.94);
}

body.mobile-ui.match-active.mobile-landscape.tutorial-active[data-tutorial-coach="augment"].augment-choice-active .augment-overlay {
  z-index: 1700;
}

body.mobile-ui.match-active.mobile-landscape.tutorial-active[data-tutorial-coach="augment"].augment-choice-active .tutorial-coach {
  z-index: 1810;
  pointer-events: none;
}

/* iPhone landscape edge polish: the action rail and shop sheet must feel anchored. */
body.mobile-ui.match-active.mobile-landscape {
  --mobile-browser-top-gap: 12px;
  --mobile-hud-height: 56px;
  --mobile-action-rail-width: 62px;
  --mobile-sheet-height: clamp(158px, 42dvh, 188px);
}

body.mobile-ui.match-active.mobile-landscape .game-area {
  padding:
    calc(env(safe-area-inset-top) + var(--mobile-browser-top-gap))
    calc(var(--mobile-action-rail-width) + env(safe-area-inset-right))
    0
    env(safe-area-inset-left) !important;
  gap: 5px;
}

body.mobile-ui.match-active.mobile-landscape .mobile-bottom-nav {
  top: calc(env(safe-area-inset-top) + var(--mobile-browser-top-gap) + var(--mobile-hud-height) + 5px) !important;
  right: 0 !important;
  bottom: 0 !important;
  left: auto !important;
  transform: none !important;
  width: calc(var(--mobile-action-rail-width) + env(safe-area-inset-right)) !important;
  min-height: 0 !important;
  height: auto !important;
  padding:
    7px
    calc(env(safe-area-inset-right) + 6px)
    calc(env(safe-area-inset-bottom) + 7px)
    6px !important;
  border-top: 0 !important;
  border-right: 0 !important;
  border-radius: 12px 0 0 0 !important;
}

body.mobile-ui.match-active.mobile-landscape .sidebar {
  right: calc(var(--mobile-action-rail-width) + env(safe-area-inset-right)) !important;
  bottom: 0 !important;
  left: env(safe-area-inset-left) !important;
  height: var(--mobile-sheet-height) !important;
  max-height: var(--mobile-sheet-height) !important;
  border-bottom: 0 !important;
  border-left: 0 !important;
  border-radius: 12px 12px 0 0 !important;
}

body.mobile-ui.match-active.mobile-landscape.mobile-sheet-expanded .sidebar,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"].mobile-sheet-expanded .sidebar,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"].mobile-sheet-expanded .sidebar {
  height: clamp(228px, 60dvh, 304px) !important;
  max-height: clamp(228px, 60dvh, 304px) !important;
}

body.mobile-ui.match-active.mobile-landscape .board-visibility-toggle {
  right: calc(var(--mobile-action-rail-width) + env(safe-area-inset-right) + 10px) !important;
}

body.mobile-ui.match-active.mobile-landscape .mobile-placement-toolbar {
  right: calc(var(--mobile-action-rail-width) + env(safe-area-inset-right) + 10px) !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .sidebar {
  grid-template-columns: minmax(0, 1fr) minmax(188px, 0.3fr) !important;
  gap: 7px !important;
  padding: 7px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel {
  padding: 5px 5px 5px 42px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-panel {
  min-width: 0 !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-list {
  grid-auto-columns: minmax(126px, 1fr) !important;
  gap: 6px !important;
  padding: 0 !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .choice-button {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(58px, 1fr) auto auto !important;
  gap: 0 !important;
  min-width: 126px !important;
  padding: 5px !important;
  text-align: center !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .choice-icon {
  grid-row: 1 !important;
  align-self: stretch !important;
  justify-self: stretch !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 56px !important;
  border-radius: 7px 7px 3px 3px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .choice-main {
  position: relative !important;
  z-index: 4 !important;
  display: grid !important;
  grid-template-rows: auto auto !important;
  gap: 3px !important;
  min-height: 48px !important;
  margin-top: -12px !important;
  padding: 14px 4px 4px !important;
  border-radius: 0 0 7px 7px !important;
  background: linear-gradient(180deg, transparent, rgba(1, 4, 4, 0.86) 18%, rgba(1, 4, 4, 0.96)) !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .choice-name {
  grid-row: auto !important;
  display: -webkit-box !important;
  width: 100% !important;
  overflow: hidden !important;
  font-size: 0.62rem !important;
  line-height: 1.05 !important;
  text-align: center !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .tower-shop-floating-badges {
  position: absolute !important;
  top: -52px !important;
  right: 5px !important;
  left: 5px !important;
  z-index: 8 !important;
  display: block !important;
  pointer-events: none !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .tower-shop-floating-badge {
  position: absolute !important;
  top: 0 !important;
  display: inline-flex !important;
  max-width: 62px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .tower-shop-floating-badge--element {
  left: 0 !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .tower-shop-floating-badge--target {
  right: 0 !important;
  left: auto !important;
  top: 9px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .tower-shop-floating-badge .shop-decision-badge {
  min-height: 19px !important;
  padding: 2px 5px !important;
  gap: 3px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 64%),
    rgba(1, 7, 7, 0.82) !important;
  font-size: 0.5rem !important;
  box-shadow: 0 5px 13px rgba(0, 0, 0, 0.38) !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .tower-shop-floating-badge--element .shop-decision-icon {
  width: 14px !important;
  height: 14px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .tower-shop-floating-badge--element .shop-decision-badge--element-icon {
  padding: 0 !important;
  border-color: transparent !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .tower-stat-grid {
  display: none !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .tower-trait-list--compact {
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  gap: 3px !important;
  min-height: 17px !important;
  overflow: hidden !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .shop-decision-row--combat {
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  gap: 3px !important;
  min-height: 17px !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .tower-trait-chip--compact {
  max-width: 54px !important;
  min-height: 16px !important;
  padding: 2px 4px !important;
  font-size: 0.48rem !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .shop-decision-row--combat .shop-decision-badge {
  max-width: 58px !important;
  min-height: 16px !important;
  padding: 2px 4px !important;
  font-size: 0.47rem !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .tower-panel .choice-cost {
  grid-row: 3 !important;
  justify-self: center !important;
  min-width: 38px !important;
  min-height: 18px !important;
  margin-top: 3px !important;
  padding: 2px 6px !important;
  font-size: 0.6rem !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-list {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .sidebar {
  height: clamp(148px, 37dvh, 174px) !important;
  max-height: clamp(148px, 37dvh, 174px) !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .barracks-panel {
  padding-left: 42px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .barracks {
  grid-auto-columns: minmax(174px, calc((100% - 14px) / 3)) !important;
  gap: 7px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .barracks .choice-button.unit-shop-card {
  grid-template-columns: 40px minmax(0, 1fr) 36px !important;
  grid-template-rows: 18px 18px minmax(18px, 1fr) !important;
  gap: 4px 6px !important;
  padding: 6px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .unit-shop-primary,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .unit-shop-details {
  min-width: 0 !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .unit-shop-card .choice-cost,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .unit-shop-card:disabled.is-too-expensive .choice-cost {
  position: static !important;
  inset: auto !important;
  grid-column: 3 !important;
  grid-row: 1 / 4 !important;
  align-self: center !important;
  justify-self: center !important;
  min-width: 32px !important;
  min-height: 20px !important;
  padding: 2px 5px !important;
  transform: none !important;
  font-size: 0.58rem !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .unit-shop-card:disabled.is-too-expensive::before {
  z-index: 1 !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="monsters"] .unit-shop-card:disabled.is-too-expensive .choice-cost {
  z-index: 8 !important;
}

/* End screens keep their own scroll on iOS, even after the game area is hidden. */
body.mobile-ui.end-screen-open {
  height: 100dvh;
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.mobile-ui.end-screen-open .shell {
  overflow: hidden !important;
}

body.mobile-ui.end-screen-open #endOverlay,
body.mobile-ui.end-screen-open #surrenderOverlay {
  z-index: 2200;
  display: grid;
  place-items: stretch;
  padding:
    calc(env(safe-area-inset-top) + 10px)
    calc(env(safe-area-inset-right) + 10px)
    calc(env(safe-area-inset-bottom) + 10px)
    calc(env(safe-area-inset-left) + 10px) !important;
  overflow: hidden !important;
  touch-action: none;
}

body.mobile-ui.end-screen-open #endOverlay[hidden],
body.mobile-ui.end-screen-open #surrenderOverlay[hidden] {
  display: none !important;
}

body.mobile-ui.end-screen-open #endOverlay .end-modal,
body.mobile-ui.end-screen-open #surrenderOverlay .end-modal {
  align-self: stretch;
  justify-self: center;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  width: min(620px, 100%) !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.mobile-ui.end-screen-open #endOverlay .end-recap {
  min-height: 0;
  overflow: auto !important;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

body.mobile-ui.end-screen-open #endOverlay .end-actions,
body.mobile-ui.end-screen-open #surrenderOverlay .end-actions {
  position: sticky;
  bottom: 0;
}

/* Compact responsive pass: keep XP resources and the full bench reachable at once. */
body.mobile-ui.match-active[data-mobile-panel="upgrades"] .sidebar {
  grid-template-rows: 28px minmax(0, 0.9fr) auto;
  max-height: min(360px, 52dvh);
}

body.mobile-ui.match-active[data-mobile-panel="upgrades"] .stats-panel {
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: auto;
  overscroll-behavior: contain;
}

body.mobile-ui.match-active[data-mobile-panel="upgrades"] .resource-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

body.mobile-ui.match-active[data-mobile-panel="upgrades"] .stat-row {
  min-height: 28px;
  padding: 5px 7px;
}

body.mobile-ui.match-active[data-mobile-panel="upgrades"] .stat-row--bar {
  grid-column: 1 / -1;
}

body.mobile-ui.match-active[data-mobile-panel="upgrades"] #buyXpButton {
  flex-shrink: 0;
  min-height: 34px;
  margin-top: 0;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="upgrades"] .sidebar {
  height: min(72dvh, 330px) !important;
  max-height: min(72dvh, 330px) !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="upgrades"] .selected-panel,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="upgrades"] .stats-panel {
  overflow: auto !important;
  overscroll-behavior: contain;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .sidebar {
  height: clamp(144px, 38dvh, 172px) !important;
  max-height: clamp(144px, 38dvh, 172px) !important;
  grid-template-columns: minmax(0, 1fr) minmax(248px, 0.42fr) !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-panel {
  overflow: hidden !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-list {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-flow: row !important;
  grid-auto-columns: auto !important;
  grid-auto-rows: minmax(0, 1fr) !important;
  align-content: stretch !important;
  gap: 4px !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  scroll-snap-type: none !important;
  scrollbar-width: none !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-slot {
  position: relative !important;
  display: block !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
  overflow: hidden !important;
  text-align: left !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-slot.empty {
  display: grid !important;
  place-items: center !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-slot .choice-icon {
  position: absolute !important;
  inset: 11px 4px 12px !important;
  width: auto !important;
  height: auto !important;
  border: 0 !important;
  border-radius: 6px !important;
  opacity: 0.92 !important;
  transform: scale(1.08) !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-main {
  position: absolute !important;
  inset: 3px !important;
  z-index: 2 !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  gap: 0 !important;
  min-width: 0 !important;
  width: 100% !important;
  height: calc(100% - 6px) !important;
  pointer-events: none !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-title {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  justify-content: space-between !important;
  gap: 2px !important;
  min-width: 0 !important;
  font-size: 0.5rem !important;
  line-height: 1 !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-title span {
  min-width: 0 !important;
  max-width: 100% !important;
  padding: 1px 3px !important;
  border-radius: 4px !important;
  background: rgba(2, 7, 6, 0.68) !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-title strong {
  display: block !important;
  flex: 0 0 auto !important;
  padding: 1px 3px !important;
  border-radius: 999px !important;
  background: rgba(2, 7, 6, 0.72) !important;
  color: #ffe1a4 !important;
  font-size: 0.48rem !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-tags {
  display: flex !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  gap: 2px !important;
  min-height: 12px !important;
  overflow: hidden !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-target-badge,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-element-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid rgba(255, 240, 190, 0.16) !important;
  background: rgba(2, 7, 6, 0.72) !important;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.34) !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-target-badge {
  max-width: calc(100% - 20px) !important;
  min-height: 12px !important;
  padding: 1px 3px !important;
  border-radius: 999px !important;
  color: #d9f2ff !important;
  font-size: 0.38rem !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-element-badge {
  flex: 0 0 auto !important;
  width: 16px !important;
  height: 16px !important;
  margin-left: auto !important;
  border-color: color-mix(in srgb, var(--shop-tag-color, #78efff) 62%, rgba(255, 248, 232, 0.2)) !important;
  border-radius: 999px !important;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.34), transparent 34%),
    color-mix(in srgb, var(--shop-tag-color, #78efff) 22%, rgba(3, 10, 12, 0.92)) !important;
  box-shadow: 0 0 10px color-mix(in srgb, var(--shop-tag-color, #78efff) 36%, transparent) !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-element-icon {
  display: block !important;
  width: 11px !important;
  height: 11px !important;
  object-fit: contain !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-element-badge--ice {
  border-color: rgba(215, 250, 255, 0.92) !important;
  background:
    radial-gradient(circle at 42% 28%, rgba(255, 255, 255, 0.56), transparent 36%),
    linear-gradient(180deg, rgba(174, 232, 255, 0.34), rgba(33, 99, 190, 0.28)),
    rgba(4, 17, 28, 0.94) !important;
  box-shadow: 0 0 12px rgba(174, 232, 255, 0.56), inset 0 0 7px rgba(255, 255, 255, 0.18) !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-element-icon--ice {
  filter: brightness(1.28) contrast(1.12) drop-shadow(0 0 3px rgba(225, 252, 255, 0.86)) !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-empty {
  display: block !important;
  align-self: center !important;
  justify-self: center !important;
  color: rgba(255, 248, 232, 0.34) !important;
  font-size: 0.56rem !important;
}

body.mobile-ui.match-active .bench-slot .bench-tags--element-only {
  position: absolute !important;
  top: 5px !important;
  right: 5px !important;
  z-index: 3 !important;
  display: inline-grid !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  pointer-events: none !important;
}

body.mobile-ui.match-active .bench-slot .bench-element-badge {
  display: inline-grid !important;
  width: 18px !important;
  height: 18px !important;
  place-items: center !important;
}

body.mobile-ui.match-active .bench-slot .bench-element-icon {
  width: 12px !important;
  height: 12px !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-slot .bench-main {
  width: auto !important;
}

body.mobile-ui.match-active .bench-slot .bench-title span,
body.mobile-ui.match-active .bench-slot .bench-title strong {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.96), 0 0 4px rgba(0, 0, 0, 0.84) !important;
}

body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-slot .bench-title span,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"] .bench-slot .bench-title strong {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.96), 0 0 4px rgba(0, 0, 0, 0.84) !important;
}

body.mobile-ui.match-active .bench-slot .bench-tags--corner-meta {
  position: static !important;
  z-index: 3 !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  gap: 3px !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 17px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  pointer-events: none !important;
}

body.mobile-ui.match-active .bench-slot .bench-tags--corner-meta .bench-target-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  max-width: calc(100% - 22px) !important;
  min-height: 14px !important;
  padding: 1px 4px !important;
  border: 1px solid rgba(214, 242, 255, 0.2) !important;
  border-radius: 999px !important;
  background: rgba(2, 7, 6, 0.76) !important;
  color: #d9f2ff !important;
  font-size: 0 !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  text-transform: none !important;
}

body.mobile-ui.match-active .bench-slot .bench-tags--corner-meta .bench-target-badge::before {
  color: inherit !important;
  font-size: 0.38rem !important;
  line-height: 1 !important;
  text-transform: none !important;
}

body.mobile-ui.match-active .bench-slot .bench-tags--corner-meta .bench-target-badge--ground::before {
  content: "Sol";
}

body.mobile-ui.match-active .bench-slot .bench-tags--corner-meta .bench-target-badge--air::before {
  content: "Air";
}

body.mobile-ui.match-active .bench-slot .bench-tags--corner-meta .bench-target-badge--both::before {
  content: "Sol/Air";
}

body.mobile-ui.match-active .bench-slot .bench-tags--corner-meta .bench-element-badge {
  display: inline-grid !important;
  width: 18px !important;
  height: 18px !important;
  margin-left: auto !important;
  place-items: center !important;
  border-color: rgba(218, 246, 238, 0.54) !important;
  background: rgba(4, 11, 11, 0.86) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.52) !important;
}

body.mobile-ui.match-active .bench-slot .bench-tags--corner-meta .bench-element-icon {
  display: block !important;
  width: 14px !important;
  height: 14px !important;
  object-fit: contain !important;
  opacity: 1 !important;
  filter: none !important;
}

body.mobile-ui.match-active .bench-slot .bench-tags--corner-meta .bench-element-icon--fallback svg {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  stroke-width: 2.2 !important;
}

body.mobile-ui.match-active .bench-slot .bench-tags--corner-meta .bench-element-badge--ice {
  border-color: rgba(183, 238, 255, 0.76) !important;
  background: rgba(6, 22, 34, 0.88) !important;
}

body.mobile-ui.match-active .bench-slot .bench-tags--corner-meta .bench-element-badge--wind {
  border-color: rgba(150, 255, 234, 0.76) !important;
  background: rgba(5, 24, 22, 0.88) !important;
}

body.mobile-ui.match-active .bench-slot .bench-tags--corner-meta .bench-element-icon--ice,
body.mobile-ui.match-active .bench-slot .bench-tags--corner-meta .bench-element-icon--wind {
  filter: none !important;
}

body.mobile-ui.match-active .mobile-top-actions {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin-left: auto !important;
}

body.mobile-ui.match-active .mobile-arena-mode-button {
  min-width: 58px !important;
  min-height: var(--mobile-touch-size) !important;
  padding: 0 8px !important;
  border: 1px solid rgba(159, 247, 255, 0.32) !important;
  border-radius: 7px !important;
  background: rgba(6, 13, 12, 0.9) !important;
  color: #f6fff7 !important;
  font-size: 0.67rem !important;
  font-weight: 950 !important;
  letter-spacing: 0 !important;
  text-transform: uppercase !important;
}

body.mobile-ui.match-active.arena-focus-mode .mobile-arena-mode-button {
  border-color: rgba(159, 247, 255, 0.82) !important;
  background: linear-gradient(135deg, rgba(17, 92, 103, 0.95), rgba(96, 68, 26, 0.92)) !important;
}

body.mobile-ui.match-active.arena-focus-mode .arena-return-button {
  top: calc(env(safe-area-inset-top) + var(--mobile-hud-height) + 10px) !important;
  left: 10px !important;
  min-height: 38px !important;
  max-width: min(42vw, 176px) !important;
  padding: 0 10px !important;
  font-size: 0.68rem !important;
  white-space: nowrap !important;
}

body.mobile-ui.match-active.arena-focus-mode .mobile-player-row.is-observed {
  border-color: rgba(159, 247, 255, 0.62) !important;
  background: rgba(8, 28, 28, 0.82) !important;
}
