/* 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 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: 120;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(172px, 0.34fr);
  grid-template-rows: auto auto;
  gap: 4px 10px;
  width: auto !important;
  max-height: 96px !important;
  padding: 8px 10px !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: 96px !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: none !important;
}

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: 132;
  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.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;
}

/* 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:
    linear-gradient(180deg, rgba(255, 183, 77, 0.06), rgba(0, 0, 0, 0.2) 58%),
    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:
    linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.26)),
    repeating-linear-gradient(-45deg, rgba(255, 240, 190, 0.05) 0 5px, transparent 5px 11px) !important;
  pointer-events: none !important;
}

body.mobile-ui.match-active .unit-shop-card:disabled.is-too-expensive::after {
  content: attr(data-cost) !important;
  position: absolute !important;
  top: 5px !important;
  right: 5px !important;
  inset: 5px 5px auto auto !important;
  z-index: 30 !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;
  border: 2px solid rgba(255, 202, 103, 0.92) !important;
  border-radius: 999px !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;
  opacity: 1 !important;
  pointer-events: 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 {
  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 {
  opacity: 0 !important;
  visibility: hidden !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,
body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-landscape) .shop-match-badge {
  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"]: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 .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,
body.mobile-ui.match-active.mobile-landscape[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .tower-panel .shop-decision-row--synergies {
  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;
}
