/* Loaded last. Desktop Mac HUD fixes for compact in-game layouts. */
@media (min-width: 981px) {
  body.match-active:not(.mobile-ui) {
    --desktop-shop-height: clamp(236px, 27vh, 292px);
    --desktop-top-clearance: 94px;
    --desktop-minimap-top: 96px;
  }

  body.match-active:not(.mobile-ui) .shell {
    grid-template-rows: minmax(0, 1fr) var(--desktop-shop-height);
  }

  body.match-active:not(.mobile-ui) .topbar {
    grid-template-columns: clamp(112px, 10vw, 158px) minmax(0, 1fr) 48px;
    grid-template-rows: 1fr;
    min-height: 78px;
    max-height: 88px;
    align-items: stretch;
  }

  body.match-active:not(.mobile-ui) .round-widget {
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
    height: 100%;
    padding: 7px 9px;
  }

  body.match-active:not(.mobile-ui) .round-widget strong {
    font-size: clamp(1.9rem, 2.4vw, 2.65rem);
  }

  body.match-active:not(.mobile-ui) .scoreboard {
    grid-column: 2;
    grid-row: 1;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    height: 100%;
    min-height: 0;
    align-items: stretch;
    align-content: stretch;
    gap: 6px;
    overflow: hidden;
  }

  body.match-active:not(.mobile-ui) .score-card,
  body.match-active:not(.mobile-ui) .score-card:nth-child(4),
  body.match-active:not(.mobile-ui) .score-card:nth-child(5),
  body.match-active:not(.mobile-ui) .score-card:nth-child(6) {
    grid-column: auto;
  }

  body.match-active:not(.mobile-ui) .score-card {
    height: 100%;
    min-height: 0;
    grid-template-columns: clamp(38px, 3vw, 46px) minmax(0, 1fr);
    gap: 6px;
    padding: 6px 7px;
    overflow: hidden;
  }

  body.match-active:not(.mobile-ui) .score-avatar {
    width: clamp(34px, 2.7vw, 42px);
    height: clamp(34px, 2.7vw, 42px);
  }

  body.match-active:not(.mobile-ui) .score-main {
    gap: 3px;
    min-height: 0;
  }

  body.match-active:not(.mobile-ui) .score-header {
    min-height: 14px;
    gap: 5px;
  }

  body.match-active:not(.mobile-ui) .score-name span:first-child,
  body.match-active:not(.mobile-ui) .score-game-level {
    font-size: clamp(0.58rem, 0.55vw, 0.72rem);
  }

  body.match-active:not(.mobile-ui) .score-game-level {
    padding: 2px 5px;
  }

  body.match-active:not(.mobile-ui) .score-values {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
    min-height: 0;
  }

  body.match-active:not(.mobile-ui) .score-values > span {
    min-height: 0;
    padding: 2px 4px;
  }

  body.match-active:not(.mobile-ui) .score-values > span::before {
    font-size: 0.44rem;
  }

  body.match-active:not(.mobile-ui) .score-values .icon-value {
    gap: 3px;
    font-size: clamp(0.62rem, 0.56vw, 0.8rem);
  }

  body.match-active:not(.mobile-ui) .toolbar {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
  }

  body.match-active:not(.mobile-ui) .tool-button {
    width: 42px;
    height: 42px;
  }

  body.match-active:not(.mobile-ui) .sidebar {
    grid-template-columns: minmax(170px, 0.22fr) minmax(490px, 0.8fr) minmax(250px, 0.42fr) minmax(360px, 0.66fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 8px;
    min-height: 0;
    overflow: hidden;
  }

  body.match-active:not(.mobile-ui) .stats-panel,
  body.match-active:not(.mobile-ui) .tower-panel,
  body.match-active:not(.mobile-ui) .bench-panel,
  body.match-active:not(.mobile-ui) .barracks-panel {
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  body.match-active:not(.mobile-ui) .stats-panel {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 7px;
  }

  body.match-active:not(.mobile-ui) .sidebar:not(:has(#selectedTowerPanel:not([hidden]))) .stats-panel {
    grid-row: 1;
  }

  body.match-active:not(.mobile-ui) .stats-panel h2 {
    margin: 0;
    font-size: 0.86rem;
  }

  body.match-active:not(.mobile-ui) .resource-grid {
    gap: 5px;
    overflow: hidden;
  }

  body.match-active:not(.mobile-ui) .stat-row {
    min-height: 24px;
    padding: 4px 8px;
  }

  body.match-active:not(.mobile-ui) .stat-row > span {
    font-size: 0.7rem;
  }

  body.match-active:not(.mobile-ui) .stat-row strong {
    font-size: 0.8rem;
  }

  body.match-active:not(.mobile-ui) #buyXpButton {
    min-height: 30px;
    padding-inline: 7px;
    font-size: 0.7rem;
    white-space: normal;
  }

  body.match-active:not(.mobile-ui) .tower-panel {
    grid-column: 2;
    grid-row: 1;
  }

  body.match-active:not(.mobile-ui) .bench-panel {
    grid-column: 3;
    grid-row: 1;
  }

  body.match-active:not(.mobile-ui) .barracks-panel {
    grid-column: 4;
    grid-row: 1;
  }

  body.match-active:not(.mobile-ui) .tower-panel,
  body.match-active:not(.mobile-ui) .bench-panel,
  body.match-active:not(.mobile-ui) .barracks-panel {
    padding: 10px;
    border-color: rgba(255, 240, 190, 0.16);
    background:
      linear-gradient(180deg, rgba(255, 248, 220, 0.055), rgba(255, 248, 220, 0.015) 42%, transparent),
      rgba(7, 12, 9, 0.76);
    box-shadow:
      inset 0 1px 0 rgba(255, 248, 220, 0.09),
      0 -10px 26px rgba(0, 0, 0, 0.2);
  }

  body.match-active:not(.mobile-ui) .tower-shop-header,
  body.match-active:not(.mobile-ui) .bench-panel .panel-title,
  body.match-active:not(.mobile-ui) .barracks-panel .panel-title {
    min-height: 30px;
    margin-bottom: 8px;
    padding: 0 2px;
  }

  body.match-active:not(.mobile-ui) .tower-shop-header h2,
  body.match-active:not(.mobile-ui) .bench-panel .panel-title h2,
  body.match-active:not(.mobile-ui) .barracks-panel .panel-title h2 {
    color: #fff8e8;
    font-size: clamp(0.92rem, 0.85vw, 1.08rem);
    line-height: 1;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.72);
  }

  body.match-active:not(.mobile-ui) #benchCountLabel {
    display: inline-grid;
    min-width: 44px;
    min-height: 24px;
    place-items: center;
    padding: 3px 8px;
    border: 1px solid rgba(255, 240, 190, 0.18);
    border-radius: 999px;
    background: rgba(3, 7, 6, 0.54);
    color: rgba(255, 248, 232, 0.82);
    font-size: 0.72rem;
    font-weight: 950;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    height: calc(100% - 38px);
    gap: 8px;
    overflow: hidden;
  }

  body.match-active:not(.mobile-ui) .tower-panel .choice-button {
    height: 100%;
    min-height: 0;
    grid-template-rows: minmax(72px, 1fr) auto;
    padding: 6px;
    border-color: color-mix(in srgb, var(--rarity-color, var(--gold)) 48%, rgba(255, 240, 190, 0.16));
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--rarity-color, var(--gold)) 15%, transparent), transparent 42%),
      radial-gradient(circle at 50% 22%, color-mix(in srgb, var(--rarity-color, var(--gold)) 22%, transparent), transparent 44%),
      rgba(3, 8, 7, 0.88);
  }

  body.match-active:not(.mobile-ui) .tower-panel .choice-icon {
    min-height: 68px;
    box-shadow:
      inset 0 -24px 34px rgba(0, 0, 0, 0.34),
      inset 0 1px 0 rgba(255, 248, 232, 0.06);
  }

  body.match-active:not(.mobile-ui) .tower-panel .choice-main {
    min-height: 54px;
    gap: 4px;
    margin-top: -12px;
    padding: 15px 6px 6px;
    background: linear-gradient(180deg, transparent, rgba(1, 5, 5, 0.78) 18%, rgba(1, 5, 5, 0.94));
  }

  body.match-active:not(.mobile-ui) .tower-panel .choice-name {
    font-size: clamp(0.62rem, 0.6vw, 0.74rem);
    line-height: 1.05;
  }

  body.match-active:not(.mobile-ui) .tower-panel .choice-cost {
    top: 6px;
    right: 6px;
    min-width: 28px;
    min-height: 20px;
    padding: 2px 5px;
    font-size: 0.64rem;
  }

  body.match-active:not(.mobile-ui) .tower-panel .shop-match-badge {
    top: 6px;
    left: 6px;
    max-width: 72px;
    padding: 3px 7px;
    background: rgba(2, 8, 8, 0.78);
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-floating-badges {
    top: -50px;
    left: 6px;
    right: 6px;
  }

  body.match-active:not(.mobile-ui) .bench-list {
    height: calc(100% - 38px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(62px, 1fr));
    gap: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
  }

  body.match-active:not(.mobile-ui) .bench-slot {
    min-height: 62px;
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 7px;
    border-color: rgba(255, 240, 190, 0.14);
    background:
      linear-gradient(180deg, rgba(255, 248, 220, 0.04), transparent 64%),
      rgba(3, 8, 7, 0.64);
  }

  body.match-active:not(.mobile-ui) .bench-slot:not(.empty) {
    border-color: color-mix(in srgb, var(--rarity-color, var(--gold)) 48%, rgba(255, 240, 190, 0.12));
    background:
      linear-gradient(90deg, color-mix(in srgb, var(--rarity-color, var(--gold)) 13%, transparent), transparent 68%),
      linear-gradient(180deg, rgba(255, 248, 220, 0.055), transparent 62%),
      rgba(3, 9, 7, 0.84);
    box-shadow:
      inset 0 1px 0 rgba(255, 248, 220, 0.08),
      inset 3px 0 0 color-mix(in srgb, var(--rarity-color, var(--gold)) 72%, transparent);
  }

  body.match-active:not(.mobile-ui) .bench-slot.empty {
    border-style: dashed;
    background:
      repeating-linear-gradient(-45deg, rgba(255, 240, 190, 0.035) 0 6px, transparent 6px 14px),
      rgba(3, 7, 6, 0.36);
    opacity: 0.76;
  }

  body.match-active:not(.mobile-ui) .bench-slot .choice-icon {
    width: 46px;
    height: 46px;
    border-color: color-mix(in srgb, var(--rarity-color, var(--gold)) 42%, rgba(255, 240, 190, 0.14));
    background:
      radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--rarity-color, var(--gold)) 18%, transparent), transparent 48%),
      rgba(2, 5, 5, 0.42) !important;
  }

  body.match-active:not(.mobile-ui) .bench-main {
    align-content: center;
    gap: 4px;
    min-height: 0;
    overflow: hidden;
  }

  body.match-active:not(.mobile-ui) .bench-tags {
    min-height: 18px;
  }

  body.match-active:not(.mobile-ui) .bench-title span {
    color: #fff8e8;
    font-size: clamp(0.64rem, 0.58vw, 0.76rem);
    font-weight: 950;
    letter-spacing: 0;
  }

  body.match-active:not(.mobile-ui) .bench-title strong {
    min-width: 18px;
    color: #ffe1a4;
    text-align: right;
  }

  body.match-active:not(.mobile-ui) .bench-tags .shop-decision-badge {
    max-width: 86px;
    background: rgba(0, 0, 0, 0.28);
  }

  body.match-active:not(.mobile-ui) .bench-empty {
    color: rgba(255, 248, 232, 0.28);
    font-size: 0.7rem;
    font-weight: 950;
  }

  body.match-active:not(.mobile-ui) .barracks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-rows: minmax(0, 1fr);
    height: calc(100% - 38px);
    gap: 8px;
    overflow: hidden;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-card {
    height: 100%;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(74px, 1fr) auto;
    gap: 0;
    padding: 6px;
    border-color: color-mix(in srgb, var(--rarity-color, var(--gold)) 46%, rgba(255, 240, 190, 0.15));
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--rarity-color, var(--gold)) 14%, transparent), transparent 44%),
      radial-gradient(circle at 50% 22%, color-mix(in srgb, var(--rarity-color, var(--gold)) 22%, transparent), transparent 44%),
      rgba(3, 8, 7, 0.88);
    text-align: center;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-card .choice-icon {
    min-height: 72px;
    border-radius: 7px 7px 3px 3px;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-card .choice-main {
    align-content: center;
    min-height: 48px;
    margin-top: -12px;
    padding: 14px 5px 5px;
    border-radius: 0 0 7px 7px;
    background: linear-gradient(180deg, transparent, rgba(1, 4, 4, 0.84) 16%, rgba(1, 4, 4, 0.94));
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-card .choice-name {
    padding-right: 0;
    font-size: clamp(0.66rem, 0.62vw, 0.8rem);
    text-align: center;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-card .choice-cost {
    top: 6px;
    right: 6px;
    min-width: 36px;
    min-height: 22px;
    padding: 3px 6px;
    font-size: 0.66rem;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-primary,
  body.match-active:not(.mobile-ui) .barracks .unit-shop-details {
    display: none;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-decision-row {
    display: flex !important;
    align-content: center !important;
    justify-content: center !important;
    gap: 4px !important;
    max-height: 42px !important;
    overflow: hidden !important;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-decision-row .shop-decision-badge {
    min-height: 18px !important;
    padding: 2px 6px !important;
    font-size: 0.54rem !important;
  }

  body.match-active .chat-panel {
    transition: transform 180ms ease, opacity 180ms ease, visibility 180ms ease;
  }

  body.match-active:not(.chat-panel-open) .chat-panel:not([hidden]),
  body.match-active .chat-panel.is-collapsed:not([hidden]) {
    transform: translateX(calc(100% + 28px));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  body.match-active.chat-panel-open .chat-panel:not(.is-collapsed):not([hidden]) {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

@media (min-width: 981px) and (max-width: 1320px) {
  body.match-active:not(.mobile-ui) .sidebar {
    grid-template-columns: minmax(136px, 0.2fr) minmax(340px, 0.74fr) minmax(188px, 0.38fr) minmax(270px, 0.58fr);
    gap: 7px;
  }

  body.match-active:not(.mobile-ui) .score-card {
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 5px;
  }

  body.match-active:not(.mobile-ui) .score-avatar {
    width: 32px;
    height: 32px;
  }

  body.match-active:not(.mobile-ui) .score-values > span::before {
    display: none;
  }

  body.match-active:not(.mobile-ui) .score-values {
    gap: 2px;
  }

  body.match-active:not(.mobile-ui) .score-values .icon-value {
    font-size: 0.58rem;
  }

  body.match-active:not(.mobile-ui) .tower-panel .choice-button {
    grid-template-rows: minmax(54px, 1fr) auto;
  }

  body.match-active:not(.mobile-ui) .tower-panel .choice-icon,
  body.match-active:not(.mobile-ui) .barracks .unit-shop-card .choice-icon {
    min-height: 54px;
  }

  body.match-active:not(.mobile-ui) .tower-panel .choice-main,
  body.match-active:not(.mobile-ui) .barracks .unit-shop-card .choice-main {
    min-height: 42px;
  }
}

/* Keep level resources and the whole bench visible on compact desktop heights. */
@media (min-width: 981px) {
  body.match-active:not(.mobile-ui) .sidebar {
    grid-template-columns: minmax(150px, 0.2fr) minmax(480px, 0.82fr) minmax(318px, 0.5fr) minmax(360px, 0.62fr);
  }

  body.match-active:not(.mobile-ui) .stats-panel {
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
  }

  body.match-active:not(.mobile-ui) .resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 5px;
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

  body.match-active:not(.mobile-ui) .stat-row {
    min-height: 24px;
    padding: 4px 7px;
  }

  body.match-active:not(.mobile-ui) .stat-row--bar {
    grid-column: 1 / -1;
  }

  body.match-active:not(.mobile-ui) #buyXpButton {
    flex-shrink: 0;
    margin-top: 0;
  }

  body.match-active:not(.mobile-ui) .bench-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 6px;
    overflow: hidden;
    scrollbar-gutter: auto;
  }

  body.match-active:not(.mobile-ui) .bench-slot {
    position: relative;
    display: block;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  body.match-active:not(.mobile-ui) .bench-slot.empty {
    display: grid;
    place-items: center;
  }

  body.match-active:not(.mobile-ui) .bench-slot .choice-icon {
    position: absolute;
    inset: 12px 7px 13px;
    width: auto;
    height: auto;
    border: 0;
    opacity: 0.92;
    transform: scale(1.14);
  }

  body.match-active:not(.mobile-ui) .bench-main {
    position: absolute;
    inset: 4px;
    z-index: 2;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0;
    pointer-events: none;
  }

  body.match-active:not(.mobile-ui) .bench-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 3px;
  }

  body.match-active:not(.mobile-ui) .bench-title span {
    max-width: 100%;
    padding: 2px 4px;
    border-radius: 5px;
    background: rgba(2, 7, 6, 0.64);
    font-size: clamp(0.54rem, 0.5vw, 0.64rem);
    line-height: 1;
  }

  body.match-active:not(.mobile-ui) .bench-title strong {
    min-width: 14px;
    padding: 2px 4px;
    border-radius: 999px;
    background: rgba(2, 7, 6, 0.7);
    font-size: 0.56rem;
    line-height: 1;
  }

  body.match-active:not(.mobile-ui) .bench-tags {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 3px;
    min-height: 15px;
  }

  body.match-active:not(.mobile-ui) .bench-target-badge,
  body.match-active:not(.mobile-ui) .bench-element-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 240, 190, 0.16);
    background: rgba(2, 7, 6, 0.72);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.36);
  }

  body.match-active:not(.mobile-ui) .bench-target-badge {
    max-width: calc(100% - 24px);
    min-height: 15px;
    padding: 1px 4px;
    border-radius: 999px;
    color: #d9f2ff;
    font-size: 0.46rem;
    font-weight: 950;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.match-active:not(.mobile-ui) .bench-element-badge {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    margin-left: auto;
    border-color: color-mix(in srgb, var(--shop-tag-color, #78efff) 62%, rgba(255, 248, 232, 0.2));
    border-radius: 999px;
    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));
    box-shadow: 0 0 12px color-mix(in srgb, var(--shop-tag-color, #78efff) 38%, transparent);
  }

  body.match-active:not(.mobile-ui) .bench-element-icon {
    display: block;
    width: 13px;
    height: 13px;
    object-fit: contain;
  }

  body.match-active:not(.mobile-ui) .bench-element-badge--ice {
    border-color: rgba(215, 250, 255, 0.92);
    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);
    box-shadow: 0 0 14px rgba(174, 232, 255, 0.58), inset 0 0 8px rgba(255, 255, 255, 0.18);
  }

  body.match-active:not(.mobile-ui) .bench-element-icon--ice {
    filter: brightness(1.28) contrast(1.12) drop-shadow(0 0 3px rgba(225, 252, 255, 0.86));
  }
}

@media (min-width: 981px) and (max-width: 1320px) {
  body.match-active:not(.mobile-ui) .sidebar {
    grid-template-columns: minmax(112px, 0.18fr) minmax(310px, 0.72fr) minmax(280px, 0.48fr) minmax(250px, 0.56fr);
  }

  body.match-active:not(.mobile-ui) .bench-slot .choice-icon {
    inset: 12px 5px 12px;
    transform: scale(1.1);
  }

  body.match-active:not(.mobile-ui) .bench-title span {
    padding-inline: 3px;
    font-size: 0.5rem;
  }

  body.match-active:not(.mobile-ui) .bench-title strong {
    padding-inline: 3px;
    font-size: 0.5rem;
  }

  body.match-active:not(.mobile-ui) .bench-target-badge {
    min-height: 13px;
    padding-inline: 3px;
    font-size: 0.4rem;
  }

  body.match-active:not(.mobile-ui) .bench-element-badge {
    width: 17px;
    height: 17px;
  }

  body.match-active:not(.mobile-ui) .bench-element-icon {
    width: 12px;
    height: 12px;
  }
}

@media (min-width: 981px) and (max-height: 760px) {
  body.match-active:not(.mobile-ui) .stats-panel h2 {
    display: none;
  }

  body.match-active:not(.mobile-ui) .stat-row {
    min-height: 21px;
    padding-block: 3px;
  }

  body.match-active:not(.mobile-ui) #buyXpButton {
    min-height: 28px;
  }
}

body.match-active:not(.mobile-ui) .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.match-active:not(.mobile-ui) .bench-slot .bench-element-badge {
  display: inline-grid !important;
  width: 19px !important;
  height: 19px !important;
  place-items: center !important;
}

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

body.match-active:not(.mobile-ui) .bench-slot .bench-main {
  width: auto !important;
}

body.match-active:not(.mobile-ui) .bench-slot .bench-title span,
body.match-active:not(.mobile-ui) .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.match-active:not(.mobile-ui) .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: 4px !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  pointer-events: none !important;
}

body.match-active:not(.mobile-ui) .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% - 26px) !important;
  min-height: 17px !important;
  padding: 2px 5px !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.match-active:not(.mobile-ui) .bench-slot .bench-tags--corner-meta .bench-target-badge::before {
  color: inherit !important;
  font-size: 0.48rem !important;
  line-height: 1 !important;
  text-transform: none !important;
}

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

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

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

body.match-active:not(.mobile-ui) .bench-slot .bench-tags--corner-meta .bench-element-badge {
  display: inline-grid !important;
  width: 22px !important;
  height: 22px !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.match-active:not(.mobile-ui) .bench-slot .bench-tags--corner-meta .bench-element-icon {
  display: block !important;
  width: 16px !important;
  height: 16px !important;
  object-fit: contain !important;
  opacity: 1 !important;
  filter: none !important;
}

body.match-active:not(.mobile-ui) .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.match-active:not(.mobile-ui) .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.match-active:not(.mobile-ui) .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.match-active:not(.mobile-ui) .bench-slot .bench-tags--corner-meta .bench-element-icon--ice,
body.match-active:not(.mobile-ui) .bench-slot .bench-tags--corner-meta .bench-element-icon--wind {
  filter: none !important;
}

@media (min-width: 981px) {
  body.match-active:not(.mobile-ui) .stats-panel .resource-grid .stat-row > span,
  body.match-active:not(.mobile-ui) .score-values > span::before {
    display: none !important;
  }

  body.match-active:not(.mobile-ui) .stats-panel .resource-grid .stat-row {
    justify-content: center !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 5px !important;
  }

  body.match-active:not(.mobile-ui) .stats-panel .resource-grid .stat-row strong {
    width: 100% !important;
    justify-self: center !important;
    text-align: center !important;
  }

  body.match-active:not(.mobile-ui) .stats-panel .resource-grid .stat-row .icon-value,
  body.match-active:not(.mobile-ui) .score-values .icon-value {
    width: 100% !important;
    justify-content: center !important;
  }

  body.match-active:not(.mobile-ui) .stats-panel .resource-grid .stat-row--bar .resource-bar {
    grid-column: 1 !important;
  }

  body.match-active:not(.mobile-ui) .score-values > span {
    min-height: 24px !important;
    padding: 2px 5px !important;
  }

  body.match-active:not(.mobile-ui) .score-card {
    min-height: 78px !important;
    grid-template-columns: clamp(38px, 3vw, 46px) minmax(0, 1fr) !important;
  }

  body.match-active:not(.mobile-ui) .score-avatar {
    width: clamp(34px, 2.7vw, 42px) !important;
    height: clamp(34px, 2.7vw, 42px) !important;
  }

  body.match-active:not(.mobile-ui) .score-rank-frame {
    inset: -10px !important;
  }

  body.match-active:not(.mobile-ui) .score-rank-division {
    right: -5px !important;
    bottom: -5px !important;
  }

  body.match-active:not(.mobile-ui) .score-values {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 3px !important;
    width: 100% !important;
    margin-top: 0 !important;
  }

  body.match-active:not(.mobile-ui) .score-values > span {
    min-height: 20px !important;
    padding: 2px 4px !important;
  }

  body.match-active:not(.mobile-ui) .score-value--defense,
  body.match-active:not(.mobile-ui) .score-value--income {
    grid-row: 2 !important;
  }

  body.match-active:not(.mobile-ui) .score-values .icon-value {
    justify-content: space-between !important;
    gap: 3px !important;
    font-size: clamp(0.62rem, 0.52vw, 0.76rem) !important;
  }

  body.match-active:not(.mobile-ui) .tower-panel .choice-button {
    position: relative !important;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-floating-badges {
    position: absolute !important;
    top: 31px !important;
    left: 7px !important;
    right: 7px !important;
    z-index: 8 !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 5px !important;
    pointer-events: none !important;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-floating-badge {
    position: static !important;
    top: auto !important;
    display: inline-flex !important;
    min-width: 0 !important;
    max-width: 74px !important;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-floating-badge--target {
    margin-left: auto !important;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-floating-badge .shop-decision-badge {
    min-height: 18px !important;
    max-width: 74px !important;
    padding: 2px 5px !important;
    border-radius: 999px !important;
    background: rgba(2, 7, 7, 0.78) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.42) !important;
    font-size: 0.52rem !important;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-floating-badge--target .shop-decision-badge {
    max-width: 60px !important;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-floating-badge--element .shop-decision-badge {
    max-width: 54px !important;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-floating-badge--element .shop-decision-badge--element-icon {
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    border-color: transparent !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-floating-badge .shop-decision-icon,
  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-floating-badge .income-icon {
    width: 11px !important;
    height: 11px !important;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-floating-badge--element .shop-decision-badge--element-icon .shop-decision-icon {
    width: 24px !important;
    height: 24px !important;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.58)) !important;
    transform: scale(1.08) !important;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-floating-stats {
    position: absolute !important;
    top: 7px !important;
    left: 8px !important;
    right: auto !important;
    z-index: 8 !important;
    display: grid !important;
    grid-template-columns: minmax(54px, max-content) !important;
    align-items: center !important;
    justify-content: start !important;
    gap: 3px !important;
    max-width: none !important;
    pointer-events: none !important;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-floating-stats .unit-shop-pill {
    min-width: 54px !important;
    max-width: 78px !important;
    min-height: 23px !important;
    padding: 3px 6px !important;
    gap: 4px !important;
    overflow: hidden !important;
    border-radius: 999px !important;
    font-size: 0.62rem !important;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-floating-stats .heart-icon {
    flex: 0 0 auto !important;
    width: 0.84em !important;
    height: 0.84em !important;
    margin-right: 0.12em !important;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-floating-stats .income-icon {
    width: 1.18em !important;
    height: 1.04em !important;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-floating-stats strong {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

@media (min-width: 981px) and (max-width: 1320px) {
  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-floating-badges {
    top: 28px !important;
    left: 6px !important;
    right: 6px !important;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-floating-stats {
    left: 6px !important;
    right: auto !important;
    gap: 2px !important;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-floating-stats .unit-shop-pill {
    min-width: 48px !important;
    max-width: 66px !important;
    padding-inline: 4px !important;
    font-size: 0.56rem !important;
  }
}
