:root {
  color-scheme: dark;
  --bg: #050908;
  --panel: rgba(18, 22, 21, 0.86);
  --panel-solid: #111714;
  --panel-2: rgba(26, 34, 29, 0.88);
  --line: rgba(209, 180, 101, 0.18);
  --text: #fff8e8;
  --muted: #b8c3ad;
  --muted-2: #778874;
  --gold: #d7a94a;
  --green: #61d596;
  --red: #ff736a;
  --blue: #6dbfe8;
  --violet: #a98cff;
  --cyan: #62ead0;
  --steel: #26342e;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --glow: 0 0 34px rgba(98, 234, 208, 0.18);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.augment-overlay {
  background: rgba(1, 5, 4, 0.54);
  backdrop-filter: blur(5px);
}

body.augment-choice-active .game-loader {
  pointer-events: none;
}

.augment-panel,
.augment-book-panel,
.power-book-panel {
  width: min(920px, calc(100vw - 28px));
  border: 1px solid rgba(255, 240, 190, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(17, 24, 18, 0.98), rgba(5, 9, 7, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  color: #fff8e8;
  padding: 22px;
}

.augment-timer {
  --augment-timer-progress: 1;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px 12px;
  min-height: 38px;
  margin: -3px 0 14px;
  padding: 8px 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 240, 190, 0.18);
  border-radius: 8px;
  background: rgba(4, 8, 7, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.augment-timer[hidden] {
  display: none;
}

.augment-timer span {
  color: #d8e2c9;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.augment-timer strong {
  color: #fff8e8;
  font-family: "Black Ops One", Impact, sans-serif;
  font-size: 1.05rem;
  line-height: 1;
  text-shadow: 0 0 12px rgba(242, 184, 75, 0.28);
}

.augment-timer i {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 240, 190, 0.12);
}

.augment-timer i::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #62ead0, #f2b84b);
  transform: scaleX(var(--augment-timer-progress, 1));
  transform-origin: left center;
  transition: transform 160ms linear;
}

.augment-timer[data-tone="warning"] i::before {
  background: linear-gradient(90deg, #f2b84b, #ff9d43);
}

.augment-timer[data-tone="danger"] i::before {
  background: linear-gradient(90deg, #ff736a, #f2b84b);
}

.augment-choice-grid,
.augment-book-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.augment-card,
.augment-book-entry {
  min-height: 220px;
  border: 1px solid color-mix(in srgb, var(--augment-color, #d7a94a) 52%, rgba(255, 240, 190, 0.16));
  border-radius: 8px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--augment-color, #d7a94a) 14%, transparent), transparent 62%), rgba(7, 12, 9, 0.88);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.augment-card--bronze { --augment-color: #c9824b; }
.augment-card--silver { --augment-color: #bcc8d4; }
.augment-card--gold { --augment-color: #f2b84b; }
.augment-card--prismatic { --augment-color: #9ff7ff; }
.map-book-entry { --augment-color: #62ead0; }

.power-book-panel {
  width: min(780px, calc(100vw - 28px));
  border-color: rgba(255, 202, 102, 0.28);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 190, 91, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(20, 18, 15, 0.98), rgba(5, 9, 7, 0.98));
}

.augment-rarity {
  align-self: flex-start;
  border: 1px solid color-mix(in srgb, var(--augment-color) 58%, rgba(255, 255, 255, 0.22));
  border-radius: 999px;
  color: color-mix(in srgb, var(--augment-color) 72%, #fff8e8);
  background: color-mix(in srgb, var(--augment-color) 12%, rgba(0, 0, 0, 0.36));
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.augment-card h3,
.augment-book-entry h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #fff8e8;
}

.augment-card p,
.augment-book-entry p,
.augment-book-empty {
  margin: 0;
  color: rgba(255, 248, 232, 0.78);
  line-height: 1.45;
}

.augment-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

.augment-actions > button {
  flex: 1;
}

.augment-actions > .augment-reroll-button {
  flex: 0 0 44px;
  min-width: 44px;
  min-height: 40px;
  padding-inline: 0;
  border-color: color-mix(in srgb, var(--augment-color, #d7a94a) 54%, rgba(255, 240, 190, 0.22));
  color: color-mix(in srgb, var(--augment-color, #d7a94a) 74%, #fff8e8);
}

.augment-reroll-button > span:first-child {
  font-size: 1.08rem;
}

.augment-book-head,
.power-book-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.augment-book-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: min(620px, 66vh);
  overflow: auto;
}

.augment-book-entry {
  min-height: 150px;
}

.power-book-list {
  display: grid;
  gap: 10px;
  max-height: min(620px, 66vh);
  overflow: auto;
}

.power-history-entry {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 12px;
  min-height: 96px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--power-color, #d7a94a) 48%, rgba(255, 240, 190, 0.14));
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--power-color, #d7a94a) 16%, transparent), transparent 68%),
    rgba(7, 11, 9, 0.86);
}

.power-history-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid color-mix(in srgb, var(--power-color, #d7a94a) 62%, rgba(255, 240, 190, 0.22));
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 25%, color-mix(in srgb, var(--power-color, #d7a94a) 28%, transparent), transparent 62%),
    rgba(5, 8, 7, 0.92);
  color: color-mix(in srgb, var(--power-color, #d7a94a) 72%, #fff8e8);
  font-weight: 950;
  overflow: hidden;
}

.power-history-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.power-history-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.power-history-body h3 {
  margin: 0;
  color: #fff8e8;
  font-size: 1rem;
}

.power-history-body p {
  margin: 0;
  color: rgba(255, 248, 232, 0.8);
  line-height: 1.35;
}

.power-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.power-history-meta span {
  border: 1px solid rgba(255, 240, 190, 0.14);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.24);
  color: color-mix(in srgb, var(--power-color, #d7a94a) 68%, #fff8e8);
  font-size: 0.72rem;
  font-weight: 850;
}

.power-reveal-panel {
  width: min(480px, calc(100vw - 28px));
  display: grid;
  gap: 14px;
  justify-items: center;
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--power-color, #d7a94a) 42%, rgba(255, 240, 190, 0.2));
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 4%, color-mix(in srgb, var(--power-color, #d7a94a) 18%, transparent), transparent 42%),
    linear-gradient(180deg, rgba(17, 24, 18, 0.98), rgba(5, 9, 7, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  color: #fff8e8;
}

.power-reveal-panel .eyebrow {
  margin: 0;
  color: #efe0ad;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.power-reveal-panel h2 {
  margin: 0;
  font-size: 1.55rem;
  text-align: center;
}

.power-wheel {
  position: relative;
  width: min(230px, 58vw);
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(255, 240, 190, 0.2);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 248, 232, 0.16) 0 18%, transparent 19%),
    radial-gradient(circle at 50% 50%, transparent 0 55%, rgba(0, 0, 0, 0.18) 56% 100%),
    conic-gradient(
      from -20deg,
      color-mix(in srgb, var(--power-color, #d7a94a) 42%, rgba(98, 234, 208, 0.24)),
      rgba(242, 184, 75, 0.24),
      rgba(255, 111, 145, 0.24),
      rgba(125, 109, 255, 0.24),
      color-mix(in srgb, var(--power-color, #d7a94a) 42%, rgba(98, 234, 208, 0.24))
    );
  box-shadow: inset 0 0 38px rgba(0, 0, 0, 0.36), 0 0 28px rgba(215, 169, 74, 0.14);
  isolation: isolate;
}

.power-wheel::before {
  content: "";
  position: absolute;
  z-index: 7;
  left: 50%;
  top: 7px;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 20px solid color-mix(in srgb, var(--power-color, #d7a94a) 42%, #fff8e8);
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
}

.power-wheel::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 34%;
  border: 1px solid rgba(255, 248, 232, 0.26);
  border-radius: inherit;
  background:
    radial-gradient(circle at 38% 26%, rgba(255, 255, 255, 0.32), transparent 34%),
    rgba(5, 8, 7, 0.62);
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.42),
    0 0 18px color-mix(in srgb, var(--power-color, #d7a94a) 22%, transparent);
}

.power-wheel-track,
.power-wheel-sweep {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.power-wheel-track {
  z-index: 1;
  animation: power-wheel-track-spin var(--power-reveal-spin-ms, 2.2s) cubic-bezier(0.14, 0.74, 0.18, 1) both;
}

.power-wheel-sweep {
  z-index: 3;
  inset: 7%;
  background: conic-gradient(from -18deg, transparent 0 72%, rgba(255, 248, 232, 0.36) 77%, transparent 84% 100%);
  mix-blend-mode: screen;
  opacity: 0;
  animation: power-wheel-sweep var(--power-reveal-spin-ms, 2.2s) ease-out both;
  pointer-events: none;
}

.power-wheel-token {
  position: absolute;
  display: grid;
  left: var(--wheel-x, 50%);
  top: var(--wheel-y, 50%);
  width: 36px;
  height: 36px;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid color-mix(in srgb, var(--power-color, #d7a94a) 58%, rgba(255, 248, 232, 0.24));
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.28), transparent 32%),
    color-mix(in srgb, var(--power-color, #d7a94a) 18%, rgba(4, 8, 7, 0.9));
  color: #fff8e8;
  font-size: 0.66rem;
  font-weight: 950;
  overflow: hidden;
}

.power-wheel-token.has-image,
.power-wheel-center.has-image {
  border-color: color-mix(in srgb, var(--power-color, #d7a94a) 48%, rgba(255, 248, 232, 0.22));
  background: rgba(5, 8, 7, 0.92);
}

.power-wheel-token.is-result {
  border-color: color-mix(in srgb, var(--power-color, #d7a94a) 64%, #fff8e8);
  box-shadow: 0 0 18px color-mix(in srgb, var(--power-color, #d7a94a) 48%, transparent);
  animation: power-wheel-result-token-pop 0.42s ease-out both;
}

.power-wheel-center {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 50%;
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  transform: translate(-50%, -50%) scale(1);
  border: 2px solid color-mix(in srgb, var(--power-color, #d7a94a) 62%, #fff8e8);
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.3), transparent 34%),
    rgba(5, 8, 7, 0.94);
  box-shadow:
    0 0 28px color-mix(in srgb, var(--power-color, #d7a94a) 42%, transparent),
    inset 0 0 18px rgba(255, 248, 232, 0.1);
  color: #fff8e8;
  font-size: 1.2rem;
  font-weight: 950;
  opacity: 1;
  overflow: hidden;
}

.power-wheel-center.is-mystery {
  border-color: rgba(255, 248, 232, 0.34);
  box-shadow:
    0 0 22px rgba(215, 169, 74, 0.22),
    inset 0 0 18px rgba(255, 248, 232, 0.1);
  animation: power-wheel-mystery-pulse 0.9s ease-in-out infinite alternate;
}

.power-wheel-center.is-result-ready {
  opacity: 0;
  animation: power-wheel-center-pop 0.58s cubic-bezier(0.16, 0.86, 0.2, 1.18) both;
}

.power-wheel-result-label {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 12px;
  max-width: 78%;
  transform: translateX(-50%) translateY(6px);
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--power-color, #d7a94a) 48%, rgba(255, 248, 232, 0.2));
  border-radius: 999px;
  background: rgba(4, 8, 7, 0.78);
  color: #fff8e8;
  font-size: 0.64rem;
  font-weight: 950;
  line-height: 1.1;
  opacity: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.power-reveal-panel.is-revealed .power-wheel-result-label {
  animation: power-wheel-label-pop 0.36s ease-out both;
}

.power-reveal-card {
  width: 100%;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--power-color, #d7a94a) 54%, rgba(255, 240, 190, 0.16));
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--power-color, #d7a94a) 13%, transparent), transparent 66%),
    rgba(7, 12, 9, 0.82);
}

.power-reveal-card strong,
.power-reveal-card span,
.power-reveal-card p {
  display: block;
}

.power-reveal-card strong {
  color: #fff8e8;
  font-size: 1rem;
}

.power-reveal-card span {
  color: color-mix(in srgb, var(--power-color, #d7a94a) 72%, #fff8e8);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.power-reveal-card p {
  margin: 5px 0 0;
  color: rgba(255, 248, 232, 0.78);
  font-size: 0.82rem;
  line-height: 1.35;
}

.power-reveal-card.is-pending {
  border-style: dashed;
}

@keyframes power-wheel-track-spin {
  0% { transform: rotate(calc(var(--wheel-final-rotation, 0deg) - 1120deg)) scale(0.86); filter: blur(1px); opacity: 0.4; }
  68% { transform: rotate(calc(var(--wheel-final-rotation, 0deg) + 18deg)) scale(1.03); filter: blur(0); opacity: 1; }
  84% { transform: rotate(calc(var(--wheel-final-rotation, 0deg) - 7deg)) scale(1); }
  100% { transform: rotate(var(--wheel-final-rotation, 0deg)) scale(1); filter: blur(0); opacity: 1; }
}

@keyframes power-wheel-sweep {
  0% { transform: rotate(-360deg); opacity: 0; }
  18% { opacity: 0.72; }
  82% { opacity: 0.42; }
  100% { transform: rotate(0deg); opacity: 0; }
}

@keyframes power-wheel-center-pop {
  0% { transform: translate(-50%, -50%) scale(0.52); opacity: 0; }
  62% { transform: translate(-50%, -50%) scale(1.12); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes power-wheel-mystery-pulse {
  0% { transform: translate(-50%, -50%) scale(0.96); filter: brightness(0.92); }
  100% { transform: translate(-50%, -50%) scale(1.04); filter: brightness(1.12); }
}

@keyframes power-wheel-result-token-pop {
  0% { transform: translate(-50%, -50%) scale(0.84); }
  100% { transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes power-wheel-label-pop {
  0% { transform: translateX(-50%) translateY(6px); opacity: 0; }
  100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.end-overlay.traits-overlay {
  background: rgba(1, 5, 4, 0.54);
  z-index: 92;
}

.traits-panel {
  width: min(1060px, calc(100vw - 44px));
  max-height: min(780px, calc(100dvh - 28px));
  overflow: hidden;
  border: 1px solid rgba(255, 240, 190, 0.22);
  border-radius: 8px;
  background: rgba(9, 14, 11, 0.98);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
  color: #fff8e8;
  padding: 18px;
  contain: layout style;
}

.traits-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.traits-panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.traits-panel-actions .mode-button {
  min-height: 34px;
  padding-inline: 10px;
  white-space: nowrap;
}

.traits-panel-content {
  display: grid;
  gap: 16px;
  max-height: calc(min(780px, 100dvh - 28px) - 96px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 4px;
  contain: layout paint style;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.traits-section {
  display: grid;
  gap: 10px;
  content-visibility: auto;
  contain-intrinsic-size: 240px;
}

.traits-section h3 {
  margin: 0;
  color: #efe0ad;
  font-size: 0.92rem;
  text-transform: uppercase;
}

.traits-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}

.trait-card {
  align-self: start;
  border: 1px solid color-mix(in srgb, var(--trait-color, #d7a94a) 52%, rgba(255, 240, 190, 0.12));
  border-radius: 8px;
  background: rgba(7, 12, 9, 0.9);
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--trait-color, #d7a94a) 62%, transparent);
  contain: layout paint style;
  content-visibility: auto;
  contain-intrinsic-size: 86px;
  overflow: hidden;
}

.trait-card--inactive {
  opacity: 0.78;
}

.trait-card.is-open {
  content-visibility: visible;
}

.trait-card-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.trait-toggle-indicator {
  display: inline-grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(255, 248, 232, 0.16);
  border-radius: 999px;
  color: color-mix(in srgb, var(--trait-color, #d7a94a) 72%, #fff8e8);
  font-size: 1rem;
  font-weight: 950;
  line-height: 1;
}

.trait-card-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.trait-card-main strong,
.trait-card-main em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trait-card-main em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 850;
}

.trait-summary-preview {
  display: block;
  max-width: min(520px, 58vw);
  margin-top: 3px;
  overflow: hidden;
  color: color-mix(in srgb, var(--trait-color, #d7a94a) 62%, #fff8e8);
  font-size: 0.66rem;
  font-weight: 850;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trait-icon {
  display: inline-grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--trait-color, #d7a94a) 58%, rgba(255, 255, 255, 0.18));
  border-radius: 8px;
  background: color-mix(in srgb, var(--trait-color, #d7a94a) 15%, rgba(0, 0, 0, 0.42));
  color: color-mix(in srgb, var(--trait-color, #d7a94a) 72%, #fff8e8);
  font-weight: 950;
}

.trait-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.trait-icon-img,
.trait-chip-icon,
.element-resistance-icon {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}

.trait-icon-img {
  width: 24px;
  height: 24px;
}

.trait-chip-icon {
  width: 14px;
  height: 14px;
  margin-inline-end: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.reference-trait-head {
  justify-content: flex-start;
}

.reference-trait-icon {
  flex-basis: 42px;
  width: 42px;
  height: 42px;
  border-radius: 9px;
}

.reference-trait-icon svg {
  width: 25px;
  height: 25px;
}

.trait-tier {
  flex: 0 0 auto;
  min-width: 34px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 240, 190, 0.18);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-align: center;
}

.trait-tier--active {
  border-color: color-mix(in srgb, var(--trait-color, #d7a94a) 70%, rgba(255, 255, 255, 0.22));
  color: color-mix(in srgb, var(--trait-color, #d7a94a) 76%, #fff8e8);
}

.trait-card-detail {
  display: grid;
  gap: 9px;
  padding: 0 12px 12px;
  contain: layout paint style;
}

body.traits-panel-scrolling .trait-card,
body.traits-panel-scrolling .reference-tower-card {
  transition: none;
}

body.traits-panel-scrolling .trait-card {
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--trait-color, #d7a94a) 62%, transparent);
}

.trait-card-detail p,
.traits-empty {
  margin: 0;
  color: rgba(255, 248, 232, 0.76);
  line-height: 1.42;
}

.trait-progress,
.trait-requirement,
.trait-tower-list {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid rgba(151, 184, 211, 0.12);
  border-radius: 6px;
  background: rgba(4, 8, 6, 0.46);
}

.trait-bonus-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.trait-bonus-block--inline {
  align-items: flex-start;
}

.trait-bonus-block h4 {
  flex: 0 0 100%;
  margin: 0;
  color: #efe0ad;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.trait-bonus-block > span,
.tower-trait-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--trait-color, #d7a94a) 44%, rgba(255, 240, 190, 0.14));
  border-radius: 999px;
  background: color-mix(in srgb, var(--trait-color, #d7a94a) 12%, rgba(0, 0, 0, 0.34));
  color: color-mix(in srgb, var(--trait-color, #d7a94a) 70%, #fff8e8);
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1;
}

.trait-requirements,
.trait-tower-list {
  display: grid;
  gap: 6px;
}

.trait-tier-roadmap {
  display: grid;
  gap: 7px;
  margin-top: 2px;
}

.trait-tier-roadmap h4 {
  margin: 0;
  color: #efe0ad;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.trait-tier-row {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(151, 184, 211, 0.14);
  border-radius: 7px;
  background: rgba(4, 8, 6, 0.36);
}

.trait-tier-row.is-active {
  border-color: color-mix(in srgb, var(--trait-color, #d7a94a) 48%, rgba(98, 234, 208, 0.22));
  background: color-mix(in srgb, var(--trait-color, #d7a94a) 10%, rgba(4, 8, 6, 0.44));
}

.trait-tier-row.is-next {
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--trait-color, #d7a94a) 72%, #fff8e8);
}

.trait-tier-row-head,
.trait-tier-row-body {
  display: grid;
  grid-template-columns: minmax(0, 0.48fr) minmax(0, 1fr);
  gap: 8px;
}

.trait-tier-row-head {
  align-items: center;
}

.trait-tier-row-head strong {
  color: #fff8e8;
  font-size: 0.74rem;
}

.trait-tier-row-head span,
.trait-tier-row-body em {
  color: var(--muted);
  font-size: 0.64rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.trait-tier-row-body > div {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}

.trait-requirement--complete {
  border-color: rgba(98, 234, 208, 0.35);
  color: #9ff7ff;
}

.trait-requirement--missing {
  color: rgba(255, 248, 232, 0.75);
}

.trait-tower-list {
  color: var(--muted);
  font-size: 0.72rem;
}

.tower-trait-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.tower-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-width: 0;
}

.tower-trait-list--compact {
  flex: 1 1 auto;
  flex-wrap: nowrap;
  overflow: hidden;
}

.tower-trait-chip--compact {
  max-width: 86px;
  min-height: 17px;
  padding: 2px 5px;
  overflow: hidden;
  font-size: 0.54rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tower-trait-chip--compact .trait-chip-icon {
  width: 13px;
  height: 13px;
  margin-inline-end: 3px;
}

.tower-trait-chip--icon-only {
  width: 22px;
  justify-content: center;
  padding-inline: 3px;
}

.tower-trait-chip--icon-only .trait-chip-icon {
  width: 15px;
  height: 15px;
  margin-inline-end: 0;
}

.tower-trait-chip--more {
  flex: 0 0 auto;
  border-color: rgba(255, 248, 232, 0.18);
  background: rgba(255, 248, 232, 0.06);
  color: var(--muted);
}

@media (max-width: 760px) {
  .augment-choice-grid,
  .augment-book-list,
  .traits-card-grid {
    grid-template-columns: 1fr;
  }

  .trait-summary-preview {
    max-width: 62vw;
  }

  .traits-element-tools {
    grid-template-columns: 1fr;
  }

  .element-matchup-board {
    min-height: 280px;
  }

  .element-matchup-node {
    width: 108px;
    min-height: 58px;
    padding-inline: 6px;
  }

  .element-matchup-main {
    grid-template-columns: 20px minmax(0, 1fr) 31px;
  }

  .element-matchup-node strong {
    font-size: 0.66rem;
  }

  .element-matchup-node em {
    min-width: 30px;
    font-size: 0.66rem;
  }

  .element-matchup-target {
    max-width: 36px;
    font-size: 0.52rem;
  }

  .trait-tier-row-head,
  .trait-tier-row-body {
    grid-template-columns: 1fr;
  }

  .traits-panel-header {
    display: grid;
  }

  .traits-panel-actions {
    justify-content: stretch;
  }

  .traits-panel-actions .mode-button {
    flex: 1 1 120px;
  }

  .reference-rarity-grid,
  .reference-trait-grid,
  .reference-tier {
    grid-template-columns: 1fr;
  }

  .unit-stat-block .reference-unit-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .augment-panel,
  .augment-book-panel,
  .traits-panel {
    padding: 16px;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(5, 9, 8, 0.1), rgba(5, 9, 8, 0.58) 42%, rgba(5, 9, 8, 0.86)),
    radial-gradient(circle at 18% 16%, rgba(98, 234, 208, 0.11), transparent 30%),
    linear-gradient(180deg, rgba(255, 240, 190, 0.03), transparent 42%),
    url("assets/menu-anime-arena-bg.jpg?v=20260519-menu-refresh1") center top / cover no-repeat,
    #050908;
  color: var(--text);
}

body.page-auth .account-panel,
body.page-auth .game-only,
body.page-auth .game-area,
body.page-menu .auth-panel,
body.page-menu .game-only,
body.page-menu .game-area {
  display: none !important;
}

body.page-game .auth-panel,
body.page-game .account-panel {
  display: none !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 20%, rgba(98, 234, 208, 0.12), transparent 18%),
    radial-gradient(circle at 72% 64%, rgba(215, 169, 74, 0.08), transparent 22%),
    linear-gradient(115deg, transparent 0 48%, rgba(215, 169, 74, 0.04) 49%, transparent 50% 100%);
  background-size: auto, auto, 220px 220px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.78), transparent 74%);
}

button {
  font: inherit;
}

.text-input {
  width: 100%;
  min-height: 40px;
  margin-bottom: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.035), rgba(0, 0, 0, 0)),
    rgba(7, 11, 9, 0.78);
  color: var(--text);
  outline: none;
}

.text-input:focus {
  border-color: rgba(102, 242, 230, 0.72);
  box-shadow: var(--glow);
}

.shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(290px, 330px) 1fr;
  min-height: 100vh;
}

body.match-active {
  overflow: hidden;
}

body.match-active .shell {
  grid-template-columns: minmax(250px, 292px) minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
}

body:not(.is-authenticated) .shell {
  display: grid;
  grid-template-columns: minmax(720px, 1080px);
  justify-content: center;
  align-content: center;
  padding: 32px;
}

body:not(.is-authenticated) .sidebar {
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(430px, 1.08fr);
  align-items: center;
  gap: clamp(20px, 3vw, 34px);
  max-height: none;
  padding: clamp(24px, 3.2vw, 40px);
  border: 1px solid rgba(95, 197, 225, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(2, 14, 24, 0.5), rgba(5, 31, 45, 0.32) 52%, rgba(1, 8, 15, 0.54)),
    radial-gradient(circle at 18% 18%, rgba(80, 205, 232, 0.12), transparent 36%),
    rgba(2, 12, 19, 0.34);
  box-shadow: 0 28px 84px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(139, 222, 242, 0.1);
  backdrop-filter: blur(8px) saturate(1.05);
}

body.is-authenticated:not(.match-active) .shell {
  grid-template-columns: minmax(0, 1180px);
  justify-content: center;
  padding: 28px;
}

body.is-authenticated:not(.match-active) .sidebar {
  display: grid;
  grid-template-columns: minmax(230px, 290px) minmax(0, 1fr);
  align-content: start;
  gap: 20px;
  min-height: calc(100vh - 56px);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

body.is-authenticated:not(.match-active) .brand {
  align-self: start;
}

body.is-authenticated:not(.match-active) .account-panel {
  min-height: calc(100vh - 96px);
}

body.is-authenticated:not(.match-active) .tab-pane.active {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

body.is-authenticated:not(.match-active) #matchmakingTab.active,
body.is-authenticated:not(.match-active) #adminTab.active,
body.is-authenticated:not(.match-active) #notificationsTab.active {
  grid-template-columns: 1fr;
}

body.is-authenticated:not(.match-active) #saveSettingsButton {
  width: auto;
  min-width: 190px;
  padding: 0 22px;
  justify-self: start;
  align-self: start;
}

body.is-authenticated:not(.match-active) .admin-output {
  max-height: none;
  min-height: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(33, 38, 31, 0.92), rgba(8, 13, 10, 0.9)),
    linear-gradient(90deg, rgba(215, 169, 74, 0.12), transparent 22%),
    rgba(10, 14, 12, 0.9);
  border-right: 1px solid var(--line);
  overflow: auto;
}

body.match-active .sidebar {
  max-height: 100vh;
  gap: 10px;
  padding: 12px;
}

body.match-active .brand {
  padding-bottom: 6px;
}

body.match-active .brand h1 {
  max-width: 11ch;
  font-size: clamp(2rem, 3.2vw, 2.8rem);
}

body.match-active .subtitle {
  margin-top: 8px;
  font-size: 0.9rem;
  line-height: 1.35;
}

body.match-active .panel {
  padding: 10px;
}

body.match-active .choice-button {
  min-height: 46px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 7px 9px;
}

body.match-active .choice-icon {
  width: 34px;
  height: 34px;
}

body.match-active .choice-desc {
  font-size: 0.72rem;
}

.tutorial-coach {
  position: fixed;
  top: 112px;
  right: 28px;
  z-index: 110;
  width: min(460px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid rgba(242, 184, 75, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(31, 34, 24, 0.99), rgba(8, 13, 10, 0.99)),
    rgba(10, 14, 12, 0.96);
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.78), 0 0 0 1px rgba(255, 255, 255, 0.07) inset, 0 0 48px rgba(242, 184, 75, 0.18);
  color: var(--text);
}

body.tutorial-active::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.24), transparent 34%, rgba(0, 0, 0, 0.16)),
    rgba(0, 0, 0, 0.2);
}

.tutorial-coach-header,
.tutorial-coach-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tutorial-coach-header span {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.tutorial-coach h2 {
  margin: 12px 0 8px;
  font-size: 1.42rem;
}

.tutorial-coach p {
  margin: 0;
  color: #f2ead4;
  line-height: 1.5;
}

.tutorial-requirement {
  min-height: 22px;
  margin-top: 12px !important;
  color: #f2b84b !important;
  font-weight: 800;
}

.tutorial-requirement.is-done {
  color: #6ee7a8 !important;
}

.tutorial-coach-actions {
  margin-top: 16px;
}

.tutorial-focus {
  position: relative;
  z-index: 95;
  outline: 3px solid rgba(242, 184, 75, 0.98);
  outline-offset: 6px;
  box-shadow: 0 0 0 9px rgba(242, 184, 75, 0.16), 0 0 46px rgba(242, 184, 75, 0.38);
  filter: saturate(1.14) brightness(1.08);
}

body.tutorial-active .tutorial-focus {
  animation: tutorialFocusPulse 1.6s ease-in-out infinite;
}

@keyframes tutorialFocusPulse {
  0%,
  100% {
    outline-color: rgba(242, 184, 75, 0.78);
    box-shadow: 0 0 0 8px rgba(242, 184, 75, 0.12), 0 0 34px rgba(242, 184, 75, 0.24);
  }
  50% {
    outline-color: rgba(255, 230, 151, 1);
    box-shadow: 0 0 0 12px rgba(242, 184, 75, 0.2), 0 0 58px rgba(242, 184, 75, 0.46);
  }
}

@media (max-width: 980px) {
  .tutorial-coach {
    top: auto;
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }
}

body.mobile-ui.tutorial-active .tutorial-coach {
  top: calc(env(safe-area-inset-top) + 146px);
  right: 10px;
  bottom: auto;
  left: 10px;
  width: auto;
  max-height: min(238px, 34dvh);
  padding: 12px;
  overflow: auto;
  border-radius: 10px;
}

body.mobile-ui.tutorial-active #gameCanvas {
  margin-top: 230px;
}

body.mobile-ui.tutorial-active .tower-game-canvas,
body.mobile-ui.tutorial-active .dynamic-game-canvas,
body.mobile-ui.tutorial-active .placement-preview-canvas {
  top: 230px;
}

body.mobile-ui.tutorial-active[data-tutorial-coach="bottom"] .tutorial-coach {
  top: auto;
  bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom) + 10px);
  max-height: min(260px, 36dvh);
}

body.mobile-ui.tutorial-active[data-tutorial-coach="augment"] .tutorial-coach {
  z-index: 132;
}

body.mobile-ui.tutorial-active[data-tutorial-coach="augment"].augment-choice-active .tutorial-coach {
  top: calc(env(safe-area-inset-top) + 8px);
  bottom: auto;
  max-height: 132px;
  pointer-events: none;
}

body.mobile-ui.tutorial-active[data-tutorial-coach="augment"]:not(.augment-choice-active) .tutorial-coach {
  top: auto;
  bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom) + 10px);
  max-height: min(260px, 36dvh);
}

body.mobile-ui.tutorial-active[data-tutorial-coach="augment"] .augment-overlay {
  z-index: 124;
  place-items: center;
  align-content: center;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 150px) 10px calc(env(safe-area-inset-bottom) + 10px);
  overflow: auto;
}

body.mobile-ui.tutorial-active[data-tutorial-coach="augment"] .augment-panel {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100vw - 48px));
  max-height: min(50dvh, calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 210px));
  overflow: auto;
}

body.mobile-ui.tutorial-active .tutorial-coach-header {
  gap: 8px;
}

body.mobile-ui.tutorial-active .tutorial-coach-header span {
  font-size: 0.64rem;
}

body.mobile-ui.tutorial-active .tutorial-coach h2 {
  margin: 8px 0 5px;
  font-size: 1rem;
  line-height: 1.1;
}

body.mobile-ui.tutorial-active .tutorial-coach p {
  font-size: 0.72rem;
  line-height: 1.32;
}

body.mobile-ui.tutorial-active .tutorial-requirement {
  min-height: 16px;
  margin-top: 7px !important;
}

body.mobile-ui.tutorial-active .tutorial-coach-actions {
  gap: 8px;
  margin-top: 9px;
}

body.mobile-ui.tutorial-active .tutorial-coach-actions .mode-button,
body.mobile-ui.tutorial-active .tutorial-coach-actions .primary-button {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.72rem;
}

body.mobile-ui.tutorial-active .tutorial-focus {
  outline-width: 2px;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(242, 184, 75, 0.14), 0 0 28px rgba(242, 184, 75, 0.34);
}

.brand {
  padding: 4px 0 12px;
}

.brand h1,
.panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  max-width: 12ch;
  color: #fff4d5;
  text-shadow: 0 12px 34px rgba(0, 0, 0, 0.68), 0 0 24px rgba(215, 169, 74, 0.18);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 0.96;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.subtitle {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.panel {
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.075), rgba(0, 0, 0, 0)),
    radial-gradient(circle at 100% 0, rgba(98, 234, 208, 0.08), transparent 34%),
    linear-gradient(90deg, rgba(215, 169, 74, 0.055), transparent 18% 82%, rgba(98, 234, 208, 0.035)),
    var(--panel);
  border: 1px solid rgba(215, 169, 74, 0.24);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 240, 190, 0.08), inset 0 -1px 0 rgba(0, 0, 0, 0.42), var(--shadow);
  backdrop-filter: blur(12px);
}

.auth-panel {
  display: grid;
  gap: 12px;
  padding: clamp(18px, 2.2vw, 26px);
  background:
    radial-gradient(circle at 18% 0, rgba(84, 211, 242, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(17, 76, 101, 0.22), rgba(215, 169, 74, 0.06) 46%, rgba(2, 10, 17, 0.28)),
    rgba(2, 14, 22, 0.36);
  border-color: rgba(95, 197, 225, 0.38);
  box-shadow: inset 0 1px 0 rgba(180, 238, 252, 0.14), 0 18px 54px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(4px) saturate(1.04);
}

.auth-panel .panel-title {
  margin-bottom: 0;
}

.auth-intro,
.auth-help {
  margin: 0;
  color: #d6e8e9;
  line-height: 1.42;
}

.auth-intro {
  padding: 10px 11px;
  border: 1px solid rgba(95, 197, 225, 0.2);
  border-radius: 8px;
  background: rgba(2, 20, 31, 0.26);
  font-weight: 720;
}

.auth-help {
  color: rgba(216, 232, 233, 0.78);
  font-size: 0.82rem;
}

.guest-play-button {
  min-height: 54px;
  font-size: 1.02rem;
}

.auth-help--guest {
  margin-top: -4px;
  color: rgba(202, 244, 235, 0.84);
}

.auth-separator {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: rgba(216, 232, 233, 0.62);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-separator::before,
.auth-separator::after {
  content: "";
  height: 1px;
  background: rgba(216, 232, 233, 0.18);
}

.auth-field {
  display: grid;
  gap: 5px;
}

.auth-field > span {
  color: #f1dba4;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-field .text-input {
  margin-bottom: 0;
}

.auth-requirements {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-requirements li {
  position: relative;
  min-height: 24px;
  padding: 5px 8px 5px 28px;
  border: 1px solid rgba(255, 240, 190, 0.12);
  border-radius: 7px;
  background: rgba(2, 13, 19, 0.3);
  color: rgba(255, 248, 232, 0.72);
  font-size: 0.78rem;
  font-weight: 760;
}

.auth-requirements li::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 9px;
  height: 9px;
  border: 1px solid currentColor;
  border-radius: 50%;
  transform: translateY(-50%);
}

.auth-requirements li.is-valid {
  border-color: rgba(98, 234, 208, 0.34);
  background: rgba(10, 48, 42, 0.48);
  color: #9ff7df;
}

.auth-requirements li.is-valid::before {
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.mini-log[data-tone="warning"] {
  color: #ffd37a;
}

.mini-log[data-tone="success"] {
  color: #9ff7df;
}

body.page-auth .brand {
  align-self: stretch;
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 4px clamp(18px, 3vw, 28px) 4px 0;
  border-right: 1px solid rgba(95, 197, 225, 0.18);
  border-bottom: 0;
}

body.page-auth .brand h1 {
  max-width: 11ch;
  color: #f7fbff;
  text-shadow: 0 14px 42px rgba(0, 0, 0, 0.74), 0 0 26px rgba(80, 205, 232, 0.2);
}

body.page-auth .subtitle {
  color: #c8d8d8;
}

.game-only {
  display: none;
}

body.match-active .game-only {
  display: block;
}

body.desktop-ui.match-active .mobile-top-bar,
body.desktop-ui.match-active .mobile-bottom-nav,
body.desktop-ui.match-active .mobile-bottom-sheet-header,
body.desktop-ui.match-active .mobile-placement-toolbar,
body.desktop-ui.match-active .mobile-augments-panel,
body.desktop-ui.match-active .mobile-players-panel {
  display: none !important;
}

.game-only[hidden] {
  display: none !important;
}

.panel h2 {
  font-size: 1rem;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-title span {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.class-grid,
.tower-list,
.barracks,
.bench-list {
  display: grid;
  gap: 8px;
}

.tower-list,
.barracks {
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.class-grid {
  grid-template-columns: 1fr;
}

.choice-button {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.06), rgba(0, 0, 0, 0)),
    linear-gradient(135deg, rgba(98, 234, 208, 0.075), rgba(215, 169, 74, 0.05)),
    rgba(8, 13, 10, 0.82);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.choice-button::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(215, 169, 74, 0.24), transparent 28% 68%, rgba(98, 234, 208, 0.16)),
    radial-gradient(circle at 16% 26%, rgba(255, 248, 220, 0.18), transparent 24%);
  opacity: 0;
  transition: opacity 150ms ease;
}

.choice-button:hover,
.choice-button.active {
  border-color: rgba(215, 169, 74, 0.72);
  background:
    linear-gradient(135deg, rgba(215, 169, 74, 0.14), rgba(98, 234, 208, 0.08)),
    rgba(18, 29, 22, 0.94);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(215, 169, 74, 0.28), 0 0 22px rgba(98, 234, 208, 0.08), 0 12px 30px rgba(0, 0, 0, 0.26);
}

.choice-button:hover::after,
.choice-button.active::after {
  opacity: 1;
}

body.match-active .shop-card:hover {
  transform: none;
}

.choice-button:disabled {
  color: #697488;
  cursor: not-allowed;
  opacity: 0.6;
}

.choice-button.is-pending,
.choice-button.is-buy-pulse {
  border-color: rgba(255, 218, 126, 0.88);
  opacity: 1;
  transform: translateY(-1px) scale(0.985);
  box-shadow:
    0 0 0 1px rgba(255, 218, 126, 0.34),
    0 0 24px rgba(255, 188, 76, 0.22),
    inset 0 0 22px rgba(98, 234, 208, 0.08);
}

.unit-shop-card.is-pending {
  cursor: wait;
}

.shop-card.is-pending {
  cursor: wait;
}

.shop-card.is-pending::after,
.shop-card.is-buy-pulse::after {
  opacity: 1;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 220, 126, 0.3), transparent 22%),
    radial-gradient(circle at 50% 48%, rgba(98, 234, 208, 0.18), transparent 38%),
    linear-gradient(120deg, transparent 12%, rgba(255, 248, 232, 0.1) 42%, transparent 64%);
  animation: shopPurchaseWash 720ms ease-in-out infinite;
}

.shop-card.is-pending .choice-icon,
.shop-card.is-buy-pulse .choice-icon,
.unit-shop-card.is-pending .choice-icon {
  animation: shopPurchaseIcon 720ms ease-in-out infinite;
}

.shop-card.is-pending .choice-main,
.shop-card.is-pending .choice-cost,
.shop-card.is-buy-pulse .choice-main,
.shop-card.is-buy-pulse .choice-cost {
  opacity: 0.28;
  transform: translateY(4px) scale(0.98);
  transition: opacity 140ms ease, transform 140ms ease;
}

.shop-card.is-replacing,
.unit-shop-card.is-replacing {
  animation: shopCardDealIn 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.shop-card.is-refilled,
.unit-shop-card.is-refilled {
  border-color: rgba(98, 234, 208, 0.96);
  box-shadow:
    0 0 0 1px rgba(98, 234, 208, 0.44),
    0 0 28px rgba(98, 234, 208, 0.24),
    0 0 36px rgba(255, 218, 126, 0.16),
    inset 0 0 26px rgba(98, 234, 208, 0.12);
  animation: shopCardRefillPop 580ms cubic-bezier(0.16, 1, 0.3, 1);
}

.shop-card.is-refilled::after,
.unit-shop-card.is-refilled::after {
  opacity: 1;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 248, 232, 0.3), transparent 18%),
    linear-gradient(105deg, transparent 8%, rgba(98, 234, 208, 0.34) 32%, rgba(255, 218, 126, 0.24) 48%, transparent 68%);
  animation: shopRefillSweep 580ms ease-out 1;
}

.shop-card.is-refilled .choice-icon,
.unit-shop-card.is-refilled .choice-icon {
  animation: shopRefillIconPop 580ms cubic-bezier(0.16, 1, 0.3, 1);
}

.shop-card-loader {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  overflow: hidden;
  opacity: 0;
  transition: opacity 120ms ease;
  pointer-events: none;
}

.shop-card-loader::before {
  content: "";
  position: absolute;
  width: 46px;
  height: 46px;
  border: 2px solid rgba(255, 230, 160, 0.58);
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 248, 232, 0.28) 0 10%, transparent 11% 100%),
    conic-gradient(from 0deg, transparent, rgba(98, 234, 208, 0.82), rgba(255, 208, 93, 0.92), transparent 74%);
  box-shadow:
    0 0 24px rgba(255, 204, 84, 0.28),
    inset 0 0 18px rgba(98, 234, 208, 0.2);
  animation: shopPurchasePortal 760ms cubic-bezier(0.45, 0, 0.2, 1) infinite;
}

.shop-card-loader::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #fff4c8;
  box-shadow:
    -22px -15px 0 -1px rgba(98, 234, 208, 0.9),
    21px -12px 0 -1px rgba(255, 202, 87, 0.92),
    -16px 17px 0 -1px rgba(255, 248, 232, 0.78),
    18px 18px 0 -2px rgba(98, 184, 255, 0.86);
  animation: shopPurchaseSparks 760ms ease-in-out infinite;
}

.shop-card.is-pending .shop-card-loader,
.shop-card.is-buy-pulse .shop-card-loader,
.unit-shop-card.is-pending .shop-card-loader {
  opacity: 1;
}

@keyframes shopPurchaseWash {
  0% {
    transform: translateX(-18%) skewX(-10deg);
    opacity: 0.55;
  }

  50% {
    transform: translateX(14%) skewX(-10deg);
    opacity: 0.95;
  }

  100% {
    transform: translateX(28%) skewX(-10deg);
    opacity: 0.55;
  }
}

@keyframes shopPurchasePortal {
  0% {
    opacity: 0.65;
    transform: rotate(0deg) scale(0.72);
  }

  50% {
    opacity: 1;
    transform: rotate(180deg) scale(1);
  }

  100% {
    opacity: 0.65;
    transform: rotate(360deg) scale(0.72);
  }
}

@keyframes shopPurchaseSparks {
  0%,
  100% {
    opacity: 0;
    transform: rotate(0deg) scale(0.72);
  }

  45% {
    opacity: 1;
    transform: rotate(22deg) scale(1);
  }

  70% {
    opacity: 0.62;
    transform: rotate(44deg) scale(1.18);
  }
}

@keyframes shopPurchaseIcon {
  0%,
  100% {
    filter: brightness(0.78) saturate(0.9);
    transform: translateY(0) scale(0.96);
  }

  50% {
    filter: brightness(1.28) saturate(1.18);
    transform: translateY(-4px) scale(1.04);
  }
}

@keyframes shopCardDealIn {
  0% {
    opacity: 0;
    filter: brightness(1.35) saturate(1.2);
    transform: translateY(12px) scale(0.94) rotateX(10deg);
  }

  58% {
    opacity: 1;
    filter: brightness(1.18) saturate(1.08);
    transform: translateY(-2px) scale(1.018) rotateX(0deg);
  }

  100% {
    opacity: 1;
    filter: brightness(1) saturate(1);
    transform: translateY(0) scale(1) rotateX(0deg);
  }
}

@keyframes shopCardRefillPop {
  0% {
    filter: brightness(1.45) saturate(1.25);
    transform: translateY(0) scale(0.985);
  }

  44% {
    filter: brightness(1.22) saturate(1.12);
    transform: translateY(-3px) scale(1.018);
  }

  100% {
    filter: brightness(1) saturate(1);
    transform: translateY(0) scale(1);
  }
}

@keyframes shopRefillSweep {
  0% {
    opacity: 0;
    transform: translateX(-46%) skewX(-12deg);
  }

  35% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateX(42%) skewX(-12deg);
  }
}

@keyframes shopRefillIconPop {
  0% {
    filter: brightness(1.5) saturate(1.24);
    transform: translateY(0) scale(0.94);
  }

  50% {
    filter: brightness(1.2) saturate(1.12);
    transform: translateY(-5px) scale(1.08);
  }

  100% {
    filter: brightness(1) saturate(1);
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .shop-card.is-pending .choice-icon,
  .shop-card.is-buy-pulse .choice-icon,
  .unit-shop-card.is-pending .choice-icon,
  .shop-card.is-replacing,
  .unit-shop-card.is-replacing,
  .shop-card.is-refilled,
  .unit-shop-card.is-refilled,
  .shop-card.is-refilled::after,
  .unit-shop-card.is-refilled::after,
  .shop-card.is-refilled .choice-icon,
  .unit-shop-card.is-refilled .choice-icon,
  .shop-card-loader::before,
  .shop-card-loader::after {
    animation: none;
  }
}

.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -2px 0 10px;
}

.shop-action {
  min-height: 32px;
  padding-inline: 12px;
  white-space: nowrap;
}

.shop-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.tower-shop-header {
  align-items: center;
}

.tower-shop-header .odds-preview {
  justify-content: flex-start;
}

.tower-shop-header .shop-actions {
  margin-top: 0;
}

.shop-lock-button {
  min-width: 34px;
  padding-inline: 8px;
}

.shop-lock-button .shop-lock-icon::before {
  content: "\1F513";
}

.shop-lock-button.is-locked {
  border-color: rgba(242, 184, 75, 0.7);
  color: var(--gold);
  box-shadow: 0 0 0 1px rgba(242, 184, 75, 0.18);
}

.shop-lock-button.is-locked .shop-lock-icon::before {
  content: "\1F512";
}

.tower-shop-header .odds-pill span {
  color: inherit;
  font-size: inherit;
  white-space: nowrap;
}

.icon-action {
  flex: 0 0 auto;
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: auto;
  min-width: 48px;
  padding-inline: 9px;
  font-size: 0.82rem;
}

.icon-action > span:first-child {
  font-size: 1rem;
  line-height: 1;
}

.action-cost {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
}

.shop-action.is-too-expensive:disabled {
  border-color: rgba(160, 166, 158, 0.22);
  background:
    linear-gradient(180deg, rgba(230, 230, 220, 0.025), transparent),
    rgba(18, 20, 18, 0.72);
  color: rgba(205, 211, 202, 0.46);
  filter: grayscale(0.75) saturate(0.55);
  opacity: 0.68;
  box-shadow: none;
}

.shop-action.is-too-expensive:disabled .action-cost {
  color: rgba(205, 211, 202, 0.58);
}

.shop-toolbar-label {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.odds-preview {
  min-width: 0;
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--muted);
}

.odds-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 3px 6px;
  border: 1px solid color-mix(in srgb, var(--rarity-color, var(--gold)) 44%, rgba(255, 240, 190, 0.14));
  border-radius: 999px;
  background: color-mix(in srgb, var(--rarity-color, var(--gold)) 12%, rgba(5, 9, 7, 0.7));
  color: color-mix(in srgb, var(--rarity-color, var(--gold)) 72%, #fff8e8);
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.odds-pill strong {
  color: #fff8e8;
  font-size: 0.7rem;
}

.odds-pill.is-low-odds {
  border-style: dashed;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rarity-color, var(--gold)) 24%, transparent);
}

.shop-card {
  border-color: color-mix(in srgb, var(--rarity-color, var(--line)) 56%, var(--line));
  box-shadow:
    inset 4px 0 0 var(--rarity-color),
    inset 0 1px 0 color-mix(in srgb, var(--rarity-color) 28%, transparent);
}

.power-box-card {
  --rarity-color: #d7a94a;
  border-color: rgba(242, 184, 75, 0.46);
  background:
    radial-gradient(circle at 18% 12%, rgba(98, 234, 208, 0.16), transparent 34%),
    linear-gradient(145deg, rgba(58, 39, 8, 0.9), rgba(8, 15, 12, 0.94));
}

.power-box-card .choice-main {
  display: grid;
  gap: 5px;
}

.power-box-card.is-bench-full {
  border-color: rgba(255, 111, 111, 0.42);
}

.power-box-icon,
.power-icon {
  border-color: color-mix(in srgb, var(--power-color, #d7a94a) 58%, rgba(255, 248, 232, 0.2));
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.24), transparent 30%),
    linear-gradient(145deg, color-mix(in srgb, var(--power-color, #d7a94a) 34%, rgba(14, 21, 16, 0.96)), rgba(5, 8, 7, 0.96));
  color: #fff8e8;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 220, 0.16),
    inset 0 -8px 18px rgba(0, 0, 0, 0.38),
    0 0 18px color-mix(in srgb, var(--power-color, #d7a94a) 24%, transparent);
}

.power-box-icon {
  --power-color: #d7a94a;
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 38% 22%, rgba(255, 255, 255, 0.16), transparent 30%),
    rgba(5, 8, 7, 0.96);
}

.power-icon--image {
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 38% 22%, rgba(255, 255, 255, 0.16), transparent 30%),
    rgba(5, 8, 7, 0.96);
}

.power-box-icon img,
.power-icon img,
.power-wheel-token img,
.power-wheel-center img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.shop-match-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  max-width: calc(100% - 12px);
  padding: 2px 6px;
  border: 1px solid rgba(115, 191, 255, 0.38);
  border-radius: 999px;
  background: rgba(4, 8, 8, 0.84);
  color: #bde6ff;
  font-size: 0.62rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 0 10px rgba(115, 191, 255, 0.16);
  pointer-events: none;
}

.shop-match-badge.is-owned-total {
  border-color: rgba(98, 234, 208, 0.78);
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.14), transparent),
    rgba(6, 20, 17, 0.94);
  color: #eafff7;
  box-shadow: 0 0 16px rgba(98, 234, 208, 0.34);
}

.shop-decision-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.shop-decision-row--plan {
  align-items: center;
}

.shop-decision-row--combat {
  align-items: center;
  min-height: 21px;
}

.tower-shop-floating-badges {
  display: contents;
}

.shop-decision-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid rgba(255, 240, 190, 0.16);
  border-radius: 999px;
  background: rgba(4, 8, 7, 0.44);
  color: rgba(255, 248, 232, 0.78);
  font-size: 0.62rem;
  font-weight: 950;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-decision-badge .income-icon,
.shop-decision-icon {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
}

.shop-decision-badge .income-icon svg {
  display: none;
}

.shop-decision-symbol {
  display: inline-grid;
  place-items: center;
  color: currentColor;
  font-size: 0.62rem;
  font-weight: 950;
  line-height: 1;
}

.shop-decision-symbol svg {
  display: block;
  width: 100%;
  height: 100%;
}

.shop-decision-badge--power {
  border-color: rgba(98, 234, 208, 0.58);
  background: rgba(5, 35, 28, 0.66);
  color: #cffff4;
}

.shop-decision-badge--damage {
  border-color: rgba(255, 214, 118, 0.58);
  background: rgba(53, 34, 7, 0.64);
  color: #ffe9a6;
}

.shop-decision-badge--area {
  border-color: rgba(255, 142, 105, 0.56);
  background: rgba(55, 18, 7, 0.62);
  color: #ffd1bd;
}

.shop-decision-badge--dot {
  border-color: rgba(139, 232, 112, 0.54);
  background: rgba(18, 46, 13, 0.62);
  color: #d7ffc4;
}

.shop-decision-badge--control {
  border-color: rgba(137, 211, 255, 0.58);
  background: rgba(8, 33, 55, 0.64);
  color: #cdeeff;
}

.shop-decision-badge--income {
  border-color: rgba(112, 224, 126, 0.52);
  background: rgba(6, 38, 14, 0.58);
  color: #c9ffd0;
}

.shop-decision-badge--progress,
.shop-decision-badge--trait {
  border-color: rgba(242, 184, 75, 0.5);
  background: rgba(55, 35, 6, 0.56);
  color: #ffe6a0;
}

.shop-decision-badge--trait {
  border-color: color-mix(in srgb, var(--shop-tag-color, #d7a94a) 52%, rgba(255, 240, 190, 0.14));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--shop-tag-color, #d7a94a) 14%, transparent), transparent 72%),
    color-mix(in srgb, var(--shop-tag-color, #d7a94a) 12%, rgba(18, 11, 3, 0.68));
  color: color-mix(in srgb, var(--shop-tag-color, #d7a94a) 72%, #fff8e8);
}

.shop-decision-badge--info {
  border-color: rgba(98, 184, 255, 0.46);
  background: rgba(4, 25, 44, 0.58);
  color: #bde6ff;
}

.shop-decision-badge--transition {
  border-color: rgba(115, 191, 255, 0.48);
  background: rgba(4, 26, 44, 0.6);
  color: #c5e7ff;
}

.shop-decision-badge--budget {
  border-color: rgba(159, 180, 166, 0.5);
  background: rgba(22, 32, 25, 0.64);
  color: #d9eadf;
}

.shop-decision-badge--element {
  gap: 3px;
  padding-inline: 5px;
  border-color: color-mix(in srgb, var(--shop-tag-color, #78efff) 58%, rgba(255, 240, 190, 0.14));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--shop-tag-color, #78efff) 18%, transparent), transparent 72%),
    color-mix(in srgb, var(--shop-tag-color, #78efff) 15%, rgba(3, 12, 13, 0.72));
  color: color-mix(in srgb, var(--shop-tag-color, #78efff) 72%, #fff8e8);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--shop-tag-color, #78efff) 24%, transparent);
}

.shop-decision-badge--element-icon {
  justify-content: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}

.shop-decision-badge--element-icon .shop-decision-icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.58));
  transform: scale(1.08);
  transform-origin: center;
}

.shop-decision-badge--locked {
  border-color: rgba(255, 111, 111, 0.42);
  background: rgba(60, 12, 18, 0.58);
  color: #ffb7b7;
}

.rarity-common {
  --rarity-color: #9fb4a6;
}

.rarity-uncommon {
  --rarity-color: #58d68d;
}

.rarity-rare {
  --rarity-color: #66b7ff;
}

.rarity-epic {
  --rarity-color: #bd8dff;
}

.rarity-legendary {
  --rarity-color: #f2b84b;
}

.rarity-mythic {
  --rarity-color: #ff3b30;
}

.choice-button[class*="rarity-"]::before,
.bench-slot[class*="rarity-"]::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--rarity-color);
  box-shadow: 0 0 18px color-mix(in srgb, var(--rarity-color) 70%, transparent);
}

.bench-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bench-slot {
  position: relative;
  display: grid;
  min-height: 72px;
  padding: 7px;
  border: 1px solid rgba(215, 169, 74, 0.22);
  border-radius: 8px;
  background: rgba(7, 12, 9, 0.78);
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
}

.bench-slot.empty {
  cursor: default;
  opacity: 0.42;
}

.bench-slot.active {
  border-color: rgba(98, 234, 208, 0.92);
  box-shadow: 0 0 0 1px rgba(98, 234, 208, 0.36), 0 0 22px rgba(98, 234, 208, 0.18);
}

.bench-slot.level-2 {
  border-color: rgba(207, 216, 220, 0.86);
  box-shadow: inset 0 0 0 1px rgba(232, 238, 240, 0.38), 0 0 16px rgba(207, 216, 220, 0.14);
}

.bench-slot.level-3 {
  border-color: rgba(242, 184, 75, 0.96);
  box-shadow: inset 0 0 0 1px rgba(255, 235, 170, 0.5), 0 0 20px rgba(242, 184, 75, 0.22);
}

.bench-slot--power {
  border-color: color-mix(in srgb, var(--power-color, #d7a94a) 44%, rgba(255, 240, 190, 0.18));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--power-color, #d7a94a) 15%, transparent), transparent 64%),
    rgba(7, 12, 9, 0.86);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--power-color, #d7a94a) 18%, transparent);
}

.bench-slot--power::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: color-mix(in srgb, var(--power-color, #d7a94a) 78%, #fff8e8);
  box-shadow: 0 0 18px color-mix(in srgb, var(--power-color, #d7a94a) 56%, transparent);
}

.bench-slot--power.active {
  border-color: color-mix(in srgb, var(--power-color, #d7a94a) 72%, #fff8e8);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--power-color, #d7a94a) 36%, transparent),
    0 0 24px color-mix(in srgb, var(--power-color, #d7a94a) 22%, transparent);
}

.bench-slot .choice-icon {
  width: 100%;
  height: 38px;
}

.bench-slot span,
.bench-slot strong {
  overflow: hidden;
  font-size: 0.66rem;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bench-empty {
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--muted);
}

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

body.match-active .bench-slot .bench-element-badge {
  display: inline-grid !important;
  width: 20px !important;
  height: 20px !important;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--shop-tag-color, #78efff) 58%, rgba(255, 248, 232, 0.18));
  border-radius: 999px;
  background:
    radial-gradient(circle at 36% 22%, rgba(255, 255, 255, 0.28), transparent 34%),
    color-mix(in srgb, var(--shop-tag-color, #78efff) 18%, rgba(3, 10, 12, 0.9));
  box-shadow: 0 0 10px color-mix(in srgb, var(--shop-tag-color, #78efff) 30%, transparent);
}

body.match-active .bench-slot .bench-element-icon {
  display: block;
  width: 13px;
  height: 13px;
  object-fit: contain;
}

body.match-active .bench-slot .bench-tags--power {
  display: inline-flex;
  justify-content: center;
  min-width: 0;
  margin-top: 3px;
}

body.match-active .bench-slot .bench-tags--power > span {
  display: inline-flex;
  max-width: 100%;
  min-height: 18px;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--power-color, #d7a94a) 45%, rgba(255, 248, 232, 0.16));
  border-radius: 999px;
  background: color-mix(in srgb, var(--power-color, #d7a94a) 12%, rgba(4, 8, 7, 0.72));
  color: color-mix(in srgb, var(--power-color, #d7a94a) 72%, #fff8e8);
  font-size: 0.56rem;
  font-weight: 950;
  text-transform: uppercase;
}

.choice-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(215, 169, 74, 0.34);
  border-radius: 8px;
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.22), transparent 28%),
    linear-gradient(145deg, rgba(215, 169, 74, 0.22), rgba(14, 21, 16, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 248, 220, 0.14), inset 0 -8px 16px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(0, 0, 0, 0.36);
  font-size: 0.74rem;
  font-weight: 950;
}

.sprite-icon {
  position: relative;
  overflow: hidden;
  background-color: rgba(10, 15, 12, 0.9);
  background-repeat: no-repeat;
  background-position: var(--sprite-x) var(--sprite-y);
  background-size: calc(var(--sprite-cols) * 100%) calc(var(--sprite-rows) * 100%);
}

.tower-sprite {
  background-image: none;
}

.sprite-icon span {
  opacity: 0;
}

.tower-rendered-icon {
  position: relative;
  overflow: hidden;
  background-image:
    radial-gradient(circle at 40% 24%, rgba(255, 248, 220, 0.16), transparent 32%),
    linear-gradient(145deg, rgba(215, 169, 74, 0.16), rgba(7, 11, 9, 0.96)) !important;
  background-position: center !important;
  background-size: auto !important;
}

.tower-rendered-icon img {
  display: block;
  width: 122%;
  height: 122%;
  object-fit: contain;
  transform: translateY(-2%);
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.42));
  pointer-events: none;
}

.tower-premium-icon img {
  position: absolute;
  inset: 2px;
  display: block;
  box-sizing: border-box;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
  padding: 0;
  transform: none;
}

.unit-premium-icon {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 42% 24%, rgba(98, 234, 208, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(19, 44, 37, 0.82), rgba(7, 11, 9, 0.96)) !important;
  background-position: center !important;
  background-size: auto !important;
}

.unit-premium-icon img {
  position: absolute;
  inset: 2px;
  display: block;
  box-sizing: border-box;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
  padding: 0;
  transform: none;
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.42));
  pointer-events: none;
}

.choice-main {
  min-width: 0;
}

.choice-name {
  display: block;
  font-weight: 800;
}

.choice-desc {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-card .choice-desc {
  display: -webkit-box;
  line-height: 1.24;
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.choice-cost {
  color: var(--gold);
  font-size: 0.84rem;
  font-weight: 800;
}

.icon-value {
  display: inline-flex;
  align-items: center;
  justify-content: inherit;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  line-height: 1;
  white-space: nowrap;
}

.icon-value > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coin-icon {
  position: relative;
  flex: 0 0 auto;
  width: 1.05em;
  height: 1.05em;
  border: 1px solid rgba(255, 239, 158, 0.82);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.62), transparent 18%),
    radial-gradient(circle at 50% 56%, #f8cf58 0 34%, #c58d1b 66%, #7a4d0b 100%);
  box-shadow: inset 0 -2px 2px rgba(83, 48, 0, 0.55), 0 0 8px rgba(215, 169, 74, 0.28);
}

.coin-icon::after {
  content: "";
  position: absolute;
  inset: 24%;
  border: 1px solid rgba(105, 69, 8, 0.55);
  border-radius: 50%;
}

.income-icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 1.25em;
  height: 1.1em;
  background: url("assets/icons/income-economy.png") center / contain no-repeat;
  vertical-align: -0.16em;
  filter: drop-shadow(0 0 5px rgba(115, 228, 154, 0.24));
}

.income-icon svg {
  display: none;
}

.defense-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 1.08em;
  height: 1.08em;
  place-items: center;
  color: #73bfff;
  filter: drop-shadow(0 0 5px rgba(115, 191, 255, 0.26));
}

.defense-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.heart-icon {
  position: relative;
  flex: 0 0 auto;
  width: 0.66em;
  height: 0.66em;
  margin: 0.1em 0.16em 0 0.04em;
  transform: rotate(-45deg);
  background: linear-gradient(135deg, #ff8b84, #d33845 78%);
  box-shadow: 0 0 8px rgba(255, 115, 106, 0.24);
}

.heart-icon::before,
.heart-icon::after {
  content: "";
  position: absolute;
  width: 0.66em;
  height: 0.66em;
  border-radius: 50%;
  background: inherit;
}

.heart-icon::before {
  top: -0.33em;
  left: 0;
}

.heart-icon::after {
  top: 0;
  left: 0.33em;
}

.heart-icon svg {
  display: none;
}

.stat-icon-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.income-detail {
  color: var(--muted);
  font-size: 0.82em;
  font-weight: 700;
}

.primary-button {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(215, 169, 74, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(215, 169, 74, 0.28), rgba(98, 234, 208, 0.13)),
    #1b2a1f;
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  transition: transform 150ms ease, filter 150ms ease, border-color 150ms ease;
}

.primary-button:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  filter: grayscale(0.24);
  transform: none;
}

.primary-button.is-ready,
.mode-button.is-ready {
  border-color: rgba(93, 230, 155, 0.88);
  background:
    linear-gradient(180deg, rgba(127, 255, 186, 0.24), rgba(14, 101, 65, 0.34)),
    #103525;
  color: #dfffee;
  box-shadow: 0 0 0 1px rgba(127, 255, 186, 0.2), 0 12px 34px rgba(0, 0, 0, 0.34), 0 0 24px rgba(93, 230, 155, 0.18);
}

.mode-button,
.danger-button {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.035), transparent),
    rgba(9, 14, 11, 0.76);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.mode-button:hover {
  border-color: rgba(215, 169, 74, 0.58);
  background: rgba(24, 33, 24, 0.94);
  transform: translateY(-1px);
}

.mode-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

#selectedTowerPanel[data-tower-level="2"] {
  border-color: rgba(207, 216, 220, 0.68);
  box-shadow: 0 0 0 1px rgba(232, 238, 240, 0.2), 0 14px 32px rgba(207, 216, 220, 0.1);
}

#selectedTowerPanel[data-tower-level="3"] {
  border-color: rgba(242, 184, 75, 0.78);
  box-shadow: 0 0 0 1px rgba(255, 235, 170, 0.24), 0 16px 36px rgba(242, 184, 75, 0.16);
}

#upgradeTowerButton.upgrade-silver:not(:disabled) {
  border-color: rgba(207, 216, 220, 0.9);
  background:
    linear-gradient(180deg, rgba(232, 238, 240, 0.18), transparent),
    rgba(18, 24, 24, 0.94);
  color: #f4f7f8;
  box-shadow: inset 0 0 0 1px rgba(232, 238, 240, 0.24), 0 0 18px rgba(207, 216, 220, 0.16);
}

#upgradeTowerButton.upgrade-gold:not(:disabled) {
  border-color: rgba(242, 184, 75, 0.95);
  background:
    linear-gradient(180deg, rgba(242, 184, 75, 0.22), transparent),
    rgba(35, 26, 10, 0.94);
  color: #ffe9a6;
  box-shadow: inset 0 0 0 1px rgba(255, 235, 170, 0.24), 0 0 22px rgba(242, 184, 75, 0.22);
}

#upgradeTowerButton[data-upgrade-state="locked"] {
  border-color: rgba(151, 184, 211, 0.18);
  color: rgba(238, 226, 184, 0.66);
}

.mode-button.active {
  border-color: rgba(242, 184, 75, 0.75);
  background: rgba(55, 43, 20, 0.9);
  color: var(--gold);
}

.mode-button.icon-action {
  width: auto;
  min-height: 34px;
  margin-top: 0;
  padding-inline: 9px;
}

.map-select {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.map-option {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 58px;
  width: 100%;
  border: 1px solid rgba(255, 240, 190, 0.14);
  border-radius: 8px;
  background: rgba(8, 13, 11, 0.78);
  color: var(--text);
  cursor: pointer;
  padding: 7px;
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.map-option:hover {
  border-color: rgba(98, 234, 208, 0.5);
  background: rgba(16, 27, 23, 0.9);
  transform: translateY(-1px);
}

.map-option.active {
  border-color: rgba(242, 184, 75, 0.75);
  background:
    linear-gradient(180deg, rgba(242, 184, 75, 0.14), transparent 68%),
    rgba(23, 25, 15, 0.92);
}

.map-option-art {
  width: 54px;
  height: 42px;
  border-radius: 6px;
  background-color: rgba(98, 234, 208, 0.12);
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 0 1px rgba(255, 240, 190, 0.12);
}

.map-option-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.map-option-copy strong,
.map-option-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-option-copy strong {
  color: #fff8e8;
  font-size: 0.82rem;
  font-weight: 950;
}

.map-option-copy small {
  color: rgba(226, 234, 220, 0.72);
  font-size: 0.69rem;
  font-weight: 800;
}

.danger-button {
  border-color: rgba(255, 107, 107, 0.45);
  background: rgba(54, 19, 25, 0.84);
  color: #ffd8d8;
}

.danger-button:hover {
  background: #3b1d22;
}

.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.batch-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 14, 11, 0.76);
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.batch-button.active {
  border-color: rgba(215, 169, 74, 0.68);
  background: #2a2515;
  color: var(--text);
}

.barracks-panel .panel-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.barracks-panel .panel-title .batch-button {
  min-width: 34px;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1;
  opacity: 0.72;
}

.barracks-panel .panel-title .batch-button:hover,
.barracks-panel .panel-title .batch-button.active {
  opacity: 1;
}

.selected-panel strong {
  display: block;
  color: var(--text);
}

.selected-tower-stats {
  display: grid;
  gap: 5px;
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.selected-stat-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.selected-stat-row > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-stat-row--traits {
  align-items: flex-start;
}

.selected-stat-row--traits > span:last-child {
  white-space: normal;
}

.selected-stat-row--resistances {
  align-items: flex-start;
}

.selected-stat-row--resistances > span:last-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  white-space: normal;
}

.selected-stat-row--matchup {
  align-items: flex-start;
}

.selected-stat-row--matchup > span:last-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  white-space: normal;
}

.selected-stat-row--matchup-positive > span:last-child {
  color: #b9f7cf;
}

.selected-stat-row--matchup-negative > span:last-child {
  color: #ffc4bd;
}

.selected-matchup-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
}

.selected-trait-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.selected-trait-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--trait-color, #d7a94a) 44%, rgba(255, 240, 190, 0.14));
  border-radius: 999px;
  background: color-mix(in srgb, var(--trait-color, #d7a94a) 12%, rgba(0, 0, 0, 0.34));
  color: color-mix(in srgb, var(--trait-color, #d7a94a) 72%, #fff8e8);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1;
}

.selected-trait-chip .trait-chip-icon {
  width: 15px;
  height: 15px;
  margin-inline-end: 0;
}

.element-resistance-list {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
}

.element-resistance-chip {
  display: inline-grid;
  grid-template-columns: 14px minmax(3.25em, max-content);
  align-items: center;
  justify-items: center;
  gap: 4px;
  min-height: 18px;
  min-width: 58px;
  padding: 2px 5px;
  border: 1px solid color-mix(in srgb, var(--resistance-color, rgba(255, 248, 232, 0.32)) 58%, rgba(255, 248, 232, 0.12));
  border-radius: 999px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--resistance-color, #fff8e8) 17%, transparent), transparent 70%),
    rgba(0, 0, 0, 0.22);
  color: color-mix(in srgb, var(--resistance-color, #fff8e8) 72%, #fff8e8);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--resistance-color, #fff8e8) 22%, transparent);
  white-space: nowrap;
}

.element-resistance-chip--neutral {
  --resistance-color: #aab7b0;
}

.element-resistance-chip--positive-low {
  --resistance-color: #cde85c;
}

.element-resistance-chip--positive-mid {
  --resistance-color: #7ee35e;
}

.element-resistance-chip--positive-high {
  --resistance-color: #2f8a46;
}

.element-resistance-chip--positive-max {
  --resistance-color: #39ff74;
}

.element-resistance-chip--negative-low {
  --resistance-color: #ffd05c;
}

.element-resistance-chip--negative-mid {
  --resistance-color: #ff9138;
}

.element-resistance-chip--negative-high {
  --resistance-color: #ff4d45;
}

.element-resistance-chip--negative-max {
  --resistance-color: #ff174d;
}

.element-resistance-chip strong {
  min-width: 3.25em;
  margin-bottom: 0;
  color: inherit;
  text-align: center;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.selected-panel .element-resistance-chip strong,
body.match-active .selected-panel .element-resistance-chip strong {
  margin-bottom: 0;
  color: inherit;
}

.element-resistance-icon {
  width: 14px;
  height: 14px;
}

.element-resistance-overview {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 248, 232, 0.1);
  border-radius: 8px;
  background: rgba(4, 8, 6, 0.34);
}

.traits-element-resistance-summary {
  grid-column: 1 / -1;
}

.traits-element-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.28fr);
  gap: 10px;
  align-items: stretch;
}

.traits-element-tools > .traits-element-resistance-summary {
  grid-column: auto;
}

.traits-element-tools .element-resistance-overview {
  height: 100%;
  align-content: start;
}

.traits-element-tools .element-resistance-overview-grid {
  grid-template-columns: 1fr;
}

.element-resonance-panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 7px;
  min-width: 0;
}

.element-resonance-column {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(255, 248, 232, 0.1);
  border-radius: 8px;
  background: rgba(4, 8, 6, 0.34);
}

.element-resonance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.element-resonance-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.element-resonance-head span {
  flex: 0 0 auto;
  color: rgba(255, 248, 232, 0.58);
}

.element-power-overview,
.element-resonance-list {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.element-power-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 3.8em) 40px minmax(28px, 1fr) 2em;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 26px;
  padding: 3px 6px;
  border: 1px solid color-mix(in srgb, var(--trait-color, #d7a94a) 38%, rgba(255, 240, 190, 0.12));
  border-radius: 7px;
  background: color-mix(in srgb, var(--trait-color, #d7a94a) 9%, rgba(0, 0, 0, 0.32));
}

.element-collection-bonus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 38px;
  min-height: 20px;
  padding: 2px 4px;
  border: 1px solid rgba(255, 248, 232, 0.12);
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.055);
  color: rgba(255, 248, 232, 0.45);
  font-size: 0.62rem;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.element-collection-bonus small {
  color: inherit;
  font-size: 0.52rem;
  font-weight: 900;
  opacity: 0.78;
}

.element-collection-bonus.is-active {
  border-color: color-mix(in srgb, var(--trait-color, #d7a94a) 58%, rgba(98, 234, 208, 0.34));
  background: color-mix(in srgb, var(--trait-color, #d7a94a) 16%, rgba(98, 234, 208, 0.08));
  color: color-mix(in srgb, var(--trait-color, #d7a94a) 70%, #fff8e8);
}

.element-collection-bonus.is-upgraded {
  border-color: color-mix(in srgb, var(--trait-color, #d7a94a) 42%, rgba(255, 216, 118, 0.74));
  background:
    linear-gradient(135deg, rgba(255, 216, 118, 0.18), transparent 58%),
    color-mix(in srgb, var(--trait-color, #d7a94a) 22%, rgba(98, 234, 208, 0.08));
  color: #fff8e8;
}

.trait-bonus-block--collection {
  width: 100%;
}

.trait-bonus-block > .trait-bonus-note {
  flex: 1 1 180px;
  min-height: 22px;
  border-color: rgba(255, 248, 232, 0.08);
  background: rgba(255, 248, 232, 0.04);
  color: rgba(255, 248, 232, 0.68);
  line-height: 1.25;
}

.element-collection-requirements {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}

.element-collection-requirement {
  font-size: 0.66rem;
}

.element-collection-requirement.trait-requirement--upgraded {
  border-color: color-mix(in srgb, var(--trait-color, #d7a94a) 42%, rgba(255, 216, 118, 0.58));
  background: rgba(255, 216, 118, 0.09);
}

.element-power-icon,
.element-resonance-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.element-power-row strong {
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--trait-color, #d7a94a) 72%, #fff8e8);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.element-power-row em {
  color: #fff8e8;
  font-size: 0.7rem;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  text-align: right;
}

.element-power-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.08);
}

.element-power-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--trait-color, #d7a94a) 75%, #fff8e8), color-mix(in srgb, var(--trait-color, #d7a94a) 45%, #62ead0));
}

.element-resonance-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(255, 248, 232, 0.1);
  border-radius: 8px;
  background: rgba(1, 8, 10, 0.5);
}

.element-resonance-card.is-active {
  border-color: rgba(98, 234, 208, 0.28);
  background:
    linear-gradient(135deg, rgba(98, 234, 208, 0.08), transparent 52%),
    rgba(1, 8, 10, 0.56);
}

.element-resonance-card-head,
.element-resonance-effect,
.element-resonance-targets {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  min-width: 0;
}

.element-resonance-card-head strong {
  min-width: 0;
  overflow: hidden;
  color: #fff8e8;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.element-resonance-card-head > span {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid rgba(255, 248, 232, 0.12);
  border-radius: 999px;
  color: #efe0ad;
  font-size: 0.62rem;
  font-weight: 950;
  white-space: nowrap;
}

.element-resonance-pair,
.element-resonance-coverage {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.element-resonance-element {
  display: inline-grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  min-width: 78px;
  max-width: 110px;
  min-height: 26px;
  padding: 3px 6px;
  border: 1px solid color-mix(in srgb, var(--trait-color, #d7a94a) 44%, rgba(255, 240, 190, 0.14));
  border-radius: 999px;
  background: color-mix(in srgb, var(--trait-color, #d7a94a) 12%, rgba(0, 0, 0, 0.34));
}

.element-resonance-element strong {
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--trait-color, #d7a94a) 72%, #fff8e8);
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.element-resonance-element em {
  color: #fff8e8;
  font-size: 0.66rem;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
}

.element-resonance-effect {
  justify-content: flex-start;
  padding: 5px 6px;
  border: 1px solid rgba(98, 234, 208, 0.12);
  border-radius: 7px;
  background: rgba(98, 234, 208, 0.055);
}

.element-resonance-effect strong {
  color: #9ff7ff;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.element-resonance-effect--resist {
  border-color: rgba(255, 191, 92, 0.14);
  background: rgba(255, 191, 92, 0.05);
}

.element-resonance-effect--resist strong {
  color: #ffe0aa;
}

.element-resonance-effect span {
  min-width: 0;
  color: rgba(255, 248, 232, 0.74);
  font-size: 0.62rem;
  font-weight: 850;
  line-height: 1.25;
}

.element-resonance-targets {
  align-items: flex-start;
  justify-content: flex-start;
}

.element-resonance-targets em {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.6rem;
  font-style: normal;
  font-weight: 950;
  line-height: 1.5;
  text-transform: uppercase;
}

.element-resonance-coverage span {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 2px 6px;
  border: 1px solid rgba(255, 191, 92, 0.3);
  border-radius: 999px;
  background: rgba(255, 191, 92, 0.075);
  color: #ffe0aa;
  font-size: 0.6rem;
  font-weight: 950;
  line-height: 1;
}

.element-resonance-coverage span.is-major {
  border-color: rgba(255, 91, 83, 0.42);
  background: rgba(255, 91, 83, 0.075);
  color: #ffd7cd;
}

.element-matchup-graph {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 248, 232, 0.1);
  border-radius: 8px;
  background: rgba(4, 8, 6, 0.34);
}

.element-matchup-head,
.element-matchup-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.element-matchup-head strong {
  color: var(--text);
}

.element-matchup-board {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  border: 1px solid rgba(151, 184, 211, 0.1);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 248, 232, 0.055), transparent 42%),
    rgba(1, 7, 8, 0.44);
}

.element-matchup-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.element-matchup-edge {
  fill: none;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.element-matchup-edge--hard {
  stroke: rgba(255, 91, 83, 0.82);
  stroke-width: 2.1;
  marker-end: url(#elementMatchupArrowHard);
}

#elementMatchupArrowHard path {
  fill: rgba(255, 91, 83, 0.88);
}

.element-matchup-center {
  fill: rgba(255, 248, 232, 0.66);
  font: 900 6px Inter, sans-serif;
  letter-spacing: 0;
  text-transform: uppercase;
}

.element-matchup-center--sub {
  fill: rgba(196, 210, 205, 0.62);
  font-size: 4.2px;
}

.element-matchup-node {
  position: absolute;
  left: var(--node-x);
  top: var(--node-y);
  z-index: 1;
  display: grid;
  gap: 5px;
  width: 126px;
  min-height: 62px;
  padding: 6px 7px;
  border: 1px solid color-mix(in srgb, var(--trait-color, #d7a94a) 48%, rgba(255, 240, 190, 0.16));
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--trait-color, #d7a94a) 14%, transparent), transparent 76%),
    rgba(2, 10, 12, 0.9);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  color: #fff8e8;
  transform: translate(-50%, -50%);
}

.element-matchup-main {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.element-matchup-node.has-power {
  border-color: color-mix(in srgb, var(--trait-color, #d7a94a) 72%, rgba(255, 255, 255, 0.2));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--trait-color, #d7a94a) 22%, transparent),
    0 10px 24px rgba(0, 0, 0, 0.32);
}

.element-matchup-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.element-matchup-node strong {
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--trait-color, #d7a94a) 66%, #fff8e8);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.element-matchup-node em {
  display: inline-grid;
  min-width: 34px;
  min-height: 24px;
  place-items: center;
  border: 1px solid rgba(255, 248, 232, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: #fff8e8;
  font-size: 0.76rem;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
}

.element-matchup-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  min-width: 0;
}

.element-matchup-target {
  display: inline-flex;
  align-items: center;
  min-height: 17px;
  max-width: 42px;
  padding: 1px 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 248, 232, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.052);
  color: rgba(255, 248, 232, 0.78);
  font-size: 0.58rem;
  font-weight: 950;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.element-matchup-target--major {
  border-color: rgba(255, 91, 83, 0.48);
  color: #ffd7cd;
}

.element-matchup-target--minor {
  border-color: rgba(255, 191, 92, 0.38);
  color: #ffe0aa;
}

.element-matchup-target--more {
  max-width: 28px;
  color: var(--muted);
}

.element-matchup-legend {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.element-matchup-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.element-matchup-swatch {
  display: inline-block;
  width: 18px;
  height: 2px;
  border-radius: 99px;
}

.element-matchup-swatch--hard {
  background: rgba(255, 91, 83, 0.88);
}

.element-matchup-swatch--soft {
  height: 14px;
  width: 28px;
  border: 1px solid rgba(255, 191, 92, 0.38);
  border-radius: 999px;
  background: rgba(255, 191, 92, 0.11);
}

@media (max-width: 760px) {
  .traits-element-tools {
    grid-template-columns: 1fr;
  }

  .traits-element-tools > .traits-element-resistance-summary {
    grid-column: auto;
  }

  .element-resonance-panel {
    grid-template-columns: 1fr;
  }

  .element-resonance-head {
    align-items: flex-start;
  }

  .element-resonance-head span {
    white-space: normal;
    text-align: right;
  }

  .element-matchup-board {
    min-height: 280px;
  }

  .element-matchup-node {
    width: 108px;
    min-height: 58px;
    padding-inline: 6px;
  }

  .element-matchup-main {
    grid-template-columns: 20px minmax(0, 1fr) 31px;
  }

  .element-matchup-node strong {
    font-size: 0.66rem;
  }

  .element-matchup-node em {
    min-width: 30px;
    font-size: 0.66rem;
  }

  .element-matchup-target {
    max-width: 36px;
    font-size: 0.52rem;
  }
}

.element-resistance-overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--muted);
}

.element-resistance-overview-head strong {
  color: var(--text);
}

.element-resistance-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.element-resistance-overview-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2ch;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.element-resistance-overview-cell .element-resistance-chip {
  min-width: 0;
  width: 100%;
  padding-inline: 4px;
  font-size: 0.62rem;
}

.element-resistance-overview-cell em {
  color: var(--muted);
  font-size: 0.62rem;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.selected-trait-chip.is-active {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--trait-color, #d7a94a) 30%, transparent), 0 0 14px color-mix(in srgb, var(--trait-color, #d7a94a) 18%, transparent);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 12px 0 16px;
}

.tab-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 14, 11, 0.68);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.tab-button.active {
  border-color: var(--gold);
  color: var(--text);
  background: rgba(36, 38, 25, 0.92);
}

.tab-button:hover {
  color: var(--text);
  border-color: rgba(102, 242, 230, 0.45);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  color: var(--muted);
}

.volume-row {
  justify-content: space-between;
}

.volume-row span {
  flex: 0 0 auto;
  font-weight: 800;
}

.volume-row strong {
  flex: 0 0 42px;
  color: var(--text);
  font-size: 0.78rem;
  text-align: right;
}

.volume-slider {
  flex: 1 1 auto;
  min-width: 92px;
  accent-color: var(--gold);
}

.language-setting {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: fit-content;
  max-width: 100%;
  margin: 8px 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.language-setting-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.language-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 36px;
  padding: 3px;
  cursor: pointer;
  overflow: visible;
}

.language-current-button {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(255, 235, 177, 0.28);
  border-radius: 999px;
  background: rgba(7, 12, 10, 0.76);
  color: var(--text);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 6px 14px rgba(0, 0, 0, 0.18);
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.language-current-button:hover,
.language-setting.is-open .language-current-button {
  border-color: rgba(255, 235, 177, 0.68);
  background: rgba(255, 235, 177, 0.09);
  box-shadow: 0 0 0 1px rgba(102, 242, 230, 0.12), 0 8px 18px rgba(0, 0, 0, 0.24);
}

.language-current-button:focus-visible {
  outline: 2px solid rgba(102, 242, 230, 0.55);
  outline-offset: 2px;
}

.language-flag-list {
  position: absolute;
  top: 50%;
  left: calc(100% + 6px);
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  border: 1px solid rgba(255, 235, 177, 0.16);
  border-radius: 999px;
  background: rgba(7, 12, 10, 0.94);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.34);
  opacity: 0;
  pointer-events: none;
  transform: translate(-8px, -50%) scale(0.96);
  transform-origin: left center;
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
  visibility: hidden;
}

.language-setting.is-open .language-flag-list {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, -50%) scale(1);
  visibility: visible;
}

.language-flag-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 5px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.language-flag-option[hidden] {
  display: none;
}

.language-flag-option:hover,
.language-flag-option.active {
  border-color: rgba(255, 235, 177, 0.64);
  background: rgba(255, 235, 177, 0.08);
  box-shadow: 0 0 0 1px rgba(102, 242, 230, 0.1), 0 6px 14px rgba(0, 0, 0, 0.22);
}

.language-flag-option:hover {
  transform: translateY(-1px);
}

.language-flag-option:focus-visible {
  outline: 2px solid rgba(102, 242, 230, 0.55);
  outline-offset: 2px;
}

.language-flag {
  display: block;
  width: 22px;
  height: 16px;
  overflow: hidden;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3), 0 1px 3px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.language-flag--fr {
  background: linear-gradient(90deg, #1d3f8f 0 33.333%, #fff 33.333% 66.666%, #e1252f 66.666% 100%);
}

.language-flag--en {
  background:
    linear-gradient(27deg, transparent 0 41%, #fff 41% 47%, #c8102e 47% 53%, #fff 53% 59%, transparent 59% 100%),
    linear-gradient(153deg, transparent 0 41%, #fff 41% 47%, #c8102e 47% 53%, #fff 53% 59%, transparent 59% 100%),
    linear-gradient(90deg, transparent 0 36%, #fff 36% 43%, #c8102e 43% 57%, #fff 57% 64%, transparent 64% 100%),
    linear-gradient(0deg, transparent 0 33%, #fff 33% 42%, #c8102e 42% 58%, #fff 58% 67%, transparent 67% 100%),
    #012169;
}

.auth-panel .language-setting {
  margin: 0 0 12px;
}

.game-menu .language-setting {
  margin: 8px 0 4px;
}

.mini-log {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.history-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  max-height: 170px;
  overflow: auto;
}

body.is-authenticated:not(.match-active) .history-list {
  max-height: 520px;
}

.history-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 240, 190, 0.04), transparent),
    rgba(9, 14, 11, 0.72);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.history-item:hover {
  border-color: rgba(115, 191, 255, 0.36);
}

.history-item strong {
  color: var(--text);
}

.lobby-room-card {
  display: grid;
  gap: 10px;
}

.lobby-room-head,
.lobby-ready-summary,
.lobby-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lobby-room-head span {
  padding: 4px 8px;
  border: 1px solid rgba(215, 169, 74, 0.38);
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lobby-ready-summary {
  padding: 8px 10px;
  border: 1px solid rgba(93, 230, 155, 0.24);
  border-radius: 8px;
  background: rgba(9, 31, 23, 0.58);
  color: #bfead4;
}

.lobby-player-list {
  display: grid;
  gap: 6px;
}

.lobby-player {
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(3, 14, 18, 0.68);
}

.lobby-player-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.lobby-player-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.lobby-player-actions .mode-button {
  min-width: 64px;
  min-height: 30px;
  margin: 0;
  padding: 0 10px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.lobby-player.is-you {
  border-color: rgba(115, 191, 255, 0.42);
}

.lobby-player.is-ready {
  border-color: rgba(93, 230, 155, 0.48);
  background: rgba(13, 55, 37, 0.74);
}

.lobby-player.is-offline {
  opacity: 0.62;
}

.lobby-player-name {
  min-width: 0;
  color: var(--text);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.lobby-ready-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lobby-player.is-ready .lobby-ready-badge {
  border-color: rgba(93, 230, 155, 0.42);
  color: #9effc9;
}

.lobby-ready-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

body.is-authenticated:not(.match-active) .shell {
  grid-template-columns: minmax(0, 1fr);
  width: min(calc(100vw - 44px), calc((100vh - 34px) * 16 / 9), 1760px);
  height: min(calc(100vh - 48px), calc((100vw - 72px) * 9 / 16));
  aspect-ratio: 16 / 9;
  align-self: center;
  margin-inline: auto;
  min-height: 0;
  padding: 0;
}

body.is-authenticated:not(.match-active) .sidebar {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.is-authenticated:not(.match-active) .sidebar > .brand {
  display: none;
}

body.is-authenticated:not(.match-active) .launcher-panel {
  --launcher-left-x: 10.4%;
  --launcher-left-y: 16.2%;
  --launcher-left-w: 22.2%;
  --launcher-left-bottom: 9.6%;
  --launcher-main-x: 35.8%;
  --launcher-main-y: 16%;
  --launcher-main-right: 8.4%;
  --launcher-main-bottom: 9.8%;
  --launcher-frame-bleed-x: 34px;
  --launcher-frame-bleed-top: 30px;
  --launcher-frame-bleed-bottom: 22px;
  position: relative;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.is-authenticated:not(.match-active) .launcher-panel::before {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--launcher-frame-bleed-top)) calc(-1 * var(--launcher-frame-bleed-x)) calc(-1 * var(--launcher-frame-bleed-bottom));
  z-index: 1;
  pointer-events: none;
  background: url("assets/menu-arena-entrance-frame-slim.png?v=20260520-arena-frame2") center / 100% 100% no-repeat;
  opacity: 1;
}

body.is-authenticated:not(.match-active) .launcher-panel::after {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--launcher-frame-bleed-top)) calc(-1 * var(--launcher-frame-bleed-x)) calc(-1 * var(--launcher-frame-bleed-bottom));
  z-index: 0;
  pointer-events: none;
  border: 1px solid rgba(144, 219, 232, 0.12);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(2, 13, 18, 0.24), rgba(2, 13, 18, 0.08) 34%, rgba(2, 13, 18, 0.2)),
    radial-gradient(circle at 10% 92%, rgba(33, 199, 255, 0.08), transparent 16%),
    radial-gradient(circle at 92% 90%, rgba(255, 82, 45, 0.07), transparent 18%);
}

.launcher-frame {
  position: relative;
  z-index: 2;
  display: block;
  height: 100%;
  min-height: 0;
  padding: 0;
}

.launcher-nav {
  position: absolute;
  top: var(--launcher-left-y);
  bottom: var(--launcher-left-bottom);
  left: var(--launcher-left-x);
  width: var(--launcher-left-w);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: clamp(10px, 1.2vw, 16px);
  min-height: 0;
  padding: 0;
  border-right: 0;
  background: transparent;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.launcher-nav > * {
  width: min(100%, 286px);
  justify-self: center;
}

.launcher-mark {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 66px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 240, 190, 0.08);
  border-radius: 8px;
  background: rgba(1, 12, 18, 0.2);
  backdrop-filter: blur(2px);
}

.launcher-mark-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(220, 170, 77, 0.76);
  border-radius: 8px;
  background:
    radial-gradient(circle at 38% 24%, rgba(255, 248, 220, 0.28), transparent 30%),
    linear-gradient(145deg, rgba(190, 133, 33, 0.48), rgba(34, 205, 231, 0.08)),
    rgba(3, 22, 29, 0.94);
  color: #fff1c5;
  font-size: 0.82rem;
  font-weight: 950;
}

.launcher-mark strong {
  display: block;
  color: #fff4d5;
  font-size: 1.16rem;
  line-height: 1.02;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
}

.launcher-mark .eyebrow {
  margin-bottom: 2px;
  font-size: 0.66rem;
}

.profile-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 7px 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(241, 193, 93, 0.5);
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 10%, rgba(31, 202, 229, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(247, 198, 83, 0.12), rgba(0, 0, 0, 0)),
    rgba(3, 18, 24, 0.44);
  box-shadow: inset 0 1px 0 rgba(255, 245, 199, 0.08), inset 0 0 28px rgba(14, 207, 255, 0.05);
}

.profile-avatar {
  display: grid;
  grid-row: 1 / span 2;
  grid-column: 1;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 2px solid rgba(220, 170, 77, 0.86);
  border-radius: 50%;
  background:
    radial-gradient(circle at 42% 28%, rgba(255, 255, 255, 0.2), transparent 24%),
    radial-gradient(circle at 50% 70%, rgba(31, 202, 229, 0.3), transparent 42%),
    #061b25;
  color: #fff4d5;
  font-weight: 950;
  box-shadow: 0 0 22px rgba(215, 169, 74, 0.16);
}

.profile-meta {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.profile-meta h2 {
  overflow: hidden;
  color: #fff8e8;
  font-size: 1rem;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-meta span {
  display: block;
  margin-top: 4px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
}

.profile-status {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 0;
  border-top: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.profile-status strong {
  position: relative;
  color: var(--green);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.profile-status strong::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.profile-live-stats {
  grid-column: 1 / -1;
  grid-row: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-self: auto;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 240, 190, 0.12);
}

.profile-live-stats span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 240, 190, 0.1);
  border-radius: 6px;
  background: rgba(2, 13, 18, 0.28);
  text-align: left;
}

.profile-live-stats strong {
  color: #fff4d5;
  font-size: 0.92rem;
  line-height: 1;
}

.profile-live-stats small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.launcher-tabs {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: clamp(5px, 0.7vw, 8px);
  min-height: 0;
  margin: 0;
  overflow: visible;
  padding-right: 4px;
}

.launcher-tabs .tab-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: clamp(42px, 4.2vh, 50px);
  padding: 0 28px 0 40px;
  border: 2px solid rgba(226, 178, 82, 0.52);
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(236, 188, 88, 0.18), rgba(5, 24, 31, 0.58) 34%, rgba(1, 10, 14, 0.72)),
    rgba(2, 14, 20, 0.58);
  color: rgba(255, 242, 205, 0.92);
  font-size: 0.84rem;
  text-align: left;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 199, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.56),
    0 8px 18px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.launcher-tabs .tab-button[hidden] {
  display: none !important;
}

.launcher-tabs .tab-button::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(250, 212, 120, 0.72);
  background:
    linear-gradient(135deg, rgba(255, 245, 199, 0.5), transparent 28%),
    linear-gradient(135deg, #23c9e8, #0b5064);
  box-shadow: 0 0 14px rgba(35, 201, 232, 0.18);
  transform: translateY(-50%) rotate(45deg);
}

.launcher-tabs .tab-button::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 10px;
  width: 9px;
  height: 9px;
  border-top: 2px solid rgba(255, 222, 127, 0.78);
  border-right: 2px solid rgba(255, 222, 127, 0.78);
  box-shadow: 4px -4px 12px rgba(255, 222, 127, 0.22);
  transform: translateY(-50%) rotate(45deg);
}

.launcher-tabs .tab-button:hover {
  border-color: rgba(62, 218, 244, 0.68);
  background:
    linear-gradient(90deg, rgba(62, 218, 244, 0.16), rgba(9, 42, 51, 0.56) 42%, rgba(2, 15, 21, 0.66)),
    rgba(3, 28, 37, 0.54);
}

.launcher-tabs .tab-button.active {
  border-color: rgba(255, 216, 118, 0.92);
  background:
    linear-gradient(90deg, rgba(247, 198, 83, 0.42), rgba(34, 205, 231, 0.12) 48%, rgba(2, 16, 22, 0.62)),
    rgba(5, 25, 31, 0.58);
  color: #fff8e8;
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 199, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.48),
    0 0 18px rgba(220, 170, 77, 0.22);
}

.launcher-tabs .tab-button.active::before {
  background:
    linear-gradient(135deg, rgba(255, 245, 199, 0.62), transparent 28%),
    linear-gradient(135deg, #ffd36d, #b05a14);
  box-shadow: 0 0 18px rgba(255, 211, 109, 0.34);
}

.launcher-audio {
  display: grid;
  gap: 5px;
  padding: 8px 4px 0;
  border-top: 1px solid rgba(196, 145, 61, 0.18);
}

.launcher-audio .mode-button {
  min-height: 30px;
  margin-top: 0;
  font-size: 0.78rem;
}

.launcher-audio .setting-row {
  min-height: 20px;
  margin: 0;
  font-size: 0.8rem;
}

.launcher-audio .volume-row {
  gap: 6px;
}

.launcher-audio .volume-slider {
  min-width: 72px;
}

.launcher-workspace {
  position: absolute;
  top: var(--launcher-main-y);
  right: var(--launcher-main-right);
  bottom: var(--launcher-main-bottom);
  left: var(--launcher-main-x);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.launcher-page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  min-height: clamp(54px, 7vh, 74px);
  padding: 0 8px clamp(8px, 1.2vh, 12px);
  border-bottom: 0;
  background: transparent;
}

.launcher-page-header > div {
  display: inline-grid;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  padding: 12px 16px;
  border: 1px solid rgba(255, 240, 190, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 206, 91, 0.12), rgba(34, 205, 231, 0.08) 52%, transparent),
    rgba(2, 13, 18, 0.28);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 245, 199, 0.1);
  backdrop-filter: blur(2px);
}

.launcher-brand-title {
  margin: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #fff7dc;
  font-size: clamp(1.7rem, 3.45vw, 3.55rem);
  line-height: 0.96;
  text-transform: uppercase;
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.88), 0 0 24px rgba(255, 211, 109, 0.16), 0 0 28px rgba(36, 207, 237, 0.16);
}

.launcher-page-subtitle {
  width: fit-content;
  margin: 0;
  padding: 5px 9px;
  border: 1px solid rgba(98, 234, 208, 0.22);
  border-radius: 6px;
  background: rgba(2, 18, 24, 0.46);
  color: #9ff7ff;
  font-size: 0.82rem;
  font-weight: 950;
  text-transform: uppercase;
}

.launcher-page-header h2 {
  display: none;
}

.launcher-page-header .eyebrow {
  margin-bottom: 6px;
}

.launcher-page-header .launcher-hero-tags {
  display: none;
}

.launcher-hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: 172px;
  padding: 20px 26px 26px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(1, 12, 18, 0.42), rgba(2, 18, 25, 0.08) 58%, rgba(1, 10, 16, 0.42)),
    linear-gradient(180deg, rgba(2, 19, 27, 0.02), rgba(1, 10, 16, 0.36));
}

.launcher-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(220, 170, 77, 0.72), transparent);
}

.launcher-hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  width: min(680px, 100%);
}

.launcher-hero h2 {
  margin: 0;
  color: #fff4d5;
  font-size: clamp(1.9rem, 4vw, 3.25rem);
  line-height: 0.98;
  text-shadow: 0 16px 34px rgba(0, 0, 0, 0.7);
}

.launcher-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.launcher-hero-tags span {
  padding: 6px 10px;
  border: 1px solid rgba(220, 170, 77, 0.42);
  border-radius: 999px;
  background: rgba(1, 13, 18, 0.72);
  color: #efe0ad;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.launcher-content {
  align-self: stretch;
  height: 100%;
  min-height: 0;
  padding: clamp(8px, 1vw, 14px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  background: transparent;
}

body.is-authenticated:not(.match-active) .launcher-content .tab-pane.active,
body.is-authenticated:not(.match-active) .launcher-content #profileTab.active {
  display: block;
}

.launcher-section {
  display: grid;
  gap: 14px;
  min-height: 0;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 12px;
}

.launcher-section > .section-title h3 {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.section-title h3 {
  margin: 0;
  padding: 7px 10px;
  border: 1px solid rgba(255, 240, 190, 0.08);
  border-radius: 8px;
  background: rgba(2, 13, 18, 0.22);
  color: #fff4d5;
  font-size: 1.25rem;
  backdrop-filter: blur(2px);
}

.section-title span {
  padding: 6px 9px;
  border: 1px solid rgba(255, 240, 190, 0.08);
  border-radius: 8px;
  background: rgba(2, 13, 18, 0.2);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  backdrop-filter: blur(2px);
}

.play-section {
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 340px);
  align-items: start;
}

.play-section .section-title,
.play-section .mini-log,
.play-section .play-status-row {
  grid-column: 1 / -1;
}

.play-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.play-section .mini-log {
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid rgba(255, 240, 190, 0.08);
  border-radius: 8px;
  background: rgba(2, 13, 18, 0.2);
  backdrop-filter: blur(2px);
}

.play-status-row .launcher-live-card {
  display: inline-grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: fit-content;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid rgba(98, 234, 208, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(98, 234, 208, 0.1), rgba(2, 13, 18, 0.38)),
    rgba(2, 10, 15, 0.28);
  color: #eafff9;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(6px) saturate(1.06);
}

.play-status-row .launcher-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #6aefdb;
  box-shadow: 0 0 13px rgba(106, 239, 219, 0.66);
}

.play-status-row .launcher-live-card strong {
  color: #fff8e8;
  font-size: 0.92rem;
  line-height: 1;
}

.play-status-row .launcher-live-card small {
  color: rgba(216, 240, 234, 0.72);
  font-size: 0.6rem;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.next-step-panel {
  position: relative;
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 210px);
  gap: 10px 14px;
  min-width: 0;
  padding: 13px;
  overflow: hidden;
  border: 1px solid rgba(98, 234, 208, 0.28);
  border-radius: 8px;
  background:
    radial-gradient(circle at 7% 0, rgba(98, 234, 208, 0.18), transparent 34%),
    linear-gradient(120deg, rgba(8, 53, 58, 0.62), rgba(22, 19, 36, 0.58)),
    rgba(2, 14, 18, 0.64);
  box-shadow: inset 0 1px 0 rgba(255, 248, 232, 0.08), 0 16px 34px rgba(0, 0, 0, 0.18);
}

.next-step-panel[hidden] {
  display: none;
}

.next-step-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, #62ead0, #ffd86f);
  opacity: 0.9;
}

.next-step-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.next-step-head div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.next-step-head span {
  color: #a7fff0;
  font-size: 0.64rem;
  font-weight: 950;
  text-transform: uppercase;
}

.next-step-head strong {
  min-width: 0;
  color: #fff8e8;
  font-size: 1.05rem;
  line-height: 1.14;
  overflow-wrap: anywhere;
}

.next-step-head em {
  padding: 5px 8px;
  border: 1px solid rgba(255, 216, 118, 0.28);
  border-radius: 999px;
  color: #ffe7a4;
  background: rgba(82, 59, 15, 0.28);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 950;
  white-space: nowrap;
}

.next-step-panel p {
  margin: 0;
  color: rgba(255, 248, 232, 0.78);
  font-size: 0.8rem;
  line-height: 1.4;
}

.next-step-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 240, 190, 0.1);
}

.next-step-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #62ead0, #ffd86f);
}

.next-step-actions {
  display: grid;
  grid-column: 2;
  grid-row: 1 / span 3;
  align-content: center;
  gap: 8px;
  min-width: 0;
}

.next-step-actions .primary-button,
.next-step-actions .mode-button {
  min-width: 0;
  min-height: 38px;
}

.alpha-season-panel {
  display: grid;
  grid-column: 1;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 216, 118, 0.24);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 0, rgba(255, 216, 118, 0.16), transparent 36%),
    linear-gradient(135deg, rgba(50, 24, 78, 0.62), rgba(4, 22, 29, 0.58)),
    rgba(2, 15, 20, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 248, 232, 0.08), 0 16px 34px rgba(0, 0, 0, 0.18);
}

.alpha-season-panel.is-highlighted {
  animation: alpha-season-focus 1.2s ease-out 1;
}

@keyframes alpha-season-focus {
  0%,
  100% {
    border-color: rgba(255, 216, 118, 0.24);
    box-shadow: inset 0 1px 0 rgba(255, 248, 232, 0.08), 0 16px 34px rgba(0, 0, 0, 0.18);
  }

  38% {
    border-color: rgba(98, 234, 208, 0.62);
    box-shadow: inset 0 1px 0 rgba(255, 248, 232, 0.12), 0 0 0 2px rgba(98, 234, 208, 0.18), 0 18px 38px rgba(0, 0, 0, 0.24);
  }
}

.alpha-season-head,
.alpha-season-rank,
.profile-season-summary {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.alpha-season-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.alpha-season-head span,
.alpha-season-rank span,
.profile-season-summary span,
.alpha-mission span {
  color: var(--gold);
  font-size: 0.64rem;
  font-weight: 950;
  text-transform: uppercase;
}

.alpha-season-head strong,
.profile-season-summary strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #fff8e8;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alpha-season-head em {
  padding: 5px 8px;
  border: 1px solid rgba(98, 234, 208, 0.24);
  border-radius: 999px;
  color: #c9fff3;
  background: rgba(98, 234, 208, 0.08);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.alpha-season-rank {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.alpha-season-rank > div,
.profile-season-summary > div {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(255, 240, 190, 0.12);
  border-radius: 7px;
  background: rgba(1, 10, 14, 0.34);
}

.alpha-season-rank strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #fff8e8;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alpha-season-progress,
.alpha-mission i {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 240, 190, 0.1);
}

.alpha-season-progress span,
.alpha-mission i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #62ead0, #ffd86f);
}

.alpha-mission-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.alpha-mission {
  display: grid;
  gap: 5px;
  min-width: 0;
  min-height: 72px;
  padding: 9px;
  border: 1px solid rgba(98, 234, 208, 0.18);
  border-radius: 8px;
  background: rgba(1, 10, 14, 0.42);
  color: #fff8e8;
  text-align: left;
}

.alpha-mission:disabled {
  cursor: default;
}

.alpha-mission.is-complete:disabled {
  opacity: 1;
}

.alpha-mission strong {
  min-width: 0;
  overflow: hidden;
  color: #fff8e8;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alpha-mission small {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 248, 232, 0.7);
  font-size: 0.68rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alpha-mission.is-complete {
  border-color: rgba(93, 230, 155, 0.36);
  background:
    linear-gradient(135deg, rgba(93, 230, 155, 0.1), transparent 50%),
    rgba(4, 24, 17, 0.46);
}

.alpha-mission.is-next {
  border-color: rgba(255, 216, 118, 0.5);
  background:
    linear-gradient(135deg, rgba(255, 216, 118, 0.12), transparent 48%),
    rgba(24, 19, 8, 0.52);
  box-shadow: inset 3px 0 0 rgba(255, 216, 118, 0.75);
}

.profile-season-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.profile-season-summary p {
  margin: 4px 0 0;
  color: rgba(255, 248, 232, 0.72);
  font-size: 0.72rem;
  line-height: 1.35;
}

.guest-conversion-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(98, 234, 208, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(98, 234, 208, 0.1), transparent 54%),
    rgba(3, 18, 20, 0.58);
}

.guest-conversion-panel[hidden] {
  display: none;
}

.guest-conversion-panel.is-highlighted {
  animation: alpha-season-focus 1.2s ease-out 1;
}

.guest-conversion-panel > div {
  display: grid;
  gap: 4px;
}

.guest-conversion-panel > div span {
  color: var(--gold);
  font-size: 0.64rem;
  font-weight: 950;
  text-transform: uppercase;
}

.guest-conversion-panel > div strong {
  color: #fff8e8;
  font-size: 1rem;
}

.guest-conversion-panel > div p {
  margin: 0;
  color: rgba(255, 248, 232, 0.72);
  font-size: 0.76rem;
  line-height: 1.36;
}

.queue-state {
  grid-column: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(56px, max-content);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 4px 10px;
  min-width: 0;
  overflow: hidden;
  padding: 10px 12px;
  border: 1px solid rgba(94, 239, 255, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(15, 82, 97, 0.42), rgba(7, 23, 31, 0.72)),
    rgba(2, 13, 18, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 30px rgba(0, 0, 0, 0.2);
}

.queue-state[hidden] {
  display: none;
}

.queue-state span,
.queue-state small {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-state span {
  grid-column: 1;
  grid-row: 1;
  color: #dffaff;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.queue-state strong {
  display: grid;
  grid-column: 2;
  grid-row: 1 / 3;
  min-width: 56px;
  min-height: 42px;
  padding: 0 8px;
  place-items: center;
  border: 1px solid rgba(255, 240, 190, 0.32);
  border-radius: 8px;
  background: rgba(2, 10, 14, 0.56);
  color: #fff7dc;
  font-size: 1.12rem;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.queue-state small {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
  color: rgba(239, 224, 173, 0.76);
  font-size: 0.72rem;
  font-weight: 850;
}

.queue-state::after {
  content: "";
  grid-column: 1 / -1;
  height: 3px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(94, 239, 255, 0.78), rgba(255, 240, 190, 0.28), rgba(94, 239, 255, 0.08));
}

.queue-state.is-ranked {
  border-color: rgba(255, 202, 96, 0.46);
  background:
    radial-gradient(circle at 12% 0, rgba(255, 202, 96, 0.2), transparent 36%),
    linear-gradient(90deg, rgba(119, 65, 174, 0.42), rgba(30, 14, 51, 0.72)),
    rgba(13, 8, 23, 0.76);
}

.queue-state.is-ranked::after {
  background: linear-gradient(90deg, rgba(255, 202, 96, 0.92), rgba(158, 99, 220, 0.52), rgba(255, 202, 96, 0.12));
}

.lobby-list {
  grid-column: 1;
  min-height: 156px;
  margin-top: 0;
}

.play-actions {
  grid-column: 2;
  grid-row: 3 / span 2;
  display: grid;
  gap: 10px;
}

.about-section {
  align-content: start;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.75fr);
  gap: 12px;
}

.about-card {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 240, 190, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(98, 234, 208, 0.08), transparent 52%),
    rgba(3, 11, 14, 0.58);
}

.about-card--primary {
  grid-row: span 2;
  border-color: rgba(98, 234, 208, 0.22);
}

.about-kicker {
  width: fit-content;
  padding: 4px 7px;
  border: 1px solid rgba(215, 169, 74, 0.2);
  border-radius: 6px;
  color: #f0d489;
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
}

.about-card h4 {
  margin: 0;
  color: #fff8e8;
  font-size: 1.08rem;
}

.about-card p {
  margin: 0;
  color: rgba(255, 248, 232, 0.82);
  font-size: 0.84rem;
  line-height: 1.45;
}

.about-contact {
  display: grid;
  gap: 4px;
  width: fit-content;
  min-width: min(220px, 100%);
  padding: 10px 12px;
  border: 1px solid rgba(98, 234, 208, 0.2);
  border-radius: 8px;
  background: rgba(2, 12, 16, 0.56);
}

.about-contact span {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.about-contact strong {
  color: #9ff7ff;
  font-size: 1.05rem;
}

.about-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: rgba(255, 248, 232, 0.82);
  font-size: 0.8rem;
  line-height: 1.35;
}

.profile-progression {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.profile-progression > div:not(.profile-progress-bar):not(.profile-xp-bar) {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(215, 169, 74, 0.18);
  border-radius: 8px;
  background: rgba(8, 13, 10, 0.72);
}

.profile-progression span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-progression strong {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(0.78rem, 0.78vw, 0.96rem);
  color: #fff8e8;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-progress-bar {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(215, 169, 74, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(215, 169, 74, 0.12), transparent 52%),
    rgba(8, 13, 10, 0.78);
}

.profile-progress-bar > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.profile-progress-bar > div > span,
.profile-progress-bar > div > strong {
  min-width: 0;
}

.profile-progress-bar > div > strong {
  text-align: right;
}

.profile-progress-bar i {
  display: block;
  width: 100%;
  height: 9px;
  overflow: hidden;
  border: 1px solid rgba(255, 248, 232, 0.1);
  border-radius: 999px;
  background: rgba(255, 240, 190, 0.08);
}

.profile-progress-bar i > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 180ms ease;
}

.profile-progress-bar--rank {
  border-color: rgba(255, 216, 116, 0.34);
  background:
    linear-gradient(90deg, rgba(255, 216, 116, 0.16), rgba(49, 181, 255, 0.08) 58%, transparent),
    rgba(8, 13, 10, 0.82);
}

.profile-progress-bar--rank i > span {
  background: linear-gradient(90deg, #ffd874, #6ad8ff);
  box-shadow: 0 0 14px rgba(255, 216, 116, 0.2);
}

.profile-progress-bar--xp {
  border-color: rgba(98, 234, 208, 0.22);
  background:
    linear-gradient(90deg, rgba(98, 234, 208, 0.1), transparent 52%),
    rgba(8, 13, 10, 0.72);
}

.profile-progress-bar--xp i > span {
  background: linear-gradient(90deg, #62ead0, #d7a94a);
}

.player-profile-viewer {
  margin-bottom: 12px;
}

.player-profile-viewer[hidden] {
  display: none;
}

.player-profile-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(115, 191, 255, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(115, 191, 255, 0.1), transparent 42%),
    rgba(2, 18, 24, 0.82);
}

.player-profile-avatar {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(215, 169, 74, 0.35);
  border-radius: 8px;
  background: rgba(215, 169, 74, 0.12);
  color: #fff8e8;
  font-size: 1.15rem;
  font-weight: 950;
}

.player-profile-main {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.player-profile-eyebrow,
.player-profile-meta {
  color: var(--muted);
  font-size: 0.72rem;
}

.player-profile-eyebrow {
  font-weight: 900;
  text-transform: uppercase;
}

.player-profile-main strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.player-profile-meta span {
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

.player-profile-xp {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 240, 190, 0.08);
}

.player-profile-xp > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #62ead0, #d7a94a);
}

.player-profile-actions {
  display: flex;
  justify-content: end;
}

.player-profile-actions .mode-button {
  min-width: 76px;
  min-height: 34px;
  margin: 0;
  padding: 0 14px;
  white-space: nowrap;
}

.profile-xp-bar {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 240, 190, 0.08);
}

.profile-xp-bar > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #62ead0, #d7a94a);
}

.profile-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.profile-insight-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(115, 191, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(98, 234, 208, 0.06), transparent 46%),
    rgba(3, 14, 18, 0.42);
}

.profile-insight-card--highlight {
  border-color: rgba(242, 184, 75, 0.28);
  background:
    linear-gradient(135deg, rgba(242, 184, 75, 0.1), transparent 48%),
    rgba(18, 13, 4, 0.42);
}

.profile-insight-card span {
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 950;
  text-transform: uppercase;
}

.profile-insight-card strong {
  min-width: 0;
  overflow: hidden;
  color: #fff8e8;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-insight-card p {
  margin: 0;
  color: rgba(239, 224, 173, 0.72);
  font-size: 0.72rem;
  line-height: 1.3;
}

.reference-section {
  gap: 16px;
}

.reference-list,
.reference-group {
  display: grid;
  gap: 14px;
}

.reference-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(220, 170, 77, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--reference-color, #dca643) 9%, transparent), transparent 58%),
    rgba(2, 15, 20, 0.76);
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--reference-color, #dca643) 62%, transparent);
  content-visibility: auto;
  contain-intrinsic-size: 150px;
}

.reference-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.reference-card-head.reference-trait-head {
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.reference-trait-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.reference-card-head h4 {
  margin: 2px 0 0;
  color: #fff4d5;
  font-size: 1rem;
}

.reference-card-head span,
.reference-card-head em,
.reference-tier em,
.reference-towers {
  color: var(--muted);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

.reference-rarity-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.reference-rarity,
.reference-tier {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 9px;
  border: 1px solid color-mix(in srgb, var(--reference-color, #dca643) 42%, rgba(255, 240, 190, 0.12));
  border-radius: 7px;
  background: rgba(1, 10, 14, 0.48);
}

.reference-rarity strong,
.reference-tier strong {
  color: color-mix(in srgb, var(--reference-color, #dca643) 72%, #fff8e8);
}

.reference-rarity small {
  color: #fff8e8;
  font-size: 0.72rem;
}

.reference-rarity b {
  color: #fff8e8;
  font-size: 0.82rem;
}

.reference-rarity span,
.reference-tier span,
.reference-card p {
  color: rgba(255, 248, 232, 0.78);
  font-size: 0.78rem;
  line-height: 1.35;
}

.reference-card--maps {
  --reference-color: #62ead0;
}

.reference-list--powers {
  margin-top: 6px;
}

.reference-power-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.reference-card--power {
  min-height: 142px;
}

.reference-power-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.reference-power-head .power-icon {
  width: 42px;
  height: 42px;
  --power-color: var(--reference-color, #d7a94a);
}

.reference-power-head > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.reference-power-head h4 {
  margin: 0;
  color: #fff4d5;
  font-size: 0.98rem;
}

.reference-power-head span:not(.power-icon) {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.reference-map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.reference-map-card {
  display: grid;
  grid-template-rows: 112px auto auto;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(98, 234, 208, 0.2);
  border-radius: 8px;
  background: rgba(1, 10, 14, 0.5);
}

.reference-map-art {
  min-height: 112px;
  background-position: center;
  background-size: cover;
}

.reference-map-copy,
.reference-map-effects {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
}

.reference-map-copy small {
  color: rgba(98, 234, 208, 0.82);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.reference-map-copy strong {
  color: #fff8e8;
}

.reference-map-copy span {
  color: rgba(255, 248, 232, 0.78);
  font-size: 0.78rem;
  line-height: 1.35;
}

.reference-map-effects {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  padding-top: 0;
}

.reference-map-effects b {
  padding: 6px 8px;
  border: 1px solid rgba(98, 234, 208, 0.22);
  border-radius: 999px;
  color: #dffff8;
  background: rgba(98, 234, 208, 0.08);
  font-size: 0.7rem;
}

.reference-trait-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.reference-tier-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.reference-collection-bonus {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid rgba(255, 248, 232, 0.12);
  border-radius: 7px;
  background: rgba(4, 8, 6, 0.34);
}

.reference-collection-bonus strong {
  color: color-mix(in srgb, var(--reference-color, #d7a94a) 70%, #fff8e8);
  font-size: 0.78rem;
}

.reference-collection-bonus span,
.reference-collection-bonus em {
  color: rgba(255, 248, 232, 0.74);
  font-size: 0.68rem;
  line-height: 1.35;
}

.reference-collection-bonus em {
  overflow: hidden;
  color: var(--muted);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-tier {
  grid-template-columns: minmax(74px, 0.32fr) repeat(2, minmax(0, 1fr));
  align-items: start;
}

.reference-tier div {
  display: grid;
  gap: 4px;
}

.reference-towers {
  margin: 10px 0 0;
  text-transform: none;
}

.reference-towers strong,
.trait-bonus-block > h4 + .reference-tower-list {
  flex: 0 0 100%;
}

.reference-tower-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
  width: 100%;
}

.reference-tower-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 52px;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--rarity-color, #9fb4a6) 46%, rgba(255, 240, 190, 0.12));
  border-radius: 7px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--rarity-color, #9fb4a6) 12%, transparent), transparent 70%),
    rgba(1, 10, 14, 0.5);
}

.reference-tower-card .choice-icon {
  width: 38px;
  height: 38px;
  border-radius: 7px;
}

.reference-tower-card span:not(.choice-icon) {
  display: flex;
  align-items: center;
  min-width: 0;
}

.reference-tower-card .reference-tower-body {
  display: grid !important;
  align-content: center;
  gap: 3px;
  min-width: 0;
}

.reference-tower-summary {
  display: inline-flex !important;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--rarity-color, #9fb4a6) 34%, rgba(255, 240, 190, 0.14));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.reference-tower-hover {
  position: absolute;
  z-index: 20;
  right: auto;
  bottom: calc(100% + 8px);
  left: 0;
  display: none !important;
  gap: 6px;
  width: min(230px, max(100%, 190px));
  min-width: 0;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--rarity-color, #9fb4a6) 48%, rgba(255, 240, 190, 0.16));
  border-radius: 7px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--rarity-color, #9fb4a6) 12%, transparent), transparent 72%),
    rgba(1, 10, 14, 0.96);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
  pointer-events: none;
}

.reference-tower-card:hover .reference-tower-hover,
.reference-tower-card:focus-within .reference-tower-hover {
  display: grid !important;
}

.reference-tower-card .reference-tower-stats,
.tower-stat-block .reference-tower-stats {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 5px;
  min-width: 0;
}

.tower-stat-block .reference-tower-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.reference-tower-stats .stat-pill {
  justify-content: center;
  min-width: 0;
  min-height: 25px;
  padding: 3px 5px;
  border: 1px solid rgba(151, 184, 211, 0.14);
  background: rgba(4, 8, 6, 0.42);
  color: #d7e3d1;
}

.reference-tower-stats .stat-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  place-items: center;
}

.reference-tower-stats .stat-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.reference-tower-stats .stat-pill strong {
  font-size: 0.68rem;
  white-space: nowrap;
}

.reference-tower-effects {
  display: flex !important;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.reference-tower-effects > span {
  display: inline-flex !important;
  align-items: center;
  min-height: 22px;
  padding: 2px 6px;
  border: 1px solid rgba(255, 240, 190, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
}

.reference-tower-card strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-tower-card strong {
  color: #fff8e8;
  font-size: 0.78rem;
}

.reference-tower-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.reference-card--tower {
  display: grid;
  gap: 12px;
  border-color: color-mix(in srgb, var(--rarity-color, #9fb4a6) 42%, rgba(255, 240, 190, 0.14));
  contain-intrinsic-size: 210px;
}

.reference-unit-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.reference-card--unit {
  display: grid;
  gap: 12px;
  border-color: color-mix(in srgb, var(--rarity-color, #9fb4a6) 42%, rgba(255, 240, 190, 0.14));
  contain-intrinsic-size: 238px;
}

.reference-tower-head,
.reference-unit-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.reference-tower-head .choice-icon,
.reference-unit-head .choice-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

.reference-tower-head span,
.reference-unit-head span,
.tower-trait-block > strong,
.trait-chip small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reference-tower-head h4,
.reference-unit-head h4 {
  min-width: 0;
  margin: 2px 0 0;
  overflow: hidden;
  color: #fff8e8;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-unit-icon {
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--rarity-color, #9fb4a6) 48%, rgba(255, 240, 190, 0.14));
  background:
    radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--rarity-color, #9fb4a6) 28%, transparent), transparent 58%),
    rgba(1, 10, 14, 0.68);
}

.reference-unit-icon img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.unit-reference-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--rarity-color, #9fb4a6) 72%, #fff8e8);
  font-size: 0.9rem;
  font-weight: 950;
}

.unit-stat-block .reference-unit-stats {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 5px;
  min-width: 0;
}

.reference-unit-stats .stat-pill {
  justify-content: center;
  min-width: 0;
  min-height: 25px;
  padding: 3px 5px;
  border: 1px solid rgba(151, 184, 211, 0.14);
  background: rgba(4, 8, 6, 0.42);
  color: #d7e3d1;
}

.reference-unit-stats .stat-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  place-items: center;
}

.reference-unit-stats .stat-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.reference-unit-stats .stat-pill strong {
  min-width: 0;
  overflow: hidden;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-unit-specifics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reference-unit-specifics > span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--rarity-color, #9fb4a6) 40%, rgba(255, 240, 190, 0.14));
  border-radius: 999px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--rarity-color, #9fb4a6) 13%, transparent), transparent 76%),
    rgba(1, 10, 14, 0.48);
  color: rgba(255, 248, 232, 0.82);
  font-size: 0.66rem;
  font-weight: 850;
}

.tower-trait-block {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.tower-stat-block p,
.tower-lore-block p,
.reference-card--unit p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.tower-lore-block p {
  color: rgba(255, 248, 232, 0.78);
  font-style: italic;
}

.trait-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trait-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--trait-color, #d7a94a) 46%, rgba(255, 240, 190, 0.14));
  border-radius: 999px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--trait-color, #d7a94a) 16%, transparent), transparent 76%),
    rgba(1, 10, 14, 0.48);
  color: #fff8e8;
}

.trait-chip strong {
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--trait-color, #d7a94a) 70%, #fff8e8);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trait-chip--empty {
  --trait-color: #78868b;
  opacity: 0.72;
}

.play-actions .primary-button {
  min-height: 64px;
  border-color: rgba(247, 198, 83, 0.86);
  background:
    linear-gradient(180deg, rgba(255, 238, 160, 0.34), rgba(145, 92, 18, 0.2) 52%, rgba(79, 48, 10, 0.32)),
    linear-gradient(90deg, #8c5c15, #d39a31 48%, #8a5a16);
  color: #fff5d6;
  font-size: 1rem;
  box-shadow: 0 0 0 1px rgba(255, 227, 139, 0.22), 0 12px 36px rgba(0, 0, 0, 0.34), 0 0 26px rgba(220, 170, 77, 0.18);
  text-transform: uppercase;
}

.play-actions .primary-button.is-ready {
  border-color: rgba(93, 230, 155, 0.92);
  background:
    linear-gradient(180deg, rgba(127, 255, 186, 0.32), rgba(14, 101, 65, 0.42)),
    linear-gradient(90deg, #12623f, #2bbd74 48%, #0e5536);
  color: #edfff6;
  box-shadow: 0 0 0 1px rgba(127, 255, 186, 0.24), 0 12px 36px rgba(0, 0, 0, 0.34), 0 0 28px rgba(93, 230, 155, 0.26);
}

@media (min-width: 981px) and (max-height: 820px) {
  .launcher-nav {
    gap: 7px;
    padding: 0;
  }

  .launcher-mark {
    grid-template-columns: 40px minmax(0, 1fr);
    min-height: 44px;
    gap: 8px;
  }

  .launcher-mark-icon {
    width: 40px;
    height: 40px;
    font-size: 0.68rem;
  }

  .launcher-mark strong {
    font-size: 0.92rem;
    line-height: 1.05;
  }

  .profile-card {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 9px;
    padding: 9px;
  }

  .profile-avatar {
    width: 46px;
    height: 46px;
  }

  body.is-authenticated:not(.match-active) .profile-card[data-rank-tier]::before {
    left: 6px;
    top: 6px;
    width: 48px;
    height: 48px;
  }

  body.is-authenticated:not(.match-active) .profile-card[data-rank-tier]::after {
    left: 41px;
    top: 10px;
  }

  .profile-meta h2 {
    font-size: 1rem;
  }

  .profile-status {
    padding-top: 6px;
    font-size: 0.74rem;
  }

  .launcher-tabs {
    gap: 6px;
  }

  .launcher-tabs .tab-button {
    min-height: 38px;
    padding-left: 38px;
    padding-right: 28px;
    font-size: 0.8rem;
  }

  .launcher-tabs .tab-button::before {
    left: 12px;
    width: 12px;
    height: 12px;
  }

  .launcher-audio {
    padding-top: 6px;
  }

  .launcher-audio .setting-row {
    margin: 5px 0;
    font-size: 0.8rem;
  }

  .launcher-audio .mode-button {
    min-height: 30px;
    margin-top: 5px;
    font-size: 0.78rem;
  }

  .launcher-workspace {
    padding: 0;
  }

  .launcher-page-header {
    min-height: 58px;
    padding-bottom: 8px;
  }

  .launcher-brand-title {
    font-size: clamp(1.35rem, 2.25vw, 1.9rem);
  }

  .launcher-content {
    padding: 8px 10px;
  }
}

@media (min-width: 981px) and (max-height: 920px) {
  .launcher-nav {
    gap: 6px;
  }

  .launcher-mark {
    grid-template-columns: 38px minmax(0, 1fr);
    min-height: 40px;
    gap: 7px;
    padding: 6px 8px;
  }

  .launcher-mark-icon {
    width: 38px;
    height: 38px;
  }

  .launcher-mark strong {
    font-size: 0.9rem;
    line-height: 1.04;
  }

  .profile-card {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 6px 8px;
    padding: 7px 8px;
  }

  .profile-avatar {
    width: 40px;
    height: 40px;
  }

  body.is-authenticated:not(.match-active) .profile-card[data-rank-tier]::before {
    left: 6px;
    top: 6px;
    width: 44px;
    height: 44px;
  }

  body.is-authenticated:not(.match-active) .profile-card[data-rank-tier]::after {
    left: 38px;
    top: 9px;
  }

  .profile-meta h2 {
    font-size: 0.92rem;
  }

  .profile-meta span,
  .profile-status,
  .profile-status strong {
    font-size: 0.68rem;
  }

  .launcher-tabs {
    gap: 5px;
  }

  .launcher-tabs .tab-button {
    min-height: 36px;
    font-size: 0.8rem;
  }

  .launcher-audio {
    gap: 4px;
    padding-top: 5px;
  }

  .launcher-audio .setting-row {
    min-height: 18px;
    font-size: 0.76rem;
  }

  .launcher-audio .mode-button {
    min-height: 28px;
    font-size: 0.74rem;
  }
}

body.is-authenticated:not(.match-active) .shell {
  width: min(calc(100vw - 28px), calc((100vh - 24px) * 16 / 9), 1840px);
  height: min(calc(100vh - 30px), calc((100vw - 48px) * 9 / 16));
}

body.is-authenticated:not(.match-active) .launcher-panel {
  --launcher-main-y: 10%;
  --launcher-main-bottom: 6%;
}

body.is-authenticated:not(.match-active) .launcher-panel {
  --launcher-left-x: 11.2%;
  --launcher-left-y: 17%;
  --launcher-left-w: 23.8%;
  --launcher-left-bottom: 6.2%;
  --launcher-main-x: 36%;
  --launcher-main-y: 17%;
  --launcher-main-right: 7.5%;
  --launcher-main-bottom: 6.2%;
  --launcher-frame-bleed-x: 42px;
  --launcher-frame-bleed-top: 36px;
  --launcher-frame-bleed-bottom: 30px;
}

body.is-authenticated:not(.match-active) .launcher-panel::after {
  background:
    linear-gradient(180deg, rgba(2, 13, 18, 0.12), rgba(2, 13, 18, 0.03) 34%, rgba(2, 13, 18, 0.14)),
    radial-gradient(circle at 11% 87%, rgba(33, 199, 255, 0.14), transparent 18%),
    radial-gradient(circle at 91% 84%, rgba(255, 82, 45, 0.12), transparent 20%),
    radial-gradient(circle at 52% 6%, rgba(255, 216, 118, 0.1), transparent 24%);
}

body.is-authenticated:not(.match-active) .launcher-nav {
  gap: clamp(8px, 1.1vh, 14px);
}

body.is-authenticated:not(.match-active) .launcher-nav > * {
  width: min(100%, 318px);
}

body.is-authenticated:not(.match-active) .launcher-mark,
body.is-authenticated:not(.match-active) .profile-card,
body.is-authenticated:not(.match-active) .launcher-page-header > div,
body.is-authenticated:not(.match-active) .section-title h3,
body.is-authenticated:not(.match-active) .section-title span,
body.is-authenticated:not(.match-active) .play-section .mini-log {
  border-color: rgba(255, 225, 142, 0.18);
  background:
    linear-gradient(135deg, rgba(43, 218, 242, 0.08), transparent 48%),
    rgba(2, 14, 20, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 199, 0.1),
    0 10px 26px rgba(0, 0, 0, 0.16);
}

body.is-authenticated:not(.match-active) .launcher-mark-icon {
  border-color: rgba(255, 220, 116, 0.92);
  background:
    radial-gradient(circle at 38% 24%, rgba(255, 248, 220, 0.38), transparent 30%),
    linear-gradient(145deg, rgba(226, 157, 38, 0.66), rgba(34, 205, 231, 0.22)),
    rgba(3, 22, 29, 0.94);
  box-shadow: 0 0 18px rgba(255, 211, 109, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

body.is-authenticated:not(.match-active) .profile-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 216, 118, 0.62);
  background:
    radial-gradient(circle at 18% 6%, rgba(44, 222, 247, 0.3), transparent 36%),
    linear-gradient(115deg, rgba(247, 198, 83, 0.16), rgba(5, 33, 42, 0.4) 52%, rgba(2, 11, 16, 0.52)),
    rgba(3, 18, 24, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 199, 0.14),
    inset 0 0 30px rgba(14, 207, 255, 0.08),
    0 0 24px rgba(34, 205, 231, 0.08);
}

body.is-authenticated:not(.match-active) .profile-card[data-rank-tier] {
  border-color: color-mix(in srgb, var(--rank-color, #c6d4df) 58%, rgba(255, 216, 118, 0.36));
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 199, 0.14),
    inset 0 0 30px color-mix(in srgb, var(--rank-color, #c6d4df) 12%, transparent),
    0 0 24px color-mix(in srgb, var(--rank-color, #c6d4df) 16%, transparent);
}

body.is-authenticated:not(.match-active) .profile-card[data-rank-tier]::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  width: 54px;
  height: 54px;
  border: 1px solid color-mix(in srgb, var(--rank-color, #c6d4df) 78%, rgba(255, 240, 190, 0.34));
  border-radius: 12px 12px 16px 16px;
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.46), transparent 18%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 24%),
    linear-gradient(45deg, transparent 14%, color-mix(in srgb, var(--rank-color, #c6d4df) 42%, transparent) 15% 26%, transparent 27%),
    linear-gradient(155deg, color-mix(in srgb, var(--rank-color, #c6d4df) 44%, rgba(255, 235, 168, 0.26)), rgba(8, 24, 33, 0.62) 54%, rgba(1, 10, 14, 0.68));
  clip-path: polygon(50% 0, 90% 12%, 100% 42%, 84% 83%, 50% 100%, 16% 83%, 0 42%, 10% 12%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.28),
    inset 0 -8px 16px rgba(0, 0, 0, 0.34),
    0 0 0 2px rgba(255, 232, 160, 0.08),
    0 10px 22px color-mix(in srgb, var(--rank-color, #c6d4df) 22%, transparent);
  pointer-events: none;
}

body.is-authenticated:not(.match-active) .profile-card[data-rank-tier]::after {
  content: attr(data-rank-ornament);
  position: absolute;
  left: 46px;
  top: 12px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 242, 184, 0.58);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), color-mix(in srgb, var(--rank-color, #c6d4df) 68%, #ffffff) 45%, rgba(28, 54, 68, 0.9));
  color: rgba(5, 15, 20, 0.88);
  font-size: 0.56rem;
  font-weight: 950;
  line-height: 1;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.34), 0 0 14px color-mix(in srgb, var(--rank-color, #c6d4df) 28%, transparent);
  pointer-events: none;
}

body.is-authenticated:not(.match-active) .profile-card[data-rank-tier] .profile-avatar {
  position: relative;
  z-index: 1;
}

body.is-authenticated:not(.match-active) .profile-card[data-rank-tier] .profile-meta,
body.is-authenticated:not(.match-active) .profile-card[data-rank-tier] .profile-status,
body.is-authenticated:not(.match-active) .profile-card[data-rank-tier] .profile-live-stats {
  position: relative;
  z-index: 1;
}

body.is-authenticated:not(.match-active) .launcher-tabs {
  gap: clamp(5px, 0.7vh, 8px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding-right: 2px;
}

body.is-authenticated:not(.match-active) .launcher-tabs .tab-button {
  min-height: clamp(38px, 4vh, 48px);
  border-color: rgba(238, 188, 86, 0.7);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 196, 74, 0.34), rgba(9, 69, 80, 0.5) 36%, rgba(2, 17, 24, 0.7)),
    radial-gradient(circle at 8% 50%, rgba(255, 221, 119, 0.18), transparent 32%),
    rgba(2, 14, 20, 0.58);
  color: #fff5d6;
  font-size: 0.84rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 199, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 10px 22px rgba(0, 0, 0, 0.22),
    0 0 18px rgba(34, 205, 231, 0.06);
}

body.is-authenticated:not(.match-active) .launcher-tabs .tab-button::before {
  border-color: rgba(255, 238, 172, 0.88);
  background:
    linear-gradient(135deg, rgba(255, 245, 199, 0.7), transparent 28%),
    linear-gradient(135deg, #45f0ff, #0b6b85);
  box-shadow: 0 0 18px rgba(69, 240, 255, 0.34);
}

body.is-authenticated:not(.match-active) .launcher-tabs .tab-button::after {
  right: 13px;
  border-color: rgba(255, 231, 150, 0.95);
  box-shadow: 4px -4px 14px rgba(255, 222, 127, 0.36);
}

body.is-authenticated:not(.match-active) .launcher-tabs .tab-button:hover {
  border-color: rgba(70, 231, 255, 0.9);
  background:
    linear-gradient(90deg, rgba(70, 231, 255, 0.28), rgba(12, 76, 88, 0.58) 42%, rgba(2, 19, 27, 0.72)),
    radial-gradient(circle at 8% 50%, rgba(255, 221, 119, 0.2), transparent 34%),
    rgba(3, 28, 37, 0.56);
  color: #effcff;
}

body.is-authenticated:not(.match-active) .launcher-tabs .tab-button.active {
  border-color: rgba(255, 224, 126, 0.98);
  background:
    linear-gradient(90deg, rgba(255, 202, 76, 0.7), rgba(40, 219, 244, 0.26) 48%, rgba(3, 28, 37, 0.66)),
    radial-gradient(circle at 8% 50%, rgba(255, 244, 196, 0.28), transparent 32%),
    rgba(6, 36, 44, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 218, 0.26),
    inset 0 -1px 0 rgba(0, 0, 0, 0.44),
    0 0 0 1px rgba(255, 224, 126, 0.12),
    0 0 24px rgba(255, 211, 109, 0.26),
    0 0 26px rgba(34, 205, 231, 0.12);
}

body.is-authenticated:not(.match-active) .launcher-audio {
  position: relative;
  z-index: 2;
  padding-top: clamp(8px, 1vh, 14px);
  background:
    linear-gradient(180deg, rgba(1, 11, 16, 0.42), rgba(1, 11, 16, 0.06) 38%, transparent);
}

body.is-authenticated:not(.match-active) .launcher-workspace {
  padding: 0 4px 2px 0;
}

body.is-authenticated:not(.match-active) .launcher-page-header {
  min-height: clamp(62px, 8vh, 92px);
  padding-bottom: clamp(10px, 1.4vh, 16px);
}

body.is-authenticated:not(.match-active) .launcher-page-header > div {
  padding: 10px 14px;
  background:
    linear-gradient(90deg, rgba(255, 206, 91, 0.1), rgba(34, 205, 231, 0.08) 48%, transparent),
    rgba(2, 13, 18, 0.22);
}

body.is-authenticated:not(.match-active) .launcher-brand-title {
  color: #fff7dc;
  font-size: clamp(1.9rem, 3.7vw, 3.9rem);
  text-shadow: 0 8px 26px rgba(0, 0, 0, 0.84), 0 0 20px rgba(255, 211, 109, 0.14), 0 0 22px rgba(36, 207, 237, 0.14);
}

body.is-authenticated:not(.match-active) .launcher-content {
  overflow-x: hidden;
  overflow-y: auto;
  padding: clamp(10px, 1.1vw, 16px);
}

@media (min-width: 981px) and (max-width: 1180px) {
  body.is-authenticated:not(.match-active) .launcher-panel {
    --launcher-left-x: 7.2%;
    --launcher-left-w: 29.8%;
    --launcher-main-x: 40.2%;
    --launcher-main-right: 4.2%;
  }

  body.is-authenticated:not(.match-active) .launcher-page-header > div {
    padding: 9px 12px;
  }

  body.is-authenticated:not(.match-active) .launcher-brand-title {
    font-size: clamp(1.45rem, 3vw, 2.45rem);
    line-height: 1;
  }

  body.is-authenticated:not(.match-active) .profile-card {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 6px 8px;
  }
}

body.is-authenticated:not(.match-active) .play-actions .primary-button {
  min-height: clamp(70px, 7.3vh, 92px);
  border-width: 2px;
  border-color: rgba(255, 224, 126, 0.98);
  background:
    radial-gradient(circle at 50% 0, rgba(255, 246, 194, 0.34), transparent 42%),
    linear-gradient(180deg, rgba(255, 219, 120, 0.5), rgba(196, 119, 19, 0.34) 54%, rgba(111, 61, 10, 0.52)),
    linear-gradient(90deg, #a86716, #e3a93a 48%, #9d6518);
  color: #fff8e8;
  font-size: clamp(1.02rem, 1vw, 1.2rem);
  box-shadow:
    0 0 0 1px rgba(255, 227, 139, 0.32),
    0 16px 38px rgba(0, 0, 0, 0.34),
    0 0 34px rgba(220, 170, 77, 0.34);
}

body.is-authenticated:not(.match-active) .play-actions .mode-button {
  min-height: clamp(54px, 5.8vh, 68px);
  border-color: rgba(255, 216, 118, 0.28);
  background:
    linear-gradient(90deg, rgba(34, 205, 231, 0.08), rgba(255, 216, 118, 0.04)),
    rgba(3, 18, 24, 0.42);
  color: #fff1c5;
}

body.is-authenticated:not(.match-active) .play-actions #tutorialButton.is-recommended {
  position: relative;
  min-height: clamp(58px, 6.2vh, 78px);
  border-color: rgba(86, 238, 255, 0.84);
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 247, 205, 0.18), transparent 34%),
    linear-gradient(90deg, rgba(42, 221, 247, 0.38), rgba(16, 73, 86, 0.62) 52%, rgba(4, 26, 34, 0.76)),
    rgba(3, 22, 29, 0.74);
  color: #effcff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 0 1px rgba(86, 238, 255, 0.14),
    0 12px 32px rgba(0, 0, 0, 0.3),
    0 0 28px rgba(42, 221, 247, 0.22);
}

body.is-authenticated:not(.match-active) .play-actions #tutorialButton.is-recommended::after {
  content: "Recommandé";
  position: absolute;
  top: -10px;
  right: 12px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 231, 150, 0.84);
  border-radius: 999px;
  background: rgba(95, 57, 5, 0.94);
  color: #ffe79c;
  font-size: 0.58rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 0 16px rgba(255, 211, 109, 0.26);
}

body.is-authenticated:not(.match-active).fresh-account-onboarding .play-actions #tutorialButton.is-recommended {
  order: 4;
  min-height: clamp(48px, 5.2vh, 62px);
  border-color: rgba(255, 231, 150, 0.46);
  background:
    linear-gradient(90deg, rgba(255, 207, 82, 0.18), rgba(40, 221, 247, 0.14) 52%, rgba(4, 28, 36, 0.58)),
    rgba(4, 28, 36, 0.54);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 10px 24px rgba(0, 0, 0, 0.22);
}

body.is-authenticated:not(.match-active).fresh-account-onboarding .play-actions #tutorialButton.is-recommended::after {
  content: "Nouveau joueur";
}

@media (min-width: 981px) and (max-height: 820px) {
  body.is-authenticated:not(.match-active) .launcher-panel {
    --launcher-left-y: 15.2%;
    --launcher-left-bottom: 5.8%;
    --launcher-main-y: 15.2%;
    --launcher-main-bottom: 5.8%;
  }

  body.is-authenticated:not(.match-active) .launcher-nav {
    gap: 5px;
  }

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

  body.is-authenticated:not(.match-active) .profile-card {
    padding-block: 6px;
  }

  body.is-authenticated:not(.match-active) .profile-avatar {
    width: 38px;
    height: 38px;
  }

  body.is-authenticated:not(.match-active) .launcher-audio {
    gap: 3px;
    padding-top: 7px;
  }

  body.is-authenticated:not(.match-active) .launcher-audio .setting-row {
    min-height: 16px;
    font-size: 0.72rem;
  }

  body.is-authenticated:not(.match-active) .launcher-audio .mode-button {
    min-height: 25px;
    font-size: 0.7rem;
  }

  body.is-authenticated:not(.match-active) .launcher-tabs {
    gap: 4px;
  }

  body.is-authenticated:not(.match-active) .launcher-tabs .tab-button {
    min-height: 36px;
    font-size: 0.78rem;
  }
}

@media (min-width: 981px) and (max-height: 700px) {
  body.is-authenticated:not(.match-active) .launcher-panel {
    --launcher-left-y: 14.4%;
    --launcher-left-bottom: 5.2%;
    --launcher-main-y: 14.4%;
    --launcher-main-bottom: 5.2%;
  }
}

.logout-button {
  border-color: rgba(220, 170, 77, 0.34);
  color: #dbc9aa;
}

.play-actions .mode-button,
.play-actions .danger-button {
  margin-top: 0;
}

.profile-history-grid,
.social-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
}

.profile-history-grid {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.profile-history-grid #historyDetail {
  display: none;
}

.profile-subtabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
  padding: 6px;
  border: 1px solid rgba(255, 240, 190, 0.12);
  border-radius: 8px;
  background: rgba(2, 13, 18, 0.36);
}

.profile-subtabs .tab-button {
  min-height: 38px;
  border: 1px solid rgba(255, 216, 118, 0.22);
  border-radius: 7px;
  background: rgba(3, 18, 24, 0.42);
  color: rgba(255, 240, 190, 0.68);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0;
}

.profile-subtabs .tab-button.active {
  border-color: rgba(94, 239, 255, 0.62);
  background:
    linear-gradient(90deg, rgba(94, 239, 255, 0.22), rgba(255, 216, 118, 0.1)),
    rgba(3, 28, 37, 0.68);
  color: #effcff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 18px rgba(42, 221, 247, 0.12);
}

.profile-subtab-panel {
  display: grid;
  min-height: 0;
}

.profile-subtab-panel[hidden] {
  display: none;
}

.friend-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
  gap: 10px;
}

.friend-form .text-input,
.friend-form .mode-button {
  margin: 0;
}

body.is-authenticated:not(.match-active) .launcher-content .history-list {
  max-height: min(62vh, 720px);
  margin-top: 0;
}

body.is-authenticated:not(.match-active) .launcher-content .profile-history-grid .history-list {
  max-height: none;
  overflow: visible;
}

.launcher-content .history-item {
  border-color: rgba(196, 145, 61, 0.28);
  background:
    linear-gradient(90deg, rgba(196, 145, 61, 0.08), transparent 34%),
    rgba(1, 18, 24, 0.82);
}

body.is-authenticated:not(.match-active) .launcher-panel .reference-card,
body.is-authenticated:not(.match-active) .launcher-panel .history-item,
body.is-authenticated:not(.match-active) .launcher-panel .profile-progression > div:not(.profile-progress-bar):not(.profile-xp-bar),
body.is-authenticated:not(.match-active) .launcher-panel .profile-progress-bar,
body.is-authenticated:not(.match-active) .launcher-panel .player-profile-card,
body.is-authenticated:not(.match-active) .launcher-panel .lobby-player,
body.is-authenticated:not(.match-active) .launcher-panel .notification-item {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--reference-color, #dca643) 8%, transparent), transparent 62%),
    rgba(2, 15, 20, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 245, 199, 0.06), inset 0 0 24px rgba(34, 205, 231, 0.025);
}

body.is-authenticated:not(.match-active) .launcher-panel .reference-rarity,
body.is-authenticated:not(.match-active) .launcher-panel .reference-tier,
body.is-authenticated:not(.match-active) .launcher-panel .reference-tower-card,
body.is-authenticated:not(.match-active) .launcher-panel .trait-chip,
body.is-authenticated:not(.match-active) .launcher-panel .stat-pill,
body.is-authenticated:not(.match-active) .launcher-panel .reference-tower-summary,
body.is-authenticated:not(.match-active) .launcher-panel .text-input {
  background-color: rgba(1, 10, 14, 0.38);
}

.rank-badge {
  display: inline-grid;
  grid-template-columns: 20px minmax(0, auto) auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 26px;
  padding: 3px 7px 3px 3px;
  border: 1px solid color-mix(in srgb, var(--rank-color, #c6d4df) 58%, rgba(255, 248, 232, 0.14));
  border-radius: 999px;
  background: color-mix(in srgb, var(--rank-color, #c6d4df) 13%, rgba(0, 0, 0, 0.34));
  color: color-mix(in srgb, var(--rank-color, #c6d4df) 78%, #fff8e8);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
}

.rank-badge i {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--rank-color, #c6d4df) 32%, rgba(255, 255, 255, 0.08));
  color: #fff8e8;
  font-size: 0.62rem;
  font-style: normal;
}

.rank-badge strong,
.rank-badge small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-badge small {
  color: rgba(255, 248, 232, 0.68);
  font-size: 0.62rem;
}

.profile-avatar[data-rank-tier],
.score-card[class*="rank-"] .score-avatar {
  border-color: color-mix(in srgb, var(--rank-color, #c6d4df) 64%, rgba(255, 248, 232, 0.2));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--rank-color, #c6d4df) 24%, transparent),
    0 0 22px color-mix(in srgb, var(--rank-color, #c6d4df) 24%, transparent);
}

.leaderboard-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.leaderboard-list {
  display: grid;
  gap: 7px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(132px, auto);
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid rgba(196, 145, 61, 0.28);
  text-align: left;
}

.leaderboard-place {
  color: #efe0ad;
  font-size: 0.82rem;
  font-weight: 950;
}

.leaderboard-player {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.leaderboard-player strong,
.leaderboard-player em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-player em {
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 800;
}

.lobby-mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.lobby-mode-switch .mode-button {
  min-height: 30px;
  margin: 0;
  padding: 5px 10px;
}

.lobby-mode-switch .mode-button.is-selected {
  border-color: rgba(94, 239, 255, 0.7);
  color: #dffaff;
}

.lobby-mode-switch--locked {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.lobby-rank {
  max-width: 128px;
}

body.is-authenticated:not(.match-active) .launcher-panel .reference-card--tower,
body.is-authenticated:not(.match-active) .launcher-panel .reference-card--unit {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--rarity-color, #9fb4a6) 10%, transparent), transparent 62%),
    rgba(2, 15, 20, 0.48);
}

body.is-authenticated:not(.match-active) .play-actions {
  align-self: start;
  gap: clamp(7px, 0.9vh, 10px);
  padding: 10px;
  border: 1px solid rgba(255, 240, 190, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.08), transparent 48%),
    rgba(2, 13, 18, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 18px 42px rgba(0, 0, 0, 0.18);
}

body.is-authenticated:not(.match-active) .play-actions .primary-button,
body.is-authenticated:not(.match-active) .play-actions .mode-button,
body.is-authenticated:not(.match-active) .play-actions .danger-button {
  position: relative;
  overflow: visible;
  letter-spacing: 0;
}

body.is-authenticated:not(.match-active) .play-action-item {
  display: block;
  min-width: 0;
}

body.is-authenticated:not(.match-active) .play-action-item > button {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  margin-top: 0;
  width: 100%;
  padding: 10px 12px;
  text-align: center;
}

body.is-authenticated:not(.match-active) .queue-description {
  display: none !important;
}

body.is-authenticated:not(.match-active) .play-action-item > button::after {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: rgba(255, 248, 232, 0.68);
  font-size: 0.64rem;
  font-weight: 850;
  line-height: 1.18;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

body.is-authenticated:not(.match-active) .play-action-item--normal #queueNormalButton::after {
  content: "PvP libre - IA apres attente - XP profil";
}

body.is-authenticated:not(.match-active) .play-action-item--normal #queueNormalButton.is-queueing::after {
  content: "Recherche en cours - IA si la file reste vide";
}

body.is-authenticated:not(.match-active) .play-action-item--solo #queueSoloButton::after {
  content: "1 joueur + bots - test sans attente";
}

body.is-authenticated:not(.match-active) .play-action-item--tutorial #tutorialButton::after {
  content: "1 joueur - bases, economie, evolutions";
}

body.is-authenticated:not(.match-active) .play-action-item--lobby #createLobbyButton::after {
  content: "2-6 joueurs - groupe d'amis";
}

body.is-authenticated:not(.match-active) .play-action-item--ranked {
  order: 1;
}

body.is-authenticated:not(.match-active) .play-action-item--normal {
  order: 2;
}

body.is-authenticated:not(.match-active) .play-action-item--solo {
  order: 3;
}

body.is-authenticated:not(.match-active) .play-action-item--tutorial {
  order: 4;
}

body.is-authenticated:not(.match-active) .play-action-item--lobby {
  order: 6;
}

body.is-authenticated:not(.match-active) .play-actions #queueRankedButton {
  order: 1;
}

body.is-authenticated:not(.match-active) .play-actions #queueNormalButton {
  order: 2;
}

body.is-authenticated:not(.match-active) .play-actions #queueSoloButton {
  order: 3;
}

body.is-authenticated:not(.match-active) .play-actions #tutorialButton {
  order: 4;
}

body.is-authenticated:not(.match-active) .play-actions #queueTestButton {
  order: 5;
}

body.is-authenticated:not(.match-active) .play-actions #createLobbyButton {
  order: 6;
}

body.is-authenticated:not(.match-active) .play-actions #leaveQueueButton {
  order: 7;
}

body.is-authenticated:not(.match-active).is-in-ranked-queue .play-actions #leaveQueueButton,
body.is-authenticated:not(.match-active).is-in-normal-queue .play-actions #leaveQueueButton {
  order: 2;
}

body.is-authenticated:not(.match-active).is-in-ranked-queue .play-actions #queueNormalButton,
body.is-authenticated:not(.match-active).is-in-normal-queue .play-actions #queueRankedButton {
  order: 3;
}

body.is-authenticated:not(.match-active).pre-ranked-onboarding .play-action-item--solo,
body.is-authenticated:not(.match-active).pre-ranked-onboarding .play-actions #queueSoloButton {
  order: 1;
}

body.is-authenticated:not(.match-active).pre-ranked-onboarding .play-action-item--tutorial,
body.is-authenticated:not(.match-active).pre-ranked-onboarding .play-actions #tutorialButton {
  order: 2;
}

body.is-authenticated:not(.match-active).pre-ranked-onboarding .play-action-item--normal,
body.is-authenticated:not(.match-active).pre-ranked-onboarding .play-actions #queueNormalButton {
  order: 3;
}

body.is-authenticated:not(.match-active).pre-ranked-onboarding .play-action-item--lobby,
body.is-authenticated:not(.match-active).pre-ranked-onboarding .play-actions #createLobbyButton {
  order: 4;
}

body.is-authenticated:not(.match-active).pre-ranked-onboarding .play-action-item--ranked,
body.is-authenticated:not(.match-active).pre-ranked-onboarding .play-actions #queueRankedButton {
  order: 5;
}

body.is-authenticated:not(.match-active) .play-actions #queueNormalButton {
  min-height: clamp(58px, 6vh, 72px);
  border-width: 1px;
  border-color: rgba(94, 239, 255, 0.34);
  background:
    linear-gradient(90deg, rgba(34, 205, 231, 0.16), rgba(255, 216, 118, 0.06)),
    rgba(3, 18, 24, 0.46);
  color: #dffaff;
  font-size: 0.94rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 24px rgba(0, 0, 0, 0.2);
}

body.is-authenticated:not(.match-active).pre-ranked-onboarding .play-actions #queueSoloButton.is-recommended {
  min-height: 82px;
  justify-items: start;
  padding: 18px 18px 17px 54px;
  border-color: rgba(98, 234, 208, 0.82);
  background:
    linear-gradient(135deg, rgba(255, 240, 190, 0.16), transparent 32%),
    radial-gradient(circle at 95% 0, rgba(98, 234, 208, 0.28), transparent 38%),
    linear-gradient(110deg, rgba(13, 91, 90, 0.84), rgba(5, 33, 43, 0.9)),
    rgba(3, 18, 24, 0.86);
  color: #edfffb;
  font-size: 1rem;
  font-weight: 950;
  text-align: left;
  text-transform: uppercase;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.34),
    0 16px 34px rgba(0, 0, 0, 0.32),
    0 0 28px rgba(98, 234, 208, 0.18);
}

body.is-authenticated:not(.match-active).pre-ranked-onboarding .play-actions #queueSoloButton.is-recommended::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(220, 255, 249, 0.86);
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(220, 255, 249, 0.72) 0 22%, transparent 24%),
    rgba(98, 234, 208, 0.12);
  box-shadow: 0 0 18px rgba(98, 234, 208, 0.28);
  transform: translateY(-50%);
}

body.is-authenticated:not(.match-active).pre-ranked-onboarding .play-action-item--solo #queueSoloButton.is-recommended::after {
  content: "Recommande - 1 joueur + bots - sans attente";
  color: rgba(220, 255, 249, 0.82);
}

body.is-authenticated:not(.match-active) .play-actions .primary-button::before,
body.is-authenticated:not(.match-active) .play-actions #tutorialButton.is-recommended::before,
body.is-authenticated:not(.match-active) .play-actions #createLobbyButton::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 34%);
  opacity: 0.7;
}

body.is-authenticated:not(.match-active) .play-actions #createLobbyButton {
  border-color: rgba(75, 224, 245, 0.42);
  background:
    radial-gradient(circle at 18% 0, rgba(94, 239, 255, 0.2), transparent 38%),
    linear-gradient(90deg, rgba(25, 150, 174, 0.38), rgba(4, 30, 39, 0.72)),
    rgba(3, 18, 24, 0.7);
  color: #dffaff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 26px rgba(0, 0, 0, 0.22);
}

body.is-authenticated:not(.match-active) .play-actions #createLobbyButton.is-group-cta {
  border-color: rgba(94, 239, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 0 1px rgba(94, 239, 255, 0.1),
    0 12px 30px rgba(0, 0, 0, 0.26),
    0 0 24px rgba(42, 221, 247, 0.14);
}

body.is-authenticated:not(.match-active) .play-actions #queueRankedButton {
  display: grid;
  min-height: 84px;
  align-content: center;
  justify-items: start;
  padding: 18px 18px 17px 58px;
  border-color: rgba(255, 202, 96, 0.78);
  background:
    linear-gradient(135deg, rgba(255, 236, 176, 0.2), transparent 28%),
    radial-gradient(circle at 95% 0, rgba(255, 202, 96, 0.3), transparent 38%),
    linear-gradient(110deg, rgba(111, 54, 168, 0.82), rgba(31, 13, 52, 0.92)),
    rgba(15, 8, 28, 0.88);
  color: #fff7dc;
  font-size: 1.02rem;
  font-weight: 950;
  text-align: left;
  text-transform: uppercase;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.38),
    0 18px 38px rgba(0, 0, 0, 0.34),
    0 0 34px rgba(255, 202, 96, 0.2);
}

body.is-authenticated:not(.match-active) .play-actions #queueRankedButton::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 23px;
  height: 23px;
  border: 2px solid rgba(255, 240, 190, 0.84);
  border-radius: 4px;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.36), rgba(103, 224, 255, 0.24)),
    rgba(255, 202, 96, 0.1);
  box-shadow: 0 0 18px rgba(255, 202, 96, 0.32);
  transform: translateY(-50%) rotate(45deg);
}

body.is-authenticated:not(.match-active) .play-actions #queueRankedButton::after {
  content: "6 joueurs - points ranked - rang alpha";
  display: block;
  margin-top: 8px;
  color: rgba(255, 240, 190, 0.78);
  font-size: 0.7rem;
  font-weight: 850;
  line-height: 1.25;
  text-transform: none;
}

body.is-authenticated:not(.match-active) .play-actions #queueRankedButton:hover:not(:disabled),
body.is-authenticated:not(.match-active) .play-actions #queueRankedButton:focus-visible {
  border-color: rgba(255, 219, 122, 0.86);
  color: #fff9df;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 14px 34px rgba(0, 0, 0, 0.32),
    0 0 30px rgba(255, 202, 96, 0.22);
}

body.is-authenticated:not(.match-active) .play-actions #queueRankedButton.is-queueing::after {
  content: "Recherche en cours - 6 joueurs compatibles";
}

body.is-authenticated:not(.match-active) .play-action-item--ranked #queueRankedButton::after {
  content: "6 joueurs - points ranked - rang alpha";
}

body.is-authenticated:not(.match-active) .play-action-item--ranked #queueRankedButton.is-queueing::after {
  content: "Recherche en cours - IA alpha si besoin";
}

body.is-authenticated:not(.match-active).pre-ranked-onboarding .play-actions #queueRankedButton.is-onboarding-secondary {
  min-height: clamp(54px, 5.8vh, 68px);
  padding: 12px 14px 12px 44px;
  border-color: rgba(255, 216, 118, 0.28);
  background:
    linear-gradient(90deg, rgba(255, 216, 118, 0.08), rgba(94, 239, 255, 0.05)),
    rgba(3, 18, 24, 0.48);
  color: rgba(255, 248, 232, 0.78);
  font-size: 0.9rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 20px rgba(0, 0, 0, 0.16);
}

body.is-authenticated:not(.match-active).pre-ranked-onboarding .play-actions #queueRankedButton.is-onboarding-secondary::before {
  left: 16px;
  width: 16px;
  height: 16px;
  border-color: rgba(255, 240, 190, 0.48);
  opacity: 0.72;
  box-shadow: none;
}

body.is-authenticated:not(.match-active).pre-ranked-onboarding .play-action-item--ranked #queueRankedButton.is-onboarding-secondary::after {
  content: "Conseillé après 2 parties - IA alpha si besoin";
  margin-top: 5px;
  color: rgba(255, 240, 190, 0.58);
  font-size: 0.64rem;
}

body.is-authenticated:not(.match-active) .play-actions #queueRankedButton:disabled {
  border-color: rgba(255, 240, 190, 0.1);
  background: rgba(3, 12, 16, 0.3);
  color: rgba(255, 240, 190, 0.42);
  box-shadow: none;
}

body.is-authenticated:not(.match-active) .play-actions #queueNormalButton.is-queueing,
body.is-authenticated:not(.match-active) .play-actions #queueRankedButton.is-queueing,
body.is-authenticated:not(.match-active) .play-actions #queueRankedButton.is-queueing:disabled {
  border-color: rgba(255, 219, 122, 0.84);
  background:
    linear-gradient(135deg, rgba(255, 236, 176, 0.22), transparent 28%),
    radial-gradient(circle at 18% 0, rgba(255, 219, 122, 0.26), transparent 40%),
    linear-gradient(90deg, rgba(136, 73, 193, 0.62), rgba(50, 22, 79, 0.78)),
    rgba(16, 10, 28, 0.84);
  color: #fff9df;
  opacity: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 0 1px rgba(255, 219, 122, 0.12),
    0 14px 34px rgba(0, 0, 0, 0.3),
    0 0 32px rgba(255, 202, 96, 0.22);
}

body.is-authenticated:not(.match-active) .play-actions #queueNormalButton.is-queueing {
  border-color: rgba(94, 239, 255, 0.82);
  background:
    radial-gradient(circle at 18% 0, rgba(94, 239, 255, 0.22), transparent 40%),
    linear-gradient(90deg, rgba(31, 148, 169, 0.58), rgba(8, 50, 62, 0.76)),
    rgba(3, 18, 24, 0.78);
  color: #e8fcff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 14px 34px rgba(0, 0, 0, 0.28),
    0 0 28px rgba(42, 221, 247, 0.18);
}

body.is-authenticated:not(.match-active) .play-actions #leaveQueueButton {
  min-height: 42px;
  border-color: rgba(255, 110, 110, 0.32);
  background:
    linear-gradient(90deg, rgba(140, 31, 45, 0.52), rgba(42, 8, 14, 0.62)),
    rgba(24, 5, 9, 0.54);
  color: #ffd6d6;
  opacity: 0.42;
}

body.is-authenticated:not(.match-active) .play-actions #leaveQueueButton.is-relevant {
  opacity: 1;
  box-shadow: 0 0 20px rgba(255, 82, 82, 0.12);
}

body.is-authenticated:not(.match-active) .play-actions #leaveQueueButton:disabled {
  pointer-events: none;
}

body.is-authenticated:not(.match-active).has-active-lobby .play-actions #queueNormalButton {
  border-color: rgba(94, 239, 255, 0.9);
  background:
    radial-gradient(circle at 50% 0, rgba(242, 255, 247, 0.2), transparent 42%),
    linear-gradient(90deg, rgba(34, 205, 231, 0.44), rgba(12, 76, 88, 0.7)),
    rgba(3, 28, 37, 0.72);
  color: #effcff;
  box-shadow:
    0 0 0 1px rgba(94, 239, 255, 0.18),
    0 14px 38px rgba(0, 0, 0, 0.32),
    0 0 30px rgba(42, 221, 247, 0.22);
}

body.is-authenticated:not(.match-active).has-ready-lobby .play-actions #queueNormalButton {
  border-color: rgba(93, 230, 155, 0.92);
  background:
    radial-gradient(circle at 50% 0, rgba(230, 255, 241, 0.2), transparent 42%),
    linear-gradient(90deg, rgba(23, 143, 86, 0.62), rgba(9, 71, 48, 0.78)),
    rgba(7, 42, 30, 0.74);
  color: #effff6;
  box-shadow:
    0 0 0 1px rgba(93, 230, 155, 0.18),
    0 14px 38px rgba(0, 0, 0, 0.32),
    0 0 30px rgba(93, 230, 155, 0.22);
}

body.is-authenticated:not(.match-active) .lobby-empty-state {
  display: grid;
  min-height: 156px;
  align-content: center;
  justify-items: start;
  gap: 8px;
  border-color: rgba(94, 239, 255, 0.18);
  background:
    radial-gradient(circle at 12% 16%, rgba(94, 239, 255, 0.12), transparent 34%),
    linear-gradient(120deg, rgba(255, 216, 118, 0.08), transparent 42%),
    rgba(2, 15, 20, 0.42);
}

body.is-authenticated:not(.match-active) .lobby-empty-state span {
  display: block;
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

body.is-authenticated:not(.match-active) .lobby-empty-state strong {
  display: block;
  color: #fff7dc;
  font-size: 1.08rem;
}

body.is-authenticated:not(.match-active) .lobby-empty-state p {
  max-width: 56ch;
  margin: 0;
  color: rgba(239, 224, 173, 0.78);
  line-height: 1.38;
}

body.is-authenticated:not(.match-active) .lobby-room-card {
  border-color: rgba(94, 239, 255, 0.28);
  background:
    radial-gradient(circle at 12% 8%, rgba(94, 239, 255, 0.16), transparent 34%),
    linear-gradient(120deg, rgba(255, 216, 118, 0.1), transparent 46%),
    rgba(2, 15, 20, 0.56);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 199, 0.08),
    0 16px 34px rgba(0, 0, 0, 0.2);
}

body.is-authenticated:not(.match-active) .lobby-room-card.is-self-ready {
  border-color: rgba(93, 230, 155, 0.36);
}

body.is-authenticated:not(.match-active) .lobby-room-card.is-all-ready {
  border-color: rgba(255, 231, 150, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 199, 0.12),
    0 16px 36px rgba(0, 0, 0, 0.24),
    0 0 28px rgba(255, 211, 109, 0.16);
}

body.is-authenticated:not(.match-active) .lobby-room-head > div {
  display: grid;
  gap: 3px;
}

body.is-authenticated:not(.match-active) .lobby-room-head > div > span {
  width: fit-content;
  padding: 0;
  border: 0;
  color: rgba(94, 239, 255, 0.82);
  font-size: 0.64rem;
  letter-spacing: 0;
}

body.is-authenticated:not(.match-active) .lobby-room-head > span {
  border-color: rgba(255, 231, 150, 0.5);
  background: rgba(95, 57, 5, 0.34);
}

body.is-authenticated:not(.match-active) .lobby-ready-summary {
  border-color: rgba(93, 230, 155, 0.36);
  background:
    linear-gradient(90deg, rgba(93, 230, 155, 0.14), transparent 62%),
    rgba(9, 31, 23, 0.52);
}

body.is-authenticated:not(.match-active) .lobby-player {
  border-color: rgba(255, 240, 190, 0.1);
  background: rgba(3, 14, 18, 0.48);
}

body.is-authenticated:not(.match-active) .lobby-player.is-you {
  border-color: rgba(94, 239, 255, 0.46);
  box-shadow: inset 3px 0 0 rgba(94, 239, 255, 0.62);
}

body.is-authenticated:not(.match-active) .lobby-player.is-ready {
  border-color: rgba(93, 230, 155, 0.56);
  background:
    linear-gradient(90deg, rgba(93, 230, 155, 0.14), transparent 54%),
    rgba(13, 55, 37, 0.56);
}

body.is-authenticated:not(.match-active) .lobby-leave-button {
  min-height: 38px;
}

.profile-history-grid #historyList {
  gap: 0;
  max-height: none;
  overflow: visible;
  border: 1px solid rgba(196, 145, 61, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.04), transparent 54%),
    rgba(1, 10, 14, 0.34);
}

.history-match-entry {
  display: grid;
  min-width: 0;
}

.history-table-head,
.match-history-item {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(78px, 0.74fr) minmax(170px, 1.9fr) minmax(42px, 0.42fr) minmax(68px, 0.66fr) minmax(72px, 0.72fr) minmax(58px, 0.58fr) minmax(74px, 0.7fr) minmax(74px, 0.62fr);
  gap: 8px;
  align-items: center;
}

.history-table-head span:nth-child(8),
.match-history-item .history-date {
  display: none;
}

.history-table-head {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 32px;
  padding: 0 12px 0 14px;
  border-bottom: 1px solid rgba(255, 240, 190, 0.12);
  background:
    linear-gradient(180deg, rgba(14, 28, 31, 0.98), rgba(3, 13, 17, 0.96));
  color: rgba(255, 226, 160, 0.78);
  font-size: 0.62rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0;
}

.match-history-item {
  position: relative;
  width: 100%;
  min-height: 74px;
  padding: 10px 12px 10px 14px;
  border: 0;
  border-bottom: 1px solid rgba(255, 240, 190, 0.09);
  border-radius: 0;
  color: var(--muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.history-match-entry.is-open .match-history-item {
  position: sticky;
  top: 32px;
  z-index: 4;
  border-bottom-color: rgba(94, 239, 255, 0.22);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--result-color, #dca643) 16%, transparent), transparent 48%),
    linear-gradient(180deg, rgba(7, 32, 38, 0.98), rgba(3, 18, 22, 0.98));
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.24);
}

.history-match-entry:last-child .match-history-item:not(.is-selected) {
  border-bottom: 0;
}

.match-history-item::before,
.match-detail-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--result-color, rgba(220, 170, 77, 0.7));
  box-shadow: 0 0 18px color-mix(in srgb, var(--result-color, #dca643) 62%, transparent);
}

.match-history-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  pointer-events: none;
}

.match-history-item:hover,
.match-history-item.is-selected {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--result-color, #dca643) 12%, transparent), transparent 48%),
    rgba(6, 25, 30, 0.68);
}

.match-history-item:hover .history-toggle,
.match-history-item:focus-visible .history-toggle,
.match-history-item.is-selected .history-toggle {
  border-color: rgba(94, 239, 255, 0.7);
  background: rgba(7, 45, 54, 0.82);
  color: #e7fbff;
}

.match-history-item.is-selected::after {
  border-color: rgba(94, 239, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(94, 239, 255, 0.16), 0 0 22px rgba(94, 239, 255, 0.08);
}

.match-history-item:focus-visible {
  outline: 2px solid rgba(94, 239, 255, 0.78);
  outline-offset: -2px;
}

.history-result {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--result-color, #dca643);
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.history-result strong {
  color: var(--result-color, #dca643);
  font-size: 0.74rem;
  line-height: 1;
}

.history-result small {
  color: rgba(255, 248, 232, 0.62);
  font-size: 0.64rem;
  font-weight: 900;
}

.history-match-summary {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.history-match-summary > strong {
  min-width: 0;
  overflow: hidden;
  color: #fff8e8;
  font-size: 0.86rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-mini-build {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.history-mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 142px;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--history-chip-color, #d7a94a) 42%, rgba(255, 240, 190, 0.12));
  border-radius: 5px;
  background: rgba(3, 10, 12, 0.56);
  color: color-mix(in srgb, var(--history-chip-color, #d7a94a) 70%, #fff8e8);
  font-size: 0.62rem;
  font-weight: 850;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-mini-chip em {
  color: rgba(255, 248, 232, 0.74);
  font-style: normal;
  font-weight: 950;
}

.history-mini-chip.is-empty {
  border-style: dashed;
  color: rgba(199, 215, 203, 0.56);
}

.history-mini-chip--map {
  border-color: rgba(98, 234, 208, 0.42);
  background:
    linear-gradient(180deg, rgba(98, 234, 208, 0.12), transparent 66%),
    rgba(3, 10, 12, 0.7);
  color: #dffaff;
}

.open-room-item,
.social-item,
.request-item,
.notification-item {
  display: grid;
  gap: 10px;
}

.open-room-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.open-room-item div,
.social-meta {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.open-room-item span,
.social-meta span,
.notification-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.open-room-item p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.social-item,
.request-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.social-item.is-online .social-meta span {
  color: var(--green);
}

.social-item.is-offline {
  opacity: 0.72;
}

.item-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: end;
  gap: 8px;
}

.request-item .item-actions,
.notification-item .item-actions {
  min-width: min(260px, 42%);
}

.item-actions .mode-button,
.item-actions .primary-button,
.item-actions .danger-button {
  min-width: 64px;
  min-height: 34px;
  margin: 0;
  padding: 0 14px;
  white-space: nowrap;
}

.history-round,
.history-score,
.history-defense,
.history-economy,
.history-points,
.history-date {
  min-width: 0;
  color: rgba(255, 248, 232, 0.86);
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.18;
  white-space: nowrap;
}

.history-round {
  color: #f0d489;
}

.history-score {
  color: #fff8e8;
  font-size: 0.88rem;
}

.history-defense {
  color: #a8ddff;
}

.history-economy {
  color: #f4cf5a;
}

.history-points {
  display: grid;
  gap: 3px;
  color: var(--result-color, #dca643);
}

.history-points small,
.history-date small {
  color: rgba(199, 215, 203, 0.68);
  font-size: 0.62rem;
  font-weight: 850;
}

.history-date {
  display: grid;
  gap: 3px;
  color: rgba(255, 248, 232, 0.78);
}

.history-date strong {
  color: rgba(255, 248, 232, 0.9);
  font-size: 0.76rem;
}

.history-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 240, 190, 0.2);
  border-radius: 6px;
  background: rgba(3, 10, 12, 0.58);
  color: rgba(255, 248, 232, 0.78);
  font-size: 0.66rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease;
}

.history-toggle::after {
  content: ">";
  margin-left: 7px;
  color: currentColor;
  font-size: 0.76rem;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 140ms ease;
}

.match-history-item.is-selected .history-toggle::after {
  transform: rotate(-90deg);
}

.history-expanded-panel {
  box-sizing: border-box;
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px 14px;
  border-bottom: 1px solid rgba(255, 240, 190, 0.12);
  background:
    linear-gradient(180deg, rgba(94, 239, 255, 0.055), transparent 36%),
    rgba(1, 9, 12, 0.68);
}

.history-expanded-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 2px 0 4px;
  color: rgba(255, 248, 232, 0.68);
  font-size: 0.72rem;
  font-weight: 850;
}

.history-expanded-head strong {
  color: #fff8e8;
  font-size: 0.86rem;
}

.history-expanded-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 1600px) {
  .history-table-head,
  .match-history-item {
    grid-template-columns: minmax(86px, 0.78fr) minmax(190px, 1.9fr) minmax(44px, 0.48fr) minmax(72px, 0.72fr) minmax(78px, 0.78fr) minmax(62px, 0.62fr) minmax(82px, 0.78fr) minmax(72px, 0.62fr) minmax(74px, 0.58fr);
  }

  .history-table-head span:nth-child(8),
  .match-history-item .history-date {
    display: grid;
  }
}

.match-detail-item {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 6px 10px;
  padding-left: 14px;
}

.match-detail-item span {
  color: var(--muted);
  font-size: 0.78rem;
}

.match-detail-item .history-telemetry,
.match-detail-item .history-run-insight,
.match-detail-item .history-build,
.match-detail-item .history-board,
.match-detail-item .history-board-empty {
  grid-column: 1 / -1;
}

.history-match-overview,
.history-map-overview,
.history-run-insight {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(94, 239, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(94, 239, 255, 0.08), transparent 56%),
    rgba(2, 12, 15, 0.58);
}

.history-match-overview {
  padding: 10px;
}

.history-map-overview {
  padding: 10px 12px;
  border-color: rgba(98, 234, 208, 0.24);
  background:
    linear-gradient(135deg, rgba(98, 234, 208, 0.12), transparent 58%),
    rgba(2, 12, 15, 0.68);
}

.history-map-overview small {
  color: rgba(159, 247, 255, 0.72);
  font-size: 0.58rem;
  font-weight: 950;
  text-transform: uppercase;
}

.history-map-overview strong {
  color: #fff8e8;
  font-size: 0.9rem;
  font-weight: 950;
}

.history-map-overview p {
  margin: 0;
  color: rgba(226, 234, 220, 0.78);
  font-size: 0.74rem;
  line-height: 1.35;
}

.history-match-overview > strong,
.history-run-insight > strong {
  color: #fff8e8;
  font-size: 0.78rem;
  font-weight: 950;
}

.history-match-overview > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 6px;
}

.history-match-overview span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(255, 240, 190, 0.1);
  border-radius: 7px;
  background: rgba(3, 7, 6, 0.38);
}

.history-match-overview small {
  color: rgba(255, 248, 232, 0.58);
  font-size: 0.58rem;
  font-weight: 950;
  text-transform: uppercase;
}

.history-match-overview b {
  min-width: 0;
  overflow: hidden;
  color: #dffaff;
  font-size: 0.72rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-run-insight {
  padding: 9px;
  border-color: rgba(255, 216, 118, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 216, 118, 0.08), transparent 58%),
    rgba(3, 10, 12, 0.55);
}

.history-run-insight p {
  margin: 0;
  color: rgba(255, 248, 232, 0.84);
  font-size: 0.76rem;
  line-height: 1.35;
}

.history-run-insight span {
  color: rgba(199, 215, 203, 0.78);
  font-size: 0.7rem;
  line-height: 1.32;
}

.history-telemetry {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.history-telemetry span {
  display: inline-grid;
  gap: 1px;
  min-width: 58px;
  padding: 4px 6px;
  border: 1px solid rgba(255, 240, 190, 0.12);
  border-radius: 7px;
  background: rgba(3, 7, 6, 0.42);
}

.history-telemetry small {
  color: rgba(199, 215, 203, 0.66);
  font-size: 0.58rem;
  font-weight: 900;
  text-transform: uppercase;
}

.history-telemetry b {
  min-width: 0;
  overflow: hidden;
  color: #fff3cf;
  font-size: 0.68rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-board {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin-top: 2px;
}

.history-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.history-board-head strong {
  color: #fff8e8;
  font-size: 0.68rem;
}

.history-board-grid {
  display: grid;
  width: 100%;
  max-width: min(760px, 100%);
  aspect-ratio: 18 / 8;
  overflow: hidden;
  border: 1px solid rgba(255, 240, 190, 0.12);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.28);
}

.history-board-grid i,
.history-board-tower {
  min-width: 0;
  min-height: 0;
}

.history-board-grid i {
  border-right: 1px solid rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid rgba(255, 255, 255, 0.025);
  background: rgba(255, 248, 232, 0.025);
}

.history-board-grid i.is-path {
  background: rgba(242, 184, 75, 0.18);
}

.history-build {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.history-build section {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.history-build small {
  color: rgba(255, 248, 232, 0.54);
  font-size: 0.58rem;
  font-weight: 950;
  text-transform: uppercase;
}

.history-build section > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.history-build-chip {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px 6px;
  min-width: 0;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--history-chip-color, #d7a94a) 46%, rgba(255, 240, 190, 0.12));
  border-radius: 7px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--history-chip-color, #d7a94a) 12%, transparent), transparent),
    rgba(3, 7, 6, 0.5);
  color: #fff8e8;
}

.history-build-chip i {
  grid-row: 1 / 3;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: color-mix(in srgb, var(--history-chip-color, #d7a94a) 76%, #fff8e8);
}

.history-build-chip i svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: currentColor;
}

.history-build-chip strong,
.history-build-chip em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-build-chip strong {
  font-size: 0.68rem;
  font-weight: 950;
}

.history-build-chip em {
  color: color-mix(in srgb, var(--history-chip-color, #d7a94a) 70%, #fff8e8);
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 900;
}

.history-build-chip--augment {
  grid-template-columns: minmax(0, 1fr);
}

.history-build-empty {
  color: var(--muted);
  font-size: 0.68rem;
}

.history-board-tower {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 96%;
  height: 96%;
  margin: auto;
  border: 1px solid rgba(98, 234, 208, 0.45);
  border-radius: 4px;
  background: rgba(8, 36, 32, 0.92);
  color: #dcfff7;
  font-size: 0.58rem;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 0 8px rgba(98, 234, 208, 0.2);
}

.history-board-tower img {
  display: block;
  width: 126%;
  height: 126%;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
  pointer-events: none;
}

.history-board-tower strong {
  font-size: 0.58rem;
  font-weight: 950;
}

.history-board-tower em {
  position: absolute;
  top: 1px;
  left: 1px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #b87333;
  font-size: 0.42rem;
  font-style: normal;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 4px currentColor;
  pointer-events: none;
}

.history-board-tower.is-star-1 em {
  color: #c9824b;
}

.history-board-tower.is-star-2 {
  border-color: rgba(242, 184, 75, 0.62);
  background: rgba(48, 31, 9, 0.94);
  color: #ffe1a1;
}

.history-board-tower.is-star-2 em {
  color: #d7e1ec;
}

.history-board-tower.is-star-3 {
  border-color: rgba(197, 128, 255, 0.7);
  background: rgba(42, 17, 55, 0.95);
  color: #f1d2ff;
}

.history-board-tower.is-star-3 em {
  color: #ffd86b;
}

.history-board-empty {
  padding: 8px;
  border: 1px dashed rgba(255, 240, 190, 0.14);
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.72rem;
}

.history-rank {
  color: var(--result-color, #dca643) !important;
  font-weight: 950;
}

.is-win {
  --result-color: #79e35e;
  border-color: rgba(121, 227, 94, 0.34) !important;
}

.is-neutral {
  --result-color: #dca643;
}

.is-loss {
  --result-color: #ff4f58;
  border-color: rgba(255, 79, 88, 0.34) !important;
}

.admin-output h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 8px;
  color: #e6bd69;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.admin-output h3 span {
  color: var(--muted);
  font-size: 0.74rem;
}

.admin-list-item {
  max-height: 92px;
  overflow: hidden;
}

.admin-output {
  max-height: 360px;
  overflow: auto;
  padding: 10px;
  border-radius: 8px;
  background: rgba(7, 11, 9, 0.64);
  color: var(--muted);
  font-size: 0.75rem;
}

.admin-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-filter-row .mode-button {
  width: auto;
  min-height: 30px;
  margin: 0;
  padding: 6px 10px;
  font-size: 0.72rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.admin-analytics-summary {
  margin-bottom: 10px;
}

.admin-analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.admin-event-frequency {
  display: grid;
  gap: 7px;
}

.admin-event-frequency-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: center;
}

.admin-event-frequency-row div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.admin-event-frequency-row strong,
.admin-event-frequency-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-event-frequency-row strong {
  color: #fff8e8;
  font-size: 0.78rem;
}

.admin-event-frequency-row small,
.admin-event-frequency-row span {
  color: rgba(219, 229, 220, 0.7);
  font-size: 0.68rem;
}

.admin-event-frequency-row i {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 240, 190, 0.1);
}

.admin-event-frequency-row i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #62ead0, #ffd86f);
}

.admin-event-log {
  margin-top: 12px;
  border: 1px solid rgba(255, 240, 190, 0.12);
  border-radius: 8px;
  background: rgba(2, 13, 18, 0.34);
}

.admin-event-log summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  color: #efe0ad;
  cursor: pointer;
  font-weight: 950;
  text-transform: uppercase;
}

.admin-event-log summary span {
  color: rgba(219, 229, 220, 0.72);
}

.admin-event-log-list {
  display: grid;
  gap: 7px;
  padding: 0 10px 10px;
}

.admin-event-card,
.admin-event-row {
  display: grid;
  gap: 4px;
}

.admin-event-card span,
.admin-event-row span,
.admin-event-row small,
.admin-event-row em {
  min-width: 0;
  overflow: hidden;
  color: rgba(219, 229, 220, 0.72);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.barracks {
  max-height: 430px;
  overflow: auto;
  padding-right: 3px;
}

.locked-class strong {
  display: block;
  margin-top: 10px;
  color: var(--cyan);
  font-size: 1.1rem;
}

.stats-panel {
  margin-top: auto;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  min-width: 0;
  padding: 9px 0;
  border-bottom: 1px solid rgba(151, 184, 211, 0.12);
  color: var(--muted);
}

.stat-row:last-child {
  border-bottom: 0;
}

.stat-row strong {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
}

.stat-row--bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  grid-column: 1 / -1;
}

.stat-row--bar .resource-bar {
  grid-column: 1 / -1;
}

.resource-bar {
  position: relative;
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 240, 190, 0.16);
  border-radius: 999px;
  background: rgba(3, 7, 5, 0.74);
}

.resource-bar > span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  transition: width 180ms ease;
}

.resource-bar--life > span {
  background: linear-gradient(90deg, #d93d4c, #ff8b84);
}

.resource-bar--xp > span {
  background: linear-gradient(90deg, #58d68d, #9ff7ff);
}

.game-area {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px;
  gap: 14px;
}

body.match-active .game-area {
  height: 100vh;
  padding: 10px;
  gap: 8px;
  overflow: hidden;
}

.game-area[hidden] {
  display: none;
}

.desktop-trait-rail {
  display: none;
}

body.match-active:not(.mobile-ui) .desktop-trait-rail {
  position: absolute;
  top: 110px;
  left: 10px;
  z-index: 34;
  display: grid;
  gap: 6px;
  width: 148px;
  max-height: calc(100vh - 168px);
  padding: 4px;
  overflow: visible;
  contain: layout style;
  pointer-events: none;
}

body.match-active:not(.mobile-ui) .desktop-trait-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  width: 136px;
  height: 34px;
  padding: 4px 18px 4px 5px;
  border: 1px solid color-mix(in srgb, var(--trait-color, #d7a94a) 54%, rgba(255, 240, 190, 0.14));
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--trait-color, #d7a94a) 16%, transparent), transparent 70%),
    rgba(1, 10, 14, 0.58);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  opacity: 0.72;
  pointer-events: auto;
  transition: opacity 120ms ease, transform 120ms ease, border-color 120ms ease;
}

body.match-active:not(.mobile-ui) .desktop-trait-item.is-active {
  opacity: 0.9;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--trait-color, #d7a94a) 18%, transparent), 0 8px 18px rgba(0, 0, 0, 0.26);
}

body.match-active:not(.mobile-ui) .desktop-trait-item:hover,
body.match-active:not(.mobile-ui) .desktop-trait-item:focus-visible {
  z-index: 2;
  opacity: 1;
  transform: translateX(2px);
  border-color: color-mix(in srgb, var(--trait-color, #d7a94a) 74%, rgba(255, 248, 232, 0.28));
  outline: none;
}

body.match-active:not(.mobile-ui) .desktop-trait-item > .trait-icon {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
  justify-self: center;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--trait-color, #d7a94a) 76%, #fff8e8);
}

body.match-active:not(.mobile-ui) .desktop-trait-item > .trait-icon svg {
  width: 18px;
  height: 18px;
}

body.match-active:not(.mobile-ui) .desktop-trait-name {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 248, 232, 0.82);
  font-size: 0.66rem;
  font-weight: 950;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.match-active:not(.mobile-ui) .desktop-trait-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  min-width: 16px;
  height: 16px;
  place-items: center;
  padding: 0 4px;
  border: 1px solid color-mix(in srgb, var(--trait-color, #d7a94a) 62%, rgba(255, 248, 232, 0.18));
  border-radius: 999px;
  background: rgba(3, 7, 5, 0.92);
  color: #fff8e8;
  font-size: 0.56rem;
  font-weight: 950;
  line-height: 1;
}

body.match-active:not(.mobile-ui) .desktop-trait-popover {
  position: absolute;
  top: 0;
  left: calc(100% + 10px);
  display: none;
  width: min(380px, calc(100vw - 420px));
  max-height: min(70vh, 620px);
  padding: 12px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  contain: layout paint style;
  -webkit-overflow-scrolling: touch;
  border: 1px solid color-mix(in srgb, var(--trait-color, #d7a94a) 56%, rgba(255, 240, 190, 0.16));
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--trait-color, #d7a94a) 12%, transparent), transparent 42%),
    rgba(1, 10, 14, 0.96);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  cursor: default;
}

body.match-active:not(.mobile-ui) .desktop-trait-page-button {
  width: 48px;
  height: 28px;
  justify-self: start;
  border: 1px solid rgba(255, 240, 190, 0.16);
  border-radius: 999px;
  background: rgba(1, 10, 14, 0.62);
  color: rgba(255, 248, 232, 0.76);
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 950;
  pointer-events: auto;
  transition: border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

body.match-active:not(.mobile-ui) .desktop-trait-page-button:hover,
body.match-active:not(.mobile-ui) .desktop-trait-page-button:focus-visible {
  color: #fff8e8;
  border-color: rgba(255, 248, 232, 0.34);
  outline: none;
  transform: translateX(2px);
}

body.match-active:not(.mobile-ui) .desktop-trait-item:hover .desktop-trait-popover,
body.match-active:not(.mobile-ui) .desktop-trait-item:focus-visible .desktop-trait-popover,
body.match-active:not(.mobile-ui) .desktop-trait-popover:hover {
  display: grid;
  gap: 10px;
}

.desktop-trait-damage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.desktop-trait-damage span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.desktop-trait-damage strong {
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 950;
}

body.match-active:not(.mobile-ui) .desktop-trait-popover header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

body.match-active:not(.mobile-ui) .desktop-trait-popover header .trait-icon {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
}

body.match-active:not(.mobile-ui) .desktop-trait-popover h3,
body.match-active:not(.mobile-ui) .desktop-trait-popover h4,
body.match-active:not(.mobile-ui) .desktop-trait-popover p {
  margin: 0;
}

body.match-active:not(.mobile-ui) .desktop-trait-popover header span,
body.match-active:not(.mobile-ui) .desktop-trait-popover header em,
body.match-active:not(.mobile-ui) .desktop-trait-popover h4 {
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

body.match-active:not(.mobile-ui) .desktop-trait-popover h3 {
  color: #fff8e8;
  font-size: 1rem;
}

body.match-active:not(.mobile-ui) .desktop-trait-popover p {
  color: rgba(255, 248, 232, 0.78);
  font-size: 0.78rem;
  line-height: 1.35;
}

body.match-active:not(.mobile-ui) .desktop-trait-popover section {
  display: grid;
  gap: 6px;
}

body.match-active:not(.mobile-ui) .desktop-trait-tiers {
  display: grid;
  gap: 6px;
}

body.match-active:not(.mobile-ui) .desktop-trait-next,
body.match-active:not(.mobile-ui) .desktop-trait-requirements {
  display: grid;
  gap: 6px;
}

body.match-active:not(.mobile-ui) .desktop-trait-requirements .trait-requirement {
  padding: 6px 7px;
  border-color: rgba(255, 240, 190, 0.12);
  background: rgba(2, 9, 12, 0.54);
  font-size: 0.68rem;
}

body.match-active:not(.mobile-ui) .desktop-trait-requirements .trait-requirement--complete {
  border-color: color-mix(in srgb, var(--trait-color, #d7a94a) 42%, rgba(98, 234, 208, 0.28));
  color: #9ff7ff;
}

body.match-active:not(.mobile-ui) .desktop-trait-tier {
  display: grid;
  grid-template-columns: 64px 64px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(255, 240, 190, 0.1);
  border-radius: 7px;
  background: rgba(2, 9, 12, 0.5);
  opacity: 0.56;
}

body.match-active:not(.mobile-ui) .desktop-trait-tier.is-active {
  border-color: color-mix(in srgb, var(--trait-color, #d7a94a) 48%, rgba(98, 234, 208, 0.24));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--trait-color, #d7a94a) 16%, transparent), transparent 58%),
    rgba(2, 9, 12, 0.68);
  opacity: 1;
}

body.match-active:not(.mobile-ui) .desktop-trait-tier.is-next {
  opacity: 0.82;
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--trait-color, #d7a94a) 64%, #fff8e8);
}

body.match-active:not(.mobile-ui) .desktop-trait-tier span,
body.match-active:not(.mobile-ui) .desktop-trait-tier strong {
  color: color-mix(in srgb, var(--trait-color, #d7a94a) 64%, #fff8e8);
  font-size: 0.7rem;
  font-weight: 950;
}

body.match-active:not(.mobile-ui) .desktop-trait-tier em {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 248, 232, 0.76);
  font-size: 0.68rem;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.match-active:not(.mobile-ui) .desktop-trait-towers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

body.match-active:not(.mobile-ui) .desktop-trait-tower {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 5px;
  border: 1px solid color-mix(in srgb, var(--rarity-color, #9fb4a6) 42%, rgba(255, 240, 190, 0.12));
  border-radius: 7px;
  background: rgba(4, 10, 12, 0.56);
}

body.match-active:not(.mobile-ui) .desktop-trait-tower .choice-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

body.match-active:not(.mobile-ui) .desktop-trait-tower strong {
  min-width: 0;
  overflow: hidden;
  color: #fff8e8;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.match-active:not(.mobile-ui) .desktop-trait-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

body.mobile-ui.match-active .desktop-trait-rail {
  display: none !important;
}

.topbar,
.hintbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-panel {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.045), transparent),
    var(--panel);
  backdrop-filter: blur(12px);
}

body.match-active .chat-panel {
  flex: 0 0 auto;
  padding: 8px 10px;
}

.chat-log {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 110px;
  max-height: 180px;
  overflow: auto;
  padding: 8px;
  border-radius: 8px;
  background: rgba(7, 11, 9, 0.78);
  color: var(--muted);
  font-size: 0.86rem;
}

body.match-active .chat-log {
  min-height: 54px;
  max-height: 76px;
  padding: 7px;
  font-size: 0.8rem;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 8px;
  margin-top: 8px;
}

body.match-active .chat-form {
  grid-template-columns: 1fr 96px;
  gap: 7px;
  margin-top: 7px;
}

body.match-active .chat-form .text-input {
  min-height: 36px;
  margin-bottom: 0;
}

body.match-active #chatSendButton {
  min-height: 36px;
  margin-top: 0;
}

.chat-panel .danger-button {
  margin-top: 8px;
}

body.match-active .chat-panel .danger-button {
  min-height: 36px;
  margin-top: 7px;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 10px;
  width: 100%;
}

body.match-active .scoreboard {
  grid-template-columns: repeat(6, minmax(170px, 1fr));
  gap: 8px;
}

.score-card {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(215, 169, 74, 0.25);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.1), transparent 56%),
    linear-gradient(90deg, color-mix(in srgb, var(--player-color, var(--gold)) 22%, transparent), transparent 46%),
    radial-gradient(circle at 10% 32%, color-mix(in srgb, var(--player-color, var(--gold)) 18%, transparent), transparent 38%),
    rgba(9, 14, 11, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 240, 190, 0.1), inset 0 -1px 0 rgba(0, 0, 0, 0.55), 0 0 0 1px color-mix(in srgb, var(--player-color, var(--gold)) 18%, transparent), 0 12px 34px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  cursor: pointer;
}

.score-card:hover,
.score-card:focus-visible {
  border-color: color-mix(in srgb, var(--player-color, var(--gold)) 68%, rgba(255, 240, 190, 0.28));
  box-shadow: inset 0 1px 0 rgba(255, 240, 190, 0.16), inset 0 -1px 0 rgba(0, 0, 0, 0.55), 0 0 0 2px color-mix(in srgb, var(--player-color, var(--gold)) 24%, transparent), 0 14px 34px rgba(0, 0, 0, 0.26);
}

.score-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-left: 5px solid color-mix(in srgb, var(--player-color, var(--gold)) 86%, transparent);
  opacity: 0.9;
  pointer-events: none;
}

.score-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--player-color, var(--gold)), transparent 72%);
  opacity: 0.9;
  pointer-events: none;
}

body.match-active .score-card {
  min-height: 58px;
  padding: 7px 10px;
}

body.match-active .score-name {
  font-size: 0.72rem;
}

body.match-active .score-values {
  gap: 8px;
  margin-top: 4px;
  font-size: 0.92rem;
}

.score-card.is-human {
  border-color: color-mix(in srgb, var(--player-color, var(--gold)) 46%, rgba(98, 234, 208, 0.28));
}

.score-card.is-local {
  border-color: color-mix(in srgb, var(--player-color, var(--gold)) 74%, rgba(255, 240, 190, 0.24));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--player-color, var(--gold)) 28%, transparent), 0 0 24px color-mix(in srgb, var(--player-color, var(--gold)) 18%, transparent), 0 12px 34px rgba(0, 0, 0, 0.22);
}

.score-card.is-observed {
  border-color: color-mix(in srgb, var(--player-color, var(--gold)) 88%, #fff8e8);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--player-color, var(--gold)) 42%, transparent),
    0 0 22px color-mix(in srgb, var(--player-color, var(--gold)) 26%, transparent),
    0 12px 34px rgba(0, 0, 0, 0.24);
}

body.spectator-mode .score-card.is-observed::after {
  height: 5px;
  opacity: 1;
}

.score-card.is-dead {
  filter: grayscale(1);
  opacity: 0.58;
}

body.match-active.shuffle-active .score-card:not(.is-dead) {
  animation: score-shuffle-pulse 760ms ease-in-out 2;
}

body.match-active.shuffle-active .canvas-wrap::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 34;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 42%, rgba(242, 184, 75, 0.16) 48%, rgba(98, 234, 208, 0.14) 52%, transparent 58% 100%);
  mix-blend-mode: screen;
  animation: shuffle-screen-sweep 1150ms ease-out both;
}

@keyframes score-shuffle-pulse {
  0%,
  100% {
    transform: translateY(0);
    border-color: rgba(215, 169, 74, 0.25);
  }
  42% {
    transform: translateY(-2px);
    border-color: rgba(242, 184, 75, 0.84);
    box-shadow:
      inset 0 1px 0 rgba(255, 240, 190, 0.2),
      inset 0 -1px 0 rgba(0, 0, 0, 0.55),
      0 0 0 2px rgba(242, 184, 75, 0.22),
      0 14px 34px rgba(0, 0, 0, 0.26);
  }
}

@keyframes shuffle-screen-sweep {
  0% {
    opacity: 0;
    transform: translateX(-42%);
  }
  22% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(42%);
  }
}

.score-avatar {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto auto;
  gap: 1px;
  width: 38px;
  height: 38px;
  align-content: center;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff4d5;
  font-weight: 950;
  line-height: 1;
  overflow: visible;
}

.score-avatar::before {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: 1;
  border: 1px solid rgba(255, 240, 190, 0.24);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.28), transparent 24%),
    radial-gradient(circle at 50% 62%, color-mix(in srgb, var(--player-color) 38%, transparent), transparent 48%),
    linear-gradient(145deg, rgba(34, 25, 13, 0.96), rgba(6, 10, 8, 0.98));
  box-shadow:
    inset 0 -8px 14px rgba(0, 0, 0, 0.35),
    0 0 10px color-mix(in srgb, var(--player-color) 24%, transparent);
}

.score-rank-frame {
  --rank-frame-mask: url("assets/ranks/avatar-frame-division-1.svg");
  --rank-frame-scale: 0.9;
  position: absolute;
  inset: -10px;
  z-index: 0;
  background:
    radial-gradient(circle at 34% 18%, rgba(255, 255, 255, 0.82), transparent 17%),
    linear-gradient(135deg,
      color-mix(in srgb, var(--rank-color, #c6d4df) 86%, #fff8e8),
      color-mix(in srgb, var(--rank-color, #c6d4df) 62%, #101922) 54%,
      color-mix(in srgb, var(--rank-color, #c6d4df) 92%, #ffd86f));
  filter:
    drop-shadow(0 0 4px color-mix(in srgb, var(--rank-color, #c6d4df) 54%, transparent))
    drop-shadow(0 3px 5px rgba(0, 0, 0, 0.56));
  mask: var(--rank-frame-mask) center / contain no-repeat;
  opacity: 0.96;
  pointer-events: none;
  transform: scale(var(--rank-frame-scale));
  -webkit-mask: var(--rank-frame-mask) center / contain no-repeat;
}

.score-card[data-rank-division="1"] .score-rank-frame {
  --rank-frame-mask: url("assets/ranks/avatar-frame-division-1.svg");
  --rank-frame-scale: 0.88;
}

.score-card[data-rank-division="2"] .score-rank-frame {
  --rank-frame-mask: url("assets/ranks/avatar-frame-division-2.svg");
  --rank-frame-scale: 0.94;
}

.score-card[data-rank-division="3"] .score-rank-frame {
  --rank-frame-mask: url("assets/ranks/avatar-frame-division-3.svg");
  --rank-frame-scale: 1;
}

.score-card[data-rank-division="4"] .score-rank-frame {
  --rank-frame-mask: url("assets/ranks/avatar-frame-division-4.svg");
  --rank-frame-scale: 1.06;
}

.score-card.rank-diamond .score-rank-frame,
.score-card.rank-master .score-rank-frame,
.score-card.rank-elite .score-rank-frame {
  filter:
    drop-shadow(0 0 7px color-mix(in srgb, var(--rank-color, #c6d4df) 62%, transparent))
    drop-shadow(0 4px 7px rgba(0, 0, 0, 0.62));
}

.score-avatar-initial {
  position: relative;
  z-index: 2;
  color: rgba(255, 248, 232, 0.58);
  font-size: 0.46rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.score-avatar-level {
  position: relative;
  z-index: 2;
  color: #fff4d5;
  font-size: 0.82rem;
}

.score-rank-division {
  position: absolute;
  right: -4px;
  bottom: -5px;
  z-index: 3;
  display: grid;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--rank-color, #c6d4df) 72%, rgba(255, 248, 232, 0.22));
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, 0.5), transparent 30%),
    linear-gradient(145deg, color-mix(in srgb, var(--rank-color, #c6d4df) 54%, #fff8e8), color-mix(in srgb, var(--rank-color, #c6d4df) 44%, #0b1117));
  color: #fff8e8;
  font-size: 0.46rem;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  box-shadow:
    0 0 8px color-mix(in srgb, var(--rank-color, #c6d4df) 42%, transparent),
    0 2px 5px rgba(0, 0, 0, 0.55);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.76);
}

.score-main {
  min-width: 0;
}

.score-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.score-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #fff8e8;
  font-size: 0.78rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-game-level {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid rgba(98, 234, 208, 0.32);
  border-radius: 999px;
  background: rgba(16, 50, 46, 0.48);
  color: #9ff7ff;
  font-size: 0.62rem;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.score-values {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-weight: 800;
  flex-wrap: wrap;
}

.score-values > span:first-child {
  color: var(--red);
}

.score-values > span:last-child {
  color: #73bfff;
}

.score-values > span:nth-child(2) {
  color: var(--gold);
}

.score-values > span:nth-child(3) {
  color: var(--green);
}

.round-widget {
  flex: 0 0 104px;
  align-self: stretch;
  display: grid;
  place-items: center;
  min-height: 54px;
  padding: 6px 10px;
  border: 1px solid rgba(215, 169, 74, 0.48);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 12%, rgba(98, 234, 208, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(255, 240, 190, 0.11), transparent 54%),
    rgba(9, 14, 11, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 240, 190, 0.12), 0 12px 34px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.round-widget span,
.round-widget em {
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.round-widget strong {
  color: var(--gold);
  font-size: 1.45rem;
  line-height: 1;
  text-shadow: 0 0 18px rgba(215, 169, 74, 0.18);
}

.toolbar {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.tool-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.055), transparent),
    rgba(12, 18, 14, 0.88);
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

body.match-active .tool-button {
  width: 38px;
  height: 38px;
}

#gameMenuButton {
  width: auto;
  min-width: 58px;
  padding: 0 10px;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.game-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: 270px;
  max-height: min(620px, calc(100vh - 72px));
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(215, 169, 74, 0.38);
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 0, rgba(98, 234, 208, 0.13), transparent 36%),
    linear-gradient(180deg, rgba(255, 240, 190, 0.06), transparent 58%),
    rgba(6, 14, 18, 0.72);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(14px) saturate(1.08);
}

.game-menu strong {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.game-menu .menu-action {
  min-height: 38px;
  margin-top: 8px;
}

.game-menu .volume-row {
  margin: 10px 0 2px;
  padding: 8px 0 4px;
  border-top: 1px solid rgba(215, 169, 74, 0.18);
}

.game-menu .animation-row {
  justify-content: space-between;
  margin: 6px 0 2px;
  padding: 4px 0;
}

.animation-select {
  min-width: 112px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid rgba(255, 240, 190, 0.18);
  border-radius: 7px;
  background: rgba(5, 9, 7, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 850;
}

.animation-select:focus-visible {
  outline: 2px solid rgba(98, 234, 208, 0.68);
  outline-offset: 2px;
}

.keybind-settings {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(215, 169, 74, 0.18);
}

.keybind-settings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  padding: 0 2px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.keybind-settings summary::-webkit-details-marker {
  display: none;
}

.keybind-settings summary::after {
  content: "+";
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(215, 169, 74, 0.32);
  border-radius: 6px;
  color: #efe0ad;
  font-size: 0.9rem;
}

.keybind-settings[open] summary::after {
  content: "-";
}

.keybind-list {
  display: grid;
  gap: 5px;
  margin-top: 6px;
}

.keybind-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 4px 5px 4px 8px;
  border: 1px solid rgba(255, 240, 190, 0.12);
  border-radius: 7px;
  background: rgba(5, 9, 7, 0.58);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.keybind-row:hover,
.keybind-row:focus-visible,
.keybind-row.is-capturing {
  border-color: rgba(98, 234, 208, 0.52);
  background: rgba(13, 34, 31, 0.72);
}

.keybind-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keybind-row kbd {
  display: grid;
  min-width: 34px;
  min-height: 22px;
  place-items: center;
  padding: 1px 7px;
  border: 1px solid rgba(215, 169, 74, 0.42);
  border-radius: 6px;
  background: rgba(31, 28, 16, 0.9);
  color: #fff0bd;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 950;
}

.tool-button:hover {
  border-color: var(--cyan);
}

.tool-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.canvas-wrap {
  position: relative;
  display: grid;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: auto;
  place-items: start;
  padding: 0 0 12px;
  background:
    radial-gradient(circle at 32% 14%, rgba(98, 234, 208, 0.07), transparent 36%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.38));
  scrollbar-color: rgba(215, 169, 74, 0.42) rgba(9, 14, 11, 0.72);
}

canvas {
  display: block;
  width: clamp(1040px, calc(100vw - 332px), 1520px);
  height: auto;
  max-height: none;
  border: 1px solid rgba(215, 169, 74, 0.2);
  border-radius: 8px;
  background: #070d0a;
  box-shadow: var(--shadow);
}

body.match-active #gameCanvas {
  cursor: url("assets/cursors/fantasy-pointer.png") 3 2, auto;
}

body.match-active #gameCanvas.build-cursor {
  cursor: url("assets/cursors/fantasy-build.png") 3 2, crosshair;
}

body.match-active #gameCanvas.power-cursor {
  cursor: crosshair;
}

body.match-active #gameCanvas.panning {
  cursor: grabbing;
}

.power-target-tooltip {
  position: fixed;
  z-index: 96;
  max-width: min(320px, calc(100vw - 24px));
  padding: 8px 10px;
  border: 1px solid rgba(242, 184, 75, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.08), transparent),
    rgba(4, 8, 7, 0.94);
  color: #fff8e8;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.25;
  pointer-events: none;
}

.power-target-tooltip[hidden] {
  display: none;
}

.placement-preview-canvas {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  pointer-events: none;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.tower-game-canvas,
.dynamic-game-canvas {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.tower-game-canvas {
  z-index: 1;
}

.dynamic-game-canvas {
  z-index: 2;
}

.board-visibility-toggle {
  position: fixed;
  right: 16px;
  top: 58px;
  z-index: 44;
  display: none;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(215, 169, 74, 0.44);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.11), transparent 52%),
    rgba(6, 10, 8, 0.88);
  color: #f8ead0;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

body.match-active .board-visibility-toggle {
  display: grid;
}

body.match-active.game-menu-open .board-visibility-toggle {
  z-index: 20;
  opacity: 0.42;
  pointer-events: none;
}

.board-visibility-toggle:hover,
.board-visibility-toggle:focus-visible {
  border-color: rgba(98, 234, 208, 0.72);
  outline: none;
  box-shadow: 0 0 0 3px rgba(98, 234, 208, 0.16), 0 14px 30px rgba(0, 0, 0, 0.36);
}

.board-visibility-eye {
  position: relative;
  display: block;
  width: 24px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 50% / 58%;
}

.board-visibility-eye::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px rgba(98, 234, 208, 0.42);
}

.board-visibility-toggle::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 20px;
  width: 24px;
  height: 2px;
  transform: rotate(-38deg) scaleX(0);
  transform-origin: center;
  border-radius: 999px;
  background: #ff6b5f;
  box-shadow: 0 0 8px rgba(255, 107, 95, 0.52);
  transition: transform 140ms ease;
}

.board-visibility-toggle.is-hidden-mode {
  border-color: rgba(255, 107, 95, 0.58);
  color: #ffd6d2;
}

.board-visibility-toggle.is-hidden-mode::after {
  transform: rotate(-38deg) scaleX(1);
}

.round-countdown {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 8;
  width: min(420px, calc(100vw - 48px));
  margin: 0;
  padding: 18px 24px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(242, 184, 75, 0.78);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 28%, rgba(242, 184, 75, 0.24), transparent 46%),
    rgba(8, 12, 10, 0.92);
  box-shadow: 0 18px 64px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 240, 190, 0.18);
  color: #fff8e8;
  font-size: clamp(1.35rem, 4vw, 2.4rem);
  font-weight: 950;
  pointer-events: none;
  text-align: center;
  text-transform: uppercase;
}

.round-countdown[hidden] {
  display: none;
}

.threat-panel,
.round-recap-panel,
.map-effect-toast {
  position: fixed;
  z-index: 36;
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 240, 190, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.09), transparent 62%),
    rgba(5, 10, 9, 0.82);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  color: #fff8e8;
  pointer-events: none;
  backdrop-filter: blur(10px);
}

.threat-panel[hidden],
.round-recap-panel[hidden],
.map-effect-toast[hidden] {
  display: none;
}

.threat-panel {
  top: 120px;
  left: 172px;
  box-sizing: border-box;
  width: 238px;
  min-width: 238px;
  max-width: 238px;
  height: 118px;
  align-content: start;
  overflow: hidden;
  pointer-events: auto;
}

.threat-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  gap: 8px;
}

.threat-panel-toggle {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(255, 240, 190, 0.2);
  border-radius: 6px;
  background: rgba(3, 7, 6, 0.58);
  color: rgba(255, 248, 232, 0.78);
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1;
}

.threat-panel-toggle:hover,
.threat-panel-toggle:focus-visible {
  border-color: rgba(98, 234, 208, 0.58);
  color: #fff8e8;
  outline: none;
}

.threat-panel.is-collapsed {
  width: auto;
  height: auto;
  min-width: 0;
  max-width: none;
  padding: 0;
  gap: 0;
  border-color: rgba(98, 234, 208, 0.28);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.threat-panel-compact {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  width: 238px;
  min-height: 34px;
  max-width: 238px;
  padding: 7px 10px;
  border: 1px solid rgba(98, 234, 208, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(98, 234, 208, 0.1), transparent 58%),
    rgba(5, 10, 9, 0.84);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #fff8e8;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.threat-panel .threat-panel-compact span {
  color: rgba(159, 247, 255, 0.78);
  font-size: 0.62rem;
  font-weight: 950;
  text-transform: uppercase;
  white-space: nowrap;
}

.threat-panel .threat-panel-compact strong {
  min-width: 0;
  overflow: hidden;
  color: #fff8e8;
  font-size: 0.76rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.threat-panel .threat-panel-compact em {
  color: rgba(255, 240, 190, 0.76);
  font-size: 0.64rem;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.threat-panel-compact:hover,
.threat-panel-compact:focus-visible {
  border-color: rgba(98, 234, 208, 0.68);
  outline: none;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.round-recap-panel {
  top: clamp(244px, 32vh, 340px);
  right: 14px;
  bottom: auto;
  width: 318px;
  gap: 8px;
  padding: 11px;
  pointer-events: auto;
  border-color: rgba(242, 184, 75, 0.3);
  background:
    linear-gradient(145deg, rgba(242, 184, 75, 0.18), transparent 42%),
    radial-gradient(circle at 12% 18%, rgba(98, 234, 208, 0.16), transparent 36%),
    rgba(5, 10, 9, 0.91);
}

.map-effect-toast {
  top: 118px;
  right: 14px;
  width: min(320px, calc(100vw - 28px));
  border-color: rgba(98, 234, 208, 0.4);
  background:
    linear-gradient(145deg, rgba(98, 234, 208, 0.2), transparent 46%),
    rgba(5, 10, 9, 0.9);
}

.map-toast-eyebrow {
  color: rgba(159, 247, 255, 0.78);
  font-size: 0.64rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-effect-toast strong {
  color: #fff8e8;
  font-size: 0.92rem;
  font-weight: 950;
}

.map-effect-toast p {
  margin: 0;
  color: rgba(226, 234, 220, 0.78);
  font-size: 0.74rem;
  line-height: 1.35;
}

.threat-panel[data-tone="danger"],
.round-recap-panel[data-tone="warning"] {
  border-color: rgba(255, 115, 106, 0.45);
}

.threat-panel[data-tone="warning"],
.round-recap-panel[data-tone="eco"] {
  border-color: rgba(242, 184, 75, 0.48);
}

.threat-eyebrow,
.round-recap-eyebrow {
  color: rgba(255, 240, 190, 0.68);
  font-size: 0.64rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.threat-panel strong,
.round-recap-panel strong {
  color: #fff8e8;
  font-size: 0.88rem;
  font-weight: 950;
  line-height: 1.12;
}

.threat-panel p {
  margin: 0;
  color: rgba(226, 234, 220, 0.78);
  font-size: 0.74rem;
  line-height: 1.32;
}

.threat-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.threat-chip-list em,
.round-recap-grid span {
  display: inline-grid;
  gap: 1px;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid rgba(151, 184, 211, 0.14);
  border-radius: 6px;
  background: rgba(3, 7, 6, 0.54);
  font-style: normal;
}

.threat-chip-list span,
.round-recap-grid small {
  color: rgba(199, 215, 203, 0.66);
  font-size: 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
}

.threat-chip-list b,
.round-recap-grid b {
  color: #fff3cf;
  font-size: 0.72rem;
  font-weight: 950;
}

.round-recap-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 8px;
}

.round-recap-title {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.round-recap-title b {
  overflow: hidden;
  color: #fff8e8;
  font-size: 0.82rem;
  font-weight: 950;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.round-recap-head strong {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.round-recap-head strong span {
  color: #8ef2ac;
  font-size: 1.15rem;
}

.round-recap-close {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(255, 240, 190, 0.22);
  border-radius: 6px;
  background: rgba(3, 7, 6, 0.62);
  color: rgba(255, 248, 232, 0.78);
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1;
}

.round-recap-close:hover,
.round-recap-close:focus-visible {
  border-color: rgba(255, 240, 190, 0.48);
  color: #fff8e8;
  outline: none;
}

.round-recap-mvp {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(242, 184, 75, 0.28);
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(242, 184, 75, 0.16), transparent 74%),
    rgba(3, 7, 6, 0.56);
}

.round-recap-mvp-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 240, 190, 0.16);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.28);
}

.round-recap-mvp-icon .choice-icon,
.round-recap-mvp-icon .tower-sprite {
  width: 44px;
  height: 44px;
  margin: 0;
}

.round-recap-mvp-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.round-recap-mvp-copy small {
  color: rgba(199, 215, 203, 0.66);
  font-size: 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
}

.round-recap-mvp-copy b {
  min-width: 0;
  overflow: hidden;
  color: #fff8e8;
  font-size: 0.82rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-recap-mvp-copy em {
  color: #ffe2a7;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
}

.round-recap-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.round-recap-section {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(255, 240, 190, 0.1);
  border-radius: 7px;
  background: rgba(3, 7, 6, 0.46);
}

.round-recap-section > small,
.round-recap-section--split small {
  color: rgba(199, 215, 203, 0.66);
  font-size: 0.6rem;
  font-weight: 950;
  text-transform: uppercase;
}

.round-recap-section--split {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
}

.round-recap-section--split > span {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(255, 240, 190, 0.1);
  border-radius: 7px;
  background: rgba(3, 7, 6, 0.46);
}

.round-recap-unit-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.round-recap-unit,
.round-recap-synergy,
.round-recap-empty {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-height: 22px;
  min-width: 0;
  padding: 3px 6px;
  border: 1px solid rgba(255, 240, 190, 0.12);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.26);
  color: #fff8e8;
}

.round-recap-unit b,
.round-recap-synergy b {
  min-width: 0;
  overflow: hidden;
  font-size: 0.66rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-recap-unit em,
.round-recap-synergy em {
  flex: 0 0 auto;
  color: #ffe2a7;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 950;
}

.round-recap-synergy {
  border-color: color-mix(in srgb, var(--trait-color, #d7a94a) 48%, rgba(255, 240, 190, 0.1));
  background: color-mix(in srgb, var(--trait-color, #d7a94a) 12%, rgba(0, 0, 0, 0.42));
}

.round-recap-synergy-icon {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.round-recap-empty {
  color: rgba(226, 234, 220, 0.62);
  font-size: 0.64rem;
  font-weight: 850;
}

.tactical-coach {
  display: none !important;
}

/*
 * Legacy tactical coach styles are intentionally left inert: the in-game help
 * overlay has been removed in favor of the dedicated tutorial.
 */
.tactical-coach--legacy {
  position: fixed;
  top: clamp(214px, 24vh, 260px);
  left: clamp(206px, 15vw, 260px);
  z-index: 24;
  display: grid;
  gap: 5px;
  width: min(340px, calc(100vw - 560px));
  min-width: 250px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 240, 190, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 240, 190, 0.055), transparent 42%),
    rgba(3, 9, 10, 0.42);
  color: rgba(255, 248, 232, 0.86);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.tactical-coach[hidden] {
  display: none;
}

.tactical-coach-label {
  color: var(--gold);
  font-size: 0.64rem;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.tactical-coach strong {
  color: #fff8e8;
  font-size: 0.92rem;
  line-height: 1.08;
}

.tactical-coach p {
  margin: 0;
  color: rgba(239, 224, 173, 0.78);
  font-size: 0.76rem;
  line-height: 1.28;
}

.tactical-coach-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.tactical-coach-chips em {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 3px 6px;
  border: 1px solid rgba(255, 240, 190, 0.14);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
  color: rgba(255, 248, 232, 0.78);
  font-size: 0.65rem;
  font-style: normal;
  line-height: 1;
}

.tactical-coach-chips b {
  color: #fff8e8;
}

.tactical-coach[data-tone="power"] {
  border-color: rgba(98, 234, 208, 0.32);
  background:
    radial-gradient(circle at 10% 12%, rgba(98, 234, 208, 0.16), transparent 42%),
    rgba(3, 14, 13, 0.48);
}

.tactical-coach[data-tone="info"] {
  border-color: rgba(98, 184, 255, 0.28);
}

.tactical-coach[data-tone="warning"] {
  border-color: rgba(255, 202, 87, 0.36);
  background:
    radial-gradient(circle at 10% 12%, rgba(255, 202, 87, 0.14), transparent 42%),
    rgba(18, 11, 3, 0.42);
}

.tactical-coach[data-tone="danger"] {
  border-color: rgba(255, 94, 94, 0.34);
  background:
    radial-gradient(circle at 10% 12%, rgba(255, 94, 94, 0.14), transparent 42%),
    rgba(18, 4, 5, 0.44);
}

.damage-meter {
  position: fixed;
  top: clamp(184px, 28vh, 318px);
  left: clamp(172px, 13vw, 228px);
  z-index: 25;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 620px));
  min-width: 250px;
  padding: 10px 12px;
  border: 1px solid rgba(98, 234, 208, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 10%, rgba(98, 234, 208, 0.12), transparent 40%),
    linear-gradient(135deg, rgba(255, 240, 190, 0.04), transparent 46%),
    rgba(3, 9, 10, 0.46);
  color: rgba(255, 248, 232, 0.86);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  pointer-events: auto;
}

.damage-meter[hidden] {
  display: none;
}

.damage-meter-toggle {
  position: fixed;
  top: clamp(146px, 22vh, 258px);
  left: clamp(172px, 13vw, 228px);
  z-index: 25;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(98, 234, 208, 0.28);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(98, 234, 208, 0.12), transparent 70%),
    rgba(3, 9, 10, 0.66);
  color: rgba(255, 248, 232, 0.86);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

.damage-meter-toggle[hidden] {
  display: none;
}

.damage-meter-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 3px 10px;
  align-items: end;
}

.damage-meter-head span {
  color: var(--gold);
  font-size: 0.64rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.damage-meter-head strong {
  color: #fff8e8;
  font-size: 1rem;
  line-height: 1;
}

.damage-meter-head em {
  grid-column: 1 / -1;
  color: rgba(239, 224, 173, 0.72);
  font-size: 0.68rem;
  font-style: normal;
}

.damage-meter-close {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(255, 240, 190, 0.16);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 248, 232, 0.78);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.damage-meter-close:hover,
.damage-meter-close:focus-visible,
.damage-meter-toggle:hover,
.damage-meter-toggle:focus-visible {
  border-color: rgba(98, 234, 208, 0.52);
  color: #fff8e8;
  outline: none;
}

.damage-meter-list {
  display: grid;
  gap: 5px;
}

.damage-meter-row {
  display: grid;
  grid-template-columns: minmax(82px, 0.78fr) minmax(68px, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 0.7rem;
}

.damage-meter-name {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 248, 232, 0.9);
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.damage-meter-bar {
  height: 7px;
  overflow: hidden;
  border: 1px solid rgba(255, 240, 190, 0.1);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
}

.damage-meter-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--meter-color, #62ead0) 72%, #fff8e8), var(--meter-color, #62ead0));
  box-shadow: 0 0 12px color-mix(in srgb, var(--meter-color, #62ead0) 48%, transparent);
}

.damage-meter-row strong {
  color: #fff8e8;
  font-size: 0.72rem;
  font-weight: 950;
}

.hintbar {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(215, 169, 74, 0.055), transparent),
    rgba(10, 15, 12, 0.8);
  border: 1px solid rgba(151, 184, 211, 0.12);
  color: var(--muted);
  font-size: 0.9rem;
}

.minimap-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 12;
  width: min(380px, calc(100vw - 40px));
  padding: 10px;
  border: 1px solid rgba(215, 169, 74, 0.58);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(215, 169, 74, 0.1), rgba(98, 234, 208, 0.05)),
    rgba(7, 11, 9, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 240, 190, 0.1), 0 18px 55px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
}

body.match-active .minimap-panel {
  top: 84px;
  bottom: auto;
  right: 18px;
  width: min(300px, calc(100vw - 40px));
}

.minimap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 0.82rem;
}

.minimap-head > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.minimap-head > div > span {
  color: var(--muted);
  font-size: 0.74rem;
}

.minimap-content[hidden] {
  display: none !important;
}

.minimap-toggle-button {
  width: 28px;
  height: 28px;
}

#minimapCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 360 / 210;
  border: 1px solid rgba(151, 184, 211, 0.2);
  border-radius: 6px;
  background: #07100b;
  box-shadow: none;
  cursor: crosshair;
}

.end-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(5, 8, 6, 0.78);
  backdrop-filter: blur(4px);
  z-index: 20;
}

.end-overlay,
.end-overlay * {
  cursor: auto;
}

.end-overlay button,
.augment-card [data-augment-choice],
.augment-card [data-augment-reroll],
.trait-card-toggle {
  cursor: pointer;
  touch-action: manipulation;
}

.end-overlay button *,
.augment-card [data-augment-choice] *,
.augment-card [data-augment-reroll] *,
.trait-card-toggle * {
  cursor: inherit;
}

.end-overlay.augment-overlay {
  z-index: 90;
}

.end-overlay.augment-book-overlay {
  z-index: 91;
}

.end-overlay.power-book-overlay {
  z-index: 92;
}

.end-overlay.power-reveal-overlay {
  z-index: 93;
  background: rgba(1, 5, 4, 0.58);
}

.end-overlay[hidden] {
  display: none;
}

.end-modal {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  width: min(560px, 100%);
  max-height: min(760px, calc(100dvh - 28px));
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(215, 169, 74, 0.1), rgba(98, 234, 208, 0.06)),
    var(--panel-solid);
  box-shadow: var(--shadow);
}

.end-overlay[data-result="victory"] .end-modal {
  border-color: rgba(242, 184, 75, 0.7);
  background:
    radial-gradient(circle at 50% 0%, rgba(242, 184, 75, 0.18), transparent 42%),
    linear-gradient(145deg, rgba(215, 169, 74, 0.14), rgba(98, 234, 208, 0.06)),
    var(--panel-solid);
}

.end-modal h2 {
  margin: 0;
  font-size: 2rem;
}

.end-modal p {
  color: var(--muted);
  line-height: 1.5;
}

.end-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-self: end;
  min-height: 0;
  padding-top: 2px;
  padding-bottom: env(safe-area-inset-bottom);
}

.end-actions .primary-button,
.end-actions .mode-button {
  min-width: 0;
}

#profileAfterMatchButton,
#spectatorButton {
  grid-column: 1 / -1;
  min-height: 42px;
}

#profileAfterMatchButton:not(:disabled) {
  border-color: rgba(255, 216, 118, 0.48);
  background:
    linear-gradient(90deg, rgba(255, 216, 118, 0.16), rgba(98, 234, 208, 0.1)),
    rgba(18, 18, 10, 0.58);
  color: #fff8e8;
}

.end-recap {
  display: grid;
  gap: 12px;
  min-height: 0;
  margin: 18px 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
}

.end-recap-label {
  margin: 0;
  color: #efe0ad;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-height: 680px) {
  .end-modal {
    max-height: calc(100dvh - 16px);
    padding: 16px;
  }

  .end-modal h2 {
    font-size: 1.55rem;
  }

  .end-modal p {
    margin: 6px 0;
  }

  .end-recap {
    gap: 8px;
    margin: 10px 0;
  }

  .end-actions {
    gap: 8px;
  }
}

.end-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.end-stat {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(215, 169, 74, 0.18);
  border-radius: 6px;
  background: rgba(4, 8, 6, 0.42);
}

.end-stat span,
.end-standing span {
  color: var(--muted);
  font-size: 0.72rem;
}

.end-stat strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--text);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.end-insight {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(98, 234, 208, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(98, 234, 208, 0.1), transparent 58%),
    rgba(3, 12, 14, 0.58);
}

.end-insight strong {
  color: #fff8e8;
  font-size: 0.86rem;
}

.end-insight p {
  margin: 0;
  color: rgba(255, 248, 232, 0.84);
  font-size: 0.78rem;
  line-height: 1.36;
}

.end-insight span {
  color: rgba(199, 215, 203, 0.78);
  font-size: 0.72rem;
  line-height: 1.32;
}

.end-coach-plan {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(255, 216, 118, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 216, 118, 0.1), transparent 56%),
    rgba(18, 13, 5, 0.5);
}

.end-coach-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.end-coach-head span {
  color: #f0d489;
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.end-coach-head strong {
  min-width: 0;
  overflow: hidden;
  color: #fff8e8;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.end-coach-items {
  display: grid;
  gap: 7px;
}

.end-coach-item {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(255, 240, 190, 0.12);
  border-radius: 6px;
  background: rgba(4, 8, 6, 0.36);
}

.end-coach-item small {
  color: rgba(98, 234, 208, 0.84);
  font-size: 0.62rem;
  font-weight: 950;
  text-transform: uppercase;
}

.end-coach-item strong {
  overflow-wrap: anywhere;
  color: #fff8e8;
  font-size: 0.78rem;
}

.end-coach-item p {
  margin: 0;
  color: rgba(199, 215, 203, 0.82);
  font-size: 0.72rem;
  line-height: 1.32;
}

.end-next-step {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid rgba(255, 216, 118, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 216, 118, 0.1), transparent 54%),
    rgba(19, 15, 7, 0.5);
}

.end-next-step-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
}

.end-next-step-head span {
  grid-column: 1 / -1;
  color: #f0d489;
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.end-next-step-head strong {
  min-width: 0;
  overflow: hidden;
  color: #fff8e8;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.end-next-step-head em {
  color: rgba(199, 215, 203, 0.82);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.end-next-step p {
  margin: 0;
  color: rgba(255, 248, 232, 0.84);
  font-size: 0.78rem;
  line-height: 1.36;
}

.end-next-step-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 240, 190, 0.1);
}

.end-next-step-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #62ead0, #ffd86f);
}

.end-next-step-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.end-next-step-actions .primary-button,
.end-next-step-actions .mode-button {
  min-width: 0;
  min-height: 34px;
}

.end-alpha-note {
  padding: 9px 10px;
  border: 1px solid rgba(242, 184, 75, 0.28);
  border-radius: 8px;
  background: rgba(31, 20, 6, 0.46);
  color: rgba(255, 238, 190, 0.86);
  font-size: 0.74rem;
  line-height: 1.35;
}

.end-ranked-breakdown {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(98, 234, 208, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(98, 234, 208, 0.1), transparent 58%),
    rgba(7, 20, 18, 0.54);
}

.end-ranked-breakdown strong {
  color: #dffefa;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.end-ranked-breakdown p {
  margin: 0;
  color: #fff8e8;
  font-size: 0.86rem;
  font-weight: 950;
}

.end-ranked-breakdown span {
  color: rgba(199, 215, 203, 0.8);
  font-size: 0.72rem;
  line-height: 1.32;
}

.end-results-pending {
  border-color: rgba(98, 234, 208, 0.3);
  background: rgba(5, 28, 34, 0.52);
  color: rgba(225, 255, 250, 0.88);
}

.end-standings {
  display: grid;
  gap: 5px;
}

.end-standing {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) repeat(4, auto);
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid rgba(151, 184, 211, 0.12);
  border-radius: 6px;
  background: rgba(7, 12, 9, 0.58);
}

.end-standing-defense {
  color: #9fd7ff !important;
  white-space: nowrap;
}

.end-standing strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.end-standing.is-local {
  border-color: rgba(98, 234, 208, 0.54);
  box-shadow: inset 3px 0 0 rgba(98, 234, 208, 0.82);
}

.end-standing.is-alive {
  color: #fff8e8;
}

@media (max-width: 640px) {
  .end-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .end-coach-head {
    display: grid;
    justify-content: stretch;
  }

  .end-standing {
    grid-template-columns: 30px minmax(0, 1fr) auto auto;
  }

  .end-standing span:nth-of-type(3),
  .end-standing span:nth-of-type(4) {
    display: none;
  }
}

.game-loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 38%, rgba(98, 234, 208, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(4, 7, 6, 0.78), rgba(4, 7, 6, 0.96));
  backdrop-filter: blur(8px);
}

.game-loader[hidden] {
  display: none;
}

.game-loader-card {
  width: min(460px, 100%);
  padding: 24px;
  border: 1px solid rgba(215, 169, 74, 0.48);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(215, 169, 74, 0.12), rgba(98, 234, 208, 0.07)),
    rgba(12, 17, 14, 0.94);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 240, 190, 0.1);
}

.game-loader-card h2 {
  margin: 0;
  font-size: 1.8rem;
}

.game-loader-card p {
  color: var(--muted);
  line-height: 1.5;
}

.loader-bar {
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(215, 169, 74, 0.28);
  border-radius: 999px;
  background: rgba(5, 8, 6, 0.8);
}

.loader-bar span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(215, 169, 74, 0.95), rgba(98, 234, 208, 0.95));
  animation: loader-sweep 1.05s ease-in-out infinite;
}

@keyframes loader-sweep {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(260%);
  }
}

@media (max-width: 980px) {
  .tactical-coach {
    display: none;
  }

  .damage-meter {
    display: none;
  }

  .damage-meter-toggle {
    display: none;
  }

  body.match-active {
    overflow: auto;
  }

  body.match-active .minimap-panel {
    display: none;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  body.match-active .shell {
    grid-template-columns: 1fr;
    grid-template-rows: 100vh auto;
    height: auto;
    min-height: 100vh;
  }

  body.match-active .game-area {
    grid-row: 1;
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }

  body.match-active .sidebar {
    grid-row: 2;
    max-height: none;
    overflow: visible;
  }

  body.match-active .topbar {
    align-items: start;
    flex-direction: row;
  }

  body.match-active .scoreboard {
    display: flex;
    grid-template-columns: none;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  body.match-active .score-card {
    flex: 0 0 156px;
    padding: 7px 8px;
  }

  body.match-active .toolbar {
    flex-direction: column;
  }

  body.match-active .round-widget {
    flex-basis: 76px;
    min-height: 66px;
  }

  body.match-active .canvas-wrap {
    flex: 1;
    min-height: 0;
    padding-bottom: 0;
  }

  body.is-authenticated:not(.match-active) .shell,
  body:not(.is-authenticated) .shell {
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    padding: 16px;
  }

  body.is-authenticated:not(.match-active) .sidebar {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 32px);
  }

  body:not(.is-authenticated) .sidebar {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  body.page-auth .brand {
    padding: 0 0 14px;
    border-right: 0;
    border-bottom: 1px solid rgba(95, 197, 225, 0.18);
  }

  body.is-authenticated:not(.match-active) .brand h1 {
    max-width: 12ch;
    font-size: clamp(2rem, 11vw, 3rem);
  }

  body.is-authenticated:not(.match-active) .tab-pane.active,
  body.is-authenticated:not(.match-active) #profileTab.active {
    grid-template-columns: 1fr;
  }

  .tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.is-authenticated:not(.match-active) .sidebar {
    overflow: visible;
  }

  body.is-authenticated:not(.match-active) .launcher-panel {
    min-height: auto;
    overflow: visible;
  }

  .launcher-frame {
    display: grid;
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .launcher-nav {
    position: static;
    width: auto;
    grid-template-rows: auto;
    gap: 10px;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid rgba(215, 169, 74, 0.22);
  }

  .launcher-mark {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .launcher-mark-icon {
    width: 42px;
    height: 42px;
    font-size: 0.7rem;
  }

  .profile-card {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .profile-avatar {
    width: 48px;
    height: 48px;
  }

  .profile-status {
    padding-top: 7px;
  }

  .launcher-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .launcher-tabs .tab-button {
    justify-content: center;
    min-height: 38px;
    border-left: 1px solid transparent;
    text-align: center;
  }

  .launcher-audio {
    padding-top: 8px;
  }

  .launcher-audio .setting-row {
    margin: 6px 0;
  }

  .launcher-audio .mode-button {
    min-height: 34px;
  }

  .launcher-page-header {
    min-height: 62px;
    padding: 14px 16px;
  }

  .launcher-brand-title {
    font-size: clamp(1.35rem, 7vw, 1.9rem);
  }

  .launcher-workspace {
    position: static;
    height: auto;
    overflow: visible;
  }

  .launcher-content {
    overflow: visible;
    padding: 16px;
  }

  .play-section,
  .profile-insights,
  .profile-progression,
  .profile-history-grid,
  .social-grid,
  .friend-form,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-card--primary {
    grid-row: auto;
  }

  .profile-progress-bar > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .profile-progress-bar > div > strong {
    text-align: left;
  }

  .player-profile-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .player-profile-avatar {
    width: 38px;
    height: 38px;
  }

  .player-profile-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .player-profile-actions .mode-button {
    flex: 1 1 auto;
  }

  .history-table-head,
  .match-history-item {
    grid-template-columns: 82px minmax(0, 1fr) 48px 72px 62px;
  }

  .history-table-head span:nth-child(5),
  .history-table-head span:nth-child(6),
  .history-table-head span:nth-child(7),
  .history-table-head span:nth-child(8),
  .match-history-item .history-defense,
  .match-history-item .history-economy,
  .match-history-item .history-points,
  .match-history-item .history-date {
    display: none;
  }

  .match-history-item {
    min-height: 68px;
  }

  .history-toggle {
    min-width: 54px;
    min-height: 26px;
    padding-inline: 7px;
    font-size: 0.58rem;
  }

  .play-section .section-title {
    order: 1;
  }

  .next-step-panel {
    grid-column: 1;
    grid-template-columns: 1fr;
    order: 2;
  }

  .next-step-actions {
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .alpha-season-panel {
    grid-column: 1;
    order: 4;
  }

  .alpha-mission-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lobby-list {
    grid-column: 1;
    order: 5;
    min-height: 120px;
  }

  .play-actions {
    grid-column: 1;
    grid-row: auto;
    order: 3;
  }

  .queue-state {
    grid-column: 1;
    order: 0;
  }

  .play-section .play-status-row {
    order: 6;
  }

  .play-status-row {
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-start;
  }

  .social-item,
  .request-item,
  .open-room-item {
    grid-template-columns: 1fr;
  }

  .lobby-player {
    align-items: stretch;
    flex-direction: column;
  }

  .lobby-player-meta,
  .lobby-player-actions {
    width: 100%;
  }

  .lobby-player-actions {
    flex-wrap: wrap;
  }

  .lobby-player-actions .mode-button {
    flex: 1 1 104px;
  }

  .item-actions {
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .item-actions .mode-button,
  .item-actions .primary-button,
  .item-actions .danger-button {
    flex: 1 1 120px;
  }

  .sidebar {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .scoreboard {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  canvas {
    width: min(1220px, 132vw);
  }

  body.match-active .hintbar {
    min-height: 30px;
    padding: 6px 9px;
    font-size: 0.76rem;
  }

  body.match-active .minimap-panel {
    top: 82px;
    right: 8px;
    bottom: auto;
    width: min(190px, calc(100vw - 16px));
    padding: 8px;
  }

  body.match-active .chat-panel {
    margin-top: 8px;
  }

  body.match-active .tower-list,
  body.match-active .barracks {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 9px;
  }

  body.match-active .choice-button {
    min-height: 62px;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    padding: 8px 10px;
  }

  body.match-active .choice-icon {
    width: 46px;
    height: 46px;
  }

  body.match-active .choice-desc {
    white-space: normal;
  }
}

@media (max-width: 520px) {
  body:not(.is-authenticated) .shell {
    align-content: center;
    padding: 14px;
  }

  body:not(.is-authenticated) .sidebar,
  body.is-authenticated:not(.match-active) .sidebar {
    padding: 16px;
  }

  .brand h1 {
    max-width: 10ch;
    font-size: clamp(2rem, 12vw, 2.8rem);
  }

  .panel {
    padding: 12px;
  }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.is-authenticated:not(.match-active) #saveSettingsButton {
    width: 100%;
  }

  body.match-active .score-card {
    flex-basis: 166px;
    min-height: 66px;
    padding: 6px 8px;
  }

  body.match-active .score-avatar {
    width: 34px;
    height: 34px;
  }

  body.match-active .score-name {
    font-size: 0.66rem;
  }

  body.match-active .score-values {
    flex-wrap: nowrap;
    gap: 7px;
    font-size: 0.82rem;
  }

  body.match-active .round-widget {
    flex-basis: 66px;
    min-height: 66px;
    padding: 5px;
  }

  .round-widget strong {
    font-size: 1.25rem;
  }

  .minimap-panel {
    top: auto;
    right: 10px;
    bottom: 10px;
    width: min(176px, calc(100vw - 24px));
    padding: 8px;
  }

  .minimap-head {
    margin-bottom: 6px;
    font-size: 0.76rem;
  }

  .minimap-head > div > span {
    display: none;
  }

  body.match-active .minimap-panel {
    top: 106px;
    right: 8px;
    bottom: auto;
    width: min(132px, calc(100vw - 16px));
  }

  body.match-active .minimap-head {
    font-size: 0.72rem;
  }

  body.match-active .chat-log {
    min-height: 46px;
    max-height: 70px;
  }
}

.profile-avatar-wrap {
  display: contents;
}

.profile-level-badge {
  display: none;
}

.profile-card-stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 240, 190, 0.12);
}

.profile-card-stats span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 240, 190, 0.1);
  border-radius: 6px;
  background: rgba(2, 13, 18, 0.28);
}

.profile-card-stats small {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 850;
  text-transform: uppercase;
}

.profile-card-stats strong {
  color: #fff4d5;
  font-size: 0.86rem;
}

@media (min-width: 981px) {
  body.match-active .shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(230px, 30vh);
    height: 100vh;
    min-height: 0;
  }

  body.match-active .game-area {
    position: relative;
    grid-column: 1;
    grid-row: 1;
    height: 100%;
    padding: 8px 10px 6px;
    overflow: hidden;
  }

  body.match-active .sidebar {
    grid-column: 1;
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(190px, 0.42fr) minmax(440px, 1.1fr) minmax(560px, 1.55fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    height: 100%;
    max-height: none;
    padding: 8px;
    overflow: hidden;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  body.match-active .brand,
  body.match-active .account-panel {
    display: none !important;
  }

  body.match-active .setup-panel {
    grid-column: 1;
    min-height: 0;
    overflow: hidden;
  }

  body.match-active .locked-class {
    display: none !important;
  }

  body.match-active .class-panel,
  body.match-active .locked-class {
    grid-row: 1;
  }

  body.match-active .start-panel {
    grid-row: 2;
  }

  body.match-active .locked-class {
    grid-row: 1 / span 2;
  }

  body.match-active .tower-panel {
    grid-column: 2;
    grid-row: 1 / span 2;
    min-height: 0;
  }

  body.match-active .barracks-panel {
    grid-column: 3;
    grid-row: 1 / span 2;
    min-height: 0;
  }

  body.match-active .selected-panel {
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
  }

  body.match-active .stats-panel {
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
    margin-top: 0;
  }

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

  body.match-active .panel-title {
    margin-bottom: 7px;
  }

  body.match-active .panel h2 {
    font-size: 0.94rem;
  }

  body.match-active .resource-grid {
    grid-template-columns: 1fr;
  }

  body.match-active .tower-list,
  body.match-active .barracks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
    grid-auto-rows: minmax(56px, auto);
    gap: 8px;
    max-height: calc(100% - 34px);
    overflow: auto;
    padding-right: 3px;
  }

  body.match-active .choice-button {
    min-height: 56px;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 7px 9px;
  }

  body.match-active .choice-icon {
    width: 40px;
    height: 40px;
  }

  body.match-active .choice-name {
    font-size: 0.82rem;
    line-height: 1.08;
  }

  body.match-active .choice-cost {
    font-size: 0.76rem;
  }

  body.match-active .choice-desc {
    display: -webkit-box;
    font-size: 0.66rem;
    line-height: 1.14;
    white-space: normal;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  body.match-active .stat-row {
    display: grid;
    gap: 3px;
    padding: 8px;
    border: 1px solid rgba(215, 169, 74, 0.12);
    border-radius: 8px;
    background: rgba(5, 9, 7, 0.44);
    font-size: 0.72rem;
  }

  body.match-active .stat-row strong {
    font-size: 0.96rem;
  }

  body.match-active .selected-panel strong {
    margin-bottom: 7px;
  }

  body.match-active .primary-button,
  body.match-active .mode-button,
  body.match-active .danger-button {
    min-height: 36px;
  }

  body.match-active .canvas-wrap {
    justify-content: start;
    padding: 0;
  }

  body.match-active .chat-panel {
    position: absolute;
    right: 10px;
    top: clamp(286px, 38vh, 380px);
    bottom: auto;
    z-index: 9;
    width: min(286px, calc(100vw - 40px));
    background:
      linear-gradient(180deg, rgba(255, 240, 190, 0.045), transparent),
      rgba(13, 18, 15, 0.9);
  }

  body.match-active .chat-panel .panel-title {
    margin-bottom: 5px;
  }

  body.match-active .chat-form {
    grid-template-columns: 1fr;
  }

  body.match-active .chat-log {
    min-height: 156px;
    max-height: 228px;
  }

  body.match-active .minimap-panel {
    top: 74px;
    width: min(270px, calc(100vw - 40px));
  }
}

@media (min-width: 1700px) {
  body.match-active .shell {
    grid-template-rows: minmax(0, 1fr) minmax(292px, 29vh);
  }

  body.match-active .sidebar {
    grid-template-columns: minmax(220px, 0.42fr) minmax(620px, 0.95fr) minmax(980px, 1.55fr);
    gap: 10px;
    padding: 10px;
  }

  body.match-active .panel {
    padding: 12px;
  }

  body.match-active .tower-list,
  body.match-active .barracks {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    grid-auto-rows: minmax(72px, auto);
    gap: 9px;
    max-height: calc(100% - 42px);
  }

  body.match-active .barracks {
    max-height: calc(100% - 96px);
  }

  body.match-active .choice-button {
    min-height: 72px;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 10px 12px;
  }

  body.match-active .choice-icon {
    width: 56px;
    height: 56px;
  }

  body.match-active .choice-name {
    font-size: 0.92rem;
    line-height: 1.1;
  }

  body.match-active .choice-desc {
    font-size: 0.76rem;
    line-height: 1.2;
  }

  body.match-active .choice-cost {
    font-size: 0.82rem;
  }

  body.match-active .panel h2 {
    font-size: 1.05rem;
  }

  body.match-active .stat-row {
    padding: 9px;
    font-size: 0.96rem;
  }

  body.match-active .chat-panel {
    width: min(304px, calc(100vw - 40px));
  }

  body.match-active .chat-log {
    min-height: 178px;
    max-height: 252px;
  }
}

/* Horizontal arena experiment */
body.match-active {
  background:
    radial-gradient(circle at 50% 16%, rgba(215, 169, 74, 0.035), transparent 22%),
    linear-gradient(180deg, rgba(5, 8, 6, 0.92), rgba(5, 8, 6, 0.98)),
    #050908;
}

body.match-active .game-area {
  padding: 6px 8px 5px;
  gap: 6px;
}

body.match-active .topbar {
  position: relative;
  z-index: 14;
  min-height: 78px;
  padding: 0 64px 0 0;
  align-items: stretch;
}

body.match-active .scoreboard {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(132px, 1fr))
    minmax(112px, clamp(118px, 10vw, 174px))
    repeat(3, minmax(132px, 1fr));
  gap: clamp(5px, 0.5vw, 8px);
  width: 100%;
}

body.match-active .score-card {
  min-height: 72px;
  grid-template-columns: clamp(36px, 3vw, 54px) minmax(0, 1fr);
  gap: clamp(6px, 0.6vw, 10px);
  padding: 8px clamp(8px, 0.8vw, 12px) 8px 10px;
  border-color: color-mix(in srgb, var(--player-color, var(--gold)) 42%, rgba(215, 169, 74, 0.32));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--player-color, var(--gold)) 16%, transparent), transparent 40%),
    radial-gradient(circle at 20% 28%, color-mix(in srgb, var(--player-color, var(--gold)) 20%, transparent), transparent 38%),
    linear-gradient(180deg, rgba(255, 240, 190, 0.11), rgba(0, 0, 0, 0.06)),
    rgba(9, 13, 11, 0.9);
}

body.match-active .score-card:nth-child(4) {
  grid-column: 5;
}

body.match-active .score-card:nth-child(5) {
  grid-column: 6;
}

body.match-active .score-card:nth-child(6) {
  grid-column: 7;
}

body.match-active .score-card::before {
  border-left-color: color-mix(in srgb, var(--player-color, var(--gold)) 78%, transparent);
}

body.match-active .score-avatar {
  width: clamp(36px, 3vw, 54px);
  height: clamp(36px, 3vw, 54px);
  border-width: 2px;
  border-color: color-mix(in srgb, var(--player-color, var(--gold)) 60%, rgba(255, 240, 190, 0.28));
  font-size: clamp(0.72rem, 0.7vw, 0.86rem);
}

.score-index {
  position: absolute;
  left: 5px;
  bottom: 5px;
  z-index: 1;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid rgba(215, 169, 74, 0.72);
  border-radius: 50%;
  background: rgba(6, 9, 7, 0.9);
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 950;
}

body.match-active .score-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--player-color, var(--gold)) 72%, #fff8e8);
  font-size: clamp(0.66rem, 0.64vw, 0.78rem);
  font-weight: 950;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

body.match-active .score-name span:first-child {
  color: color-mix(in srgb, var(--player-color, var(--gold)) 72%, #fff8e8);
  font-size: clamp(0.72rem, 0.72vw, 0.86rem);
  font-weight: 950;
  text-transform: uppercase;
}

body.match-active .score-name span:last-child {
  max-width: none;
  color: #fff8e8;
  font-weight: 800;
}

body.match-active .score-game-level {
  min-height: 18px;
  padding-inline: 5px;
  font-size: clamp(0.55rem, 0.52vw, 0.64rem);
}

body.match-active .score-values {
  display: flex;
  flex-wrap: wrap;
  column-gap: clamp(6px, 0.6vw, 12px);
  row-gap: 4px;
  margin-top: 5px;
  font-size: clamp(0.74rem, 0.72vw, 0.88rem);
  line-height: 1.05;
}

body.match-active .score-values > span,
body.match-active .score-values .icon-value {
  min-width: max-content;
}

body.match-active .score-values .icon-value {
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

body.match-active .score-values .icon-value > span:last-child {
  overflow: visible;
}

body.match-active .round-widget {
  position: absolute;
  top: -8px;
  left: calc(50vw - 8px);
  z-index: 16;
  width: 182px;
  height: 112px;
  min-height: 0;
  transform: translateX(-50%);
  border-radius: 0 0 92px 92px;
  border-color: rgba(215, 169, 74, 0.78);
  background:
    radial-gradient(circle at 50% 30%, rgba(215, 169, 74, 0.28), transparent 42%),
    linear-gradient(180deg, rgba(255, 240, 190, 0.16), rgba(8, 12, 10, 0.96) 64%),
    rgba(8, 12, 10, 0.96);
  box-shadow:
    inset 0 2px 0 rgba(255, 240, 190, 0.18),
    inset 0 -8px 28px rgba(0, 0, 0, 0.58),
    0 16px 42px rgba(0, 0, 0, 0.48);
}

body.match-active .round-widget::before,
body.match-active .round-widget::after {
  content: "";
  position: absolute;
  top: 34px;
  width: 32px;
  height: 32px;
  border: 2px solid rgba(98, 234, 208, 0.38);
  border-radius: 50%;
  background: rgba(9, 14, 11, 0.9);
}

body.match-active .round-widget::before {
  left: -19px;
}

body.match-active .round-widget::after {
  right: -19px;
}

body.match-active .round-widget span {
  color: #efe0ad;
  font-size: 0.74rem;
}

body.match-active .round-widget strong {
  font-size: 3.1rem;
  line-height: 0.9;
}

body.match-active .round-widget em {
  font-size: 1rem;
}

body.match-active .toolbar {
  position: absolute;
  top: 8px;
  right: 0;
  z-index: 18;
}

body.match-active .tool-button {
  width: 46px;
  height: 46px;
  border-color: rgba(215, 169, 74, 0.45);
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.12), transparent 58%),
    rgba(11, 16, 13, 0.92);
}

@media (max-width: 1500px) {
  body.match-active .topbar {
    padding-right: 56px;
  }

  body.match-active .scoreboard {
    grid-template-columns:
      repeat(3, minmax(118px, 1fr))
      minmax(148px, 12vw)
      repeat(3, minmax(118px, 1fr));
  }

  body.match-active .score-card {
    min-height: 66px;
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 7px 8px;
  }

  body.match-active .score-avatar {
    width: 34px;
    height: 34px;
  }

  body.match-active .score-name span:last-child {
    display: none;
  }

  body.match-active .round-widget {
    width: 148px;
    height: 94px;
    border-radius: 0 0 76px 76px;
  }

  body.match-active .round-widget::before,
  body.match-active .round-widget::after {
    display: none;
  }

  body.match-active .round-widget strong {
    font-size: 2.55rem;
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  body.match-active .topbar {
    min-height: 132px;
    padding-right: 142px;
  }

  body.match-active .scoreboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: minmax(58px, auto);
    align-content: start;
  }

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

  body.match-active .round-widget {
    top: 0;
    right: 52px;
    left: auto;
    width: 82px;
    height: 128px;
    transform: none;
    border-radius: 8px;
  }

  body.match-active .round-widget::before,
  body.match-active .round-widget::after {
    display: none;
  }
}

@media (max-width: 980px) {
  body.match-active .topbar {
    min-height: auto;
    padding: 0;
    align-items: stretch;
  }

  body.match-active .scoreboard {
    display: flex;
    grid-template-columns: none;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  body.match-active .score-card,
  body.match-active .score-card:nth-child(4),
  body.match-active .score-card:nth-child(5),
  body.match-active .score-card:nth-child(6) {
    flex: 0 0 clamp(184px, 48vw, 236px);
    grid-column: auto;
    min-height: 64px;
  }

  body.match-active .round-widget {
    position: static;
    grid-template-columns: auto auto auto;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: auto;
    min-height: 48px;
    transform: none;
    border-radius: 8px;
  }

  body.match-active .round-widget::before,
  body.match-active .round-widget::after {
    display: none;
  }

  body.match-active .round-widget strong {
    font-size: 1.7rem;
  }
}

body.match-active .canvas-wrap {
  flex: 1;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(215, 169, 74, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.44));
}

canvas {
  aspect-ratio: 5400 / 3600;
}

body.match-active canvas {
  width: clamp(4700px, 330vw, 6200px);
  aspect-ratio: 5400 / 3600;
}

body.match-active .hintbar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 10px;
  z-index: 15;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 6px;
  pointer-events: none;
  font-size: 0.8rem;
  background: rgba(6, 10, 8, 0.78);
}

.battle-feed {
  position: fixed;
  top: 50vh;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 29;
  display: grid;
  width: min(540px, calc(100vw - 36px));
  gap: 6px;
  margin: 0 auto;
  pointer-events: none;
}

.power-alert-feed {
  position: fixed;
  top: calc(50vh - 96px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 31;
  display: grid;
  width: min(560px, calc(100vw - 32px));
  gap: 8px;
  pointer-events: none;
}

.power-alert-item {
  justify-self: center;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: min(100%, 520px);
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--power-color, #d7a94a) 62%, rgba(255, 240, 190, 0.2));
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--power-color, #d7a94a) 18%, transparent), transparent 62%),
    rgba(7, 10, 9, 0.94);
  color: #fff8e8;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
  animation: battle-feed-in 180ms ease-out;
}

.power-alert-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--power-color, #d7a94a) 60%, rgba(255, 255, 255, 0.18));
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  color: color-mix(in srgb, var(--power-color, #d7a94a) 72%, #fff8e8);
  font-size: 0.82rem;
  font-weight: 950;
  overflow: hidden;
}

.power-alert-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.power-alert-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.power-alert-copy strong,
.power-alert-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.power-alert-copy strong {
  color: #fff8e8;
  font-size: 0.9rem;
}

.power-alert-copy span {
  color: rgba(255, 232, 173, 0.9);
  font-size: 0.78rem;
  font-weight: 800;
}

.power-alert-item.is-hiding {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.battle-feed-item {
  justify-self: center;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(215, 169, 74, 0.42);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.12), transparent 58%),
    rgba(7, 11, 9, 0.9);
  color: #fff8e8;
  font-size: 0.86rem;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  animation: battle-feed-in 180ms ease-out;
}

.battle-feed-item.danger {
  border-color: rgba(255, 115, 106, 0.54);
  color: #ffd8d8;
}

.battle-feed-item.warning {
  border-color: rgba(242, 184, 75, 0.58);
  color: #ffe6ad;
}

.battle-feed-item.is-hiding {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 420ms ease, transform 420ms ease;
}

@keyframes battle-feed-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.match-active .minimap-panel,
body.match-active .chat-panel {
  right: 10px;
  width: min(318px, calc(100vw - 36px));
  border-color: rgba(215, 169, 74, 0.54);
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.08), transparent 56%),
    rgba(10, 15, 12, 0.9);
}

body.match-active .minimap-panel {
  top: 104px;
  padding: 10px;
  opacity: 0.95;
}

body.match-active .minimap-panel.is-collapsed {
  width: min(168px, calc(100vw - 36px));
  padding: 7px;
  opacity: 0.72;
}

body.match-active .minimap-panel.is-collapsed .minimap-head {
  margin-bottom: 0;
}

body.match-active .minimap-panel.is-collapsed .minimap-head > div > span {
  display: none;
}

body.match-active #minimapCanvas {
  aspect-ratio: 360 / 240;
  border-radius: 4px;
}

body.match-active .chat-panel {
  top: 390px;
  padding: 10px;
}

body.match-active .chat-panel .panel-title h2,
body.match-active .minimap-head strong {
  color: #efe0ad;
  font-size: 0.88rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

body.match-active .chat-log {
  min-height: 164px;
  max-height: 212px;
  background: rgba(5, 9, 7, 0.78);
}

body.match-active .chat-form {
  grid-template-columns: 1fr 42px;
}

body.match-active #chatSendButton {
  min-width: 42px;
  padding: 0;
  overflow: hidden;
  color: transparent;
}

body.match-active #chatSendButton::before {
  content: ">";
  color: #efe0ad;
  font-size: 1.3rem;
}

@media (min-width: 981px) {
  body.match-active .shell {
    grid-template-rows: minmax(0, 1fr) 252px;
  }

  body.match-active .sidebar {
    grid-template-columns: 172px minmax(460px, 0.92fr) minmax(620px, 1.2fr);
    grid-template-rows: 1fr;
    align-items: stretch;
    gap: 8px;
    padding: 8px 10px;
    background:
      linear-gradient(180deg, rgba(38, 39, 25, 0.92), rgba(7, 11, 9, 0.96)),
      rgba(7, 11, 9, 0.94);
  }

  body.match-active .stats-panel {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    align-content: stretch;
  }

  body.match-active .tower-panel {
    grid-column: 2;
    grid-row: 1;
  }

  body.match-active .barracks-panel {
    grid-column: 3;
    grid-row: 1;
  }

  body.match-active .selected-panel,
  body.match-active .setup-panel,
  body.match-active .locked-class {
    display: none !important;
  }

  body.match-active .resource-grid {
    grid-template-columns: 1fr;
    height: 100%;
  }

  body.match-active .stats-panel h2 {
    display: none;
  }

  body.match-active .stat-row {
    align-content: center;
    min-height: 54px;
    padding: 12px;
    border-color: rgba(215, 169, 74, 0.2);
    background:
      radial-gradient(circle at 20% 30%, rgba(215, 169, 74, 0.1), transparent 34%),
      rgba(5, 9, 7, 0.72);
  }

  body.match-active .stat-row:first-child strong {
    color: var(--gold);
    font-size: 2rem;
  }

  body.match-active .tower-list,
  body.match-active .barracks {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(132px, 148px);
    grid-template-columns: none;
    grid-auto-rows: 1fr;
    max-height: none;
    height: calc(100% - 34px);
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 2px 4px;
  }

  body.match-active .choice-button {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(88px, 1fr) auto auto;
    justify-items: center;
    align-content: stretch;
    min-height: 196px;
    padding: 8px;
    text-align: center;
    background:
      linear-gradient(180deg, rgba(255, 240, 190, 0.1), transparent 54%),
      radial-gradient(circle at 50% 20%, rgba(98, 234, 208, 0.12), transparent 38%),
      rgba(9, 14, 11, 0.86);
  }

  body.match-active .choice-icon {
    width: 100%;
    height: 92px;
    border-radius: 4px;
    background-size: calc(var(--sprite-cols) * 105%) calc(var(--sprite-rows) * 105%);
  }

  body.match-active .choice-main {
    display: grid;
    gap: 5px;
    justify-items: center;
  }

  body.match-active .choice-name {
    font-size: 0.84rem;
    text-transform: uppercase;
  }

  body.match-active .choice-desc {
    -webkit-line-clamp: 1;
    max-width: 100%;
    min-height: 0;
    font-size: 0.68rem;
  }

  body.match-active .choice-cost {
    align-self: end;
    font-size: 0.8rem;
  }
}

@media (min-width: 1700px) {
  body.match-active .shell {
    grid-template-rows: minmax(0, 1fr) 282px;
  }

  body.match-active .sidebar {
    grid-template-columns: 190px minmax(600px, 0.95fr) minmax(760px, 1.25fr);
  }

  body.match-active .tower-list,
  body.match-active .barracks {
    grid-auto-columns: minmax(150px, 172px);
  }

  body.match-active .choice-button {
    min-height: 222px;
  }

  body.match-active .choice-icon {
    height: 116px;
  }
}

@media (min-width: 981px) {
  body.match-active .sidebar {
    grid-template-columns: minmax(170px, 0.34fr) minmax(420px, 0.9fr) minmax(220px, 0.45fr) minmax(560px, 1.25fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 0.78fr);
  }

  body.match-active .stats-panel {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  body.match-active .tower-panel {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  body.match-active .bench-panel {
    grid-column: 3;
    grid-row: 1 / span 2;
    min-height: 0;
    overflow: hidden;
  }

  body.match-active .barracks-panel {
    grid-column: 4;
    grid-row: 1 / span 2;
  }

  body.match-active .tower-list,
  body.match-active .barracks {
    grid-auto-flow: row;
    grid-auto-columns: initial;
    grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.match-active .tower-list {
    grid-auto-rows: minmax(78px, auto);
    height: calc(100% - 76px);
  }

  body.match-active .barracks {
    grid-auto-rows: minmax(78px, auto);
    height: calc(100% - 86px);
  }

  body.match-active .bench-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: calc(100% - 32px);
  }

  body.match-active .choice-button {
    grid-template-columns: 58px minmax(0, 1fr) auto;
    grid-template-rows: none;
    justify-items: stretch;
    min-height: 78px;
    text-align: left;
  }

  body.match-active .choice-icon {
    width: 54px;
    height: 54px;
  }
}

@media (min-width: 1700px) {
  body.match-active .sidebar {
    grid-template-columns: minmax(190px, 0.32fr) minmax(560px, 0.95fr) minmax(260px, 0.46fr) minmax(780px, 1.3fr);
  }

  body.match-active .choice-button {
    min-height: 84px;
    grid-template-columns: 64px minmax(0, 1fr) auto;
  }

  body.match-active .choice-icon {
    width: 60px;
    height: 60px;
  }
}

@media (min-width: 981px) {
  body.match-active .stats-panel {
    grid-template-rows: auto 1fr auto;
    align-content: stretch;
    overflow: hidden;
  }

  body.match-active .resource-grid {
    grid-template-columns: 1fr;
    gap: 6px;
    height: auto;
    min-height: 0;
  }

  body.match-active .stat-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 0;
    padding: 6px 10px;
    gap: 8px;
  }

  body.match-active .stat-row > span {
    min-width: 0;
    overflow: hidden;
    font-size: 0.76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.match-active .stat-row strong {
    min-width: 0;
    justify-self: end;
    font-size: 0.9rem;
    line-height: 1;
  }

  body.match-active .stat-row:first-child strong {
    font-size: 1.05rem;
  }

  body.match-active .stat-row .icon-value {
    justify-content: end;
    gap: 4px;
  }

  body.match-active #buyXpButton {
    width: 100%;
    min-height: 34px;
    margin-top: 6px;
    padding-inline: 8px;
    font-size: 0.78rem;
  }

  body.match-active .selected-panel:not([hidden]) {
    position: fixed;
    left: 12px;
    bottom: 300px;
    z-index: 38;
    display: grid !important;
    width: min(340px, calc(100vw - 24px));
    gap: 8px;
  }

  body.match-active .selected-panel .mode-button,
  body.match-active .selected-panel .danger-button {
    min-height: 34px;
    font-size: 0.78rem;
  }

  body.match-active .selected-tower-stats {
    margin: 0;
    font-size: 0.72rem;
  }

  body.match-active .selected-trait-chip {
    min-height: 19px;
    padding: 2px 6px;
    font-size: 0.58rem;
  }

  body.match-active .selected-stat-row--bonuses > span:last-child {
    line-height: 1.25;
  }

  body.match-active .unit-shop-card {
    min-height: 68px;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    background:
      linear-gradient(180deg, rgba(255, 240, 190, 0.055), transparent),
      rgba(8, 13, 10, 0.82);
  }

  body.match-active .unit-shop-card .choice-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
  }

  body.match-active .unit-shop-card .choice-cost {
    color: var(--gold);
    font-size: 0.72rem;
  }

  body.match-active .monster-shop-desc {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
}

@media (min-width: 981px) and (max-height: 900px) {
  body.match-active .shell {
    grid-template-rows: minmax(0, 1fr) 236px;
  }

  body.match-active .selected-panel:not([hidden]) {
    bottom: 252px;
  }

  body.match-active .choice-button {
    min-height: 62px;
  }

  body.match-active .choice-icon {
    width: 46px;
    height: 46px;
  }

  body.match-active .bench-slot {
    min-height: 50px;
  }

  body.match-active .bench-slot .choice-icon {
    height: 28px;
  }
}

@media (max-width: 980px) {
  body.match-active .shell {
    grid-template-rows: auto auto;
  }

  body.match-active .game-area {
    height: auto;
    min-height: 0;
  }

  body.match-active .canvas-wrap {
    flex: 0 0 min(560px, 62vh);
  }

  body.match-active .minimap-panel {
    display: none;
  }
}

@media (min-width: 981px) {
  body.match-active .shell {
    grid-template-rows: minmax(0, 1fr) 310px;
  }

  body.match-active .sidebar {
    grid-template-columns: minmax(132px, 0.22fr) minmax(550px, 0.9fr) minmax(360px, 0.58fr) minmax(330px, 0.52fr);
    grid-template-rows: 1fr;
  }

  body.match-active .stats-panel,
  body.match-active .tower-panel,
  body.match-active .bench-panel,
  body.match-active .barracks-panel {
    min-height: 0;
  }

  body.match-active .tower-panel {
    overflow: hidden;
  }

  body.match-active .tower-panel .tower-list {
    grid-template-columns: repeat(5, minmax(100px, 1fr));
    grid-auto-flow: row;
    grid-auto-columns: initial;
    grid-auto-rows: minmax(0, 1fr);
    height: calc(100% - 58px);
    min-height: 0;
    overflow: hidden;
    padding: 0;
  }

  body.match-active .tower-panel .shop-action {
    flex: 1 1 auto;
    width: auto;
    margin-top: 0;
  }

  body.match-active .tower-panel .shop-action.icon-action {
    flex: 0 0 auto;
    width: auto;
  }

  body.match-active .tower-panel .odds-preview {
    flex: 1 1 auto;
    min-width: 0;
  }

  body.match-active .tower-panel .choice-button {
    position: relative;
    min-height: 0;
    height: 100%;
    grid-template-columns: 1fr;
    grid-template-rows: 58px minmax(0, 1fr);
    justify-items: stretch;
    align-content: stretch;
    gap: 6px;
    padding: 8px;
    text-align: left;
  }

  body.match-active .tower-panel .choice-icon {
    justify-self: center;
    width: 58px;
    height: 58px;
  }

  body.match-active .tower-panel .choice-main {
    display: grid;
    align-content: start;
    gap: 5px;
    min-width: 0;
  }

  body.match-active .tower-panel .choice-name {
    overflow: hidden;
    font-size: 0.78rem;
    line-height: 1.05;
    text-align: center;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
  }

  body.match-active .tower-panel .choice-cost {
    position: absolute;
    right: 8px;
    top: 8px;
    left: auto;
    display: flex;
    justify-content: center;
    padding: 3px 5px;
    border: 1px solid rgba(242, 184, 75, 0.32);
    border-radius: 999px;
    background: rgba(4, 7, 5, 0.84);
    font-size: 0.76rem;
  }

  body.match-active .tower-panel .choice-button::before,
  body.match-active .bench-slot::before {
    display: none;
  }

  body.match-active .rarity-common .choice-icon {
    border-color: #9fb4a6;
  }

  body.match-active .rarity-uncommon .choice-icon {
    border-color: #58d68d;
    box-shadow: inset 0 0 0 1px rgba(88, 214, 141, 0.28), 0 0 14px rgba(88, 214, 141, 0.2);
  }

  body.match-active .rarity-rare .choice-icon {
    border-color: #66b7ff;
    box-shadow: inset 0 0 0 1px rgba(102, 183, 255, 0.3), 0 0 14px rgba(102, 183, 255, 0.2);
  }

  body.match-active .rarity-epic .choice-icon {
    border-color: #bd8dff;
    box-shadow: inset 0 0 0 1px rgba(189, 141, 255, 0.32), 0 0 16px rgba(189, 141, 255, 0.22);
  }

  body.match-active .rarity-legendary .choice-icon {
    border-color: #f2b84b;
    box-shadow: inset 0 0 0 1px rgba(242, 184, 75, 0.36), 0 0 18px rgba(242, 184, 75, 0.24);
  }

  body.match-active .rarity-mythic .choice-icon {
    border-color: #ff3b30;
    box-shadow: inset 0 0 0 1px rgba(255, 59, 48, 0.42), 0 0 20px rgba(255, 59, 48, 0.28);
  }

  body.match-active .tower-stat-grid,
  body.match-active .unit-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
    min-width: 0;
  }

  body.match-active .tower-stat-grid > .stat-pill,
  body.match-active .unit-stat-grid > .stat-pill,
  body.match-active .selected-tower-stats .stat-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    overflow: hidden;
    padding: 2px 4px;
    border: 1px solid rgba(151, 184, 211, 0.14);
    border-radius: 4px;
    background: rgba(4, 8, 6, 0.42);
    color: #cfd9c8;
    font-size: 0.58rem;
    line-height: 1.05;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.match-active .stat-icon {
    display: inline-grid;
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    place-items: center;
  }

  body.match-active .stat-pill > .income-icon,
  body.match-active .unit-shop-pill > .income-icon {
    flex: 0 0 auto;
    width: 13px;
    height: 13px;
  }

  body.match-active .stat-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
  }

  body.match-active .stat-pill strong {
    min-width: 0;
    overflow: hidden;
    color: inherit;
    font: inherit;
    text-overflow: ellipsis;
  }

  body.match-active .selected-stat-icon {
    flex: 0 0 24px;
    width: 24px;
    height: 22px;
    padding: 3px;
  }

  body.match-active .selected-stat-icon .stat-icon {
    width: 14px;
    height: 14px;
  }

  body.match-active .stat-ground,
  body.match-active .stat-air,
  body.match-active .stat-both,
  body.match-active .stat-income {
    color: #efe0ad;
  }

  body.match-active .stat-damage {
    color: #ffd28a;
  }

  body.match-active .stat-range {
    color: #9fd6ff;
  }

  body.match-active .stat-speed {
    color: #c6f6d5;
  }

  body.match-active .stat-hp {
    color: #ff9aa2;
  }

  body.match-active .tower-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    min-height: 16px;
  }

  body.match-active .tower-tags > span {
    display: inline-grid;
    width: 18px;
    height: 16px;
    place-items: center;
    padding: 2px;
    border: 1px solid color-mix(in srgb, var(--rarity-color, var(--gold)) 44%, rgba(255, 240, 190, 0.14));
    border-radius: 999px;
    color: color-mix(in srgb, var(--rarity-color, var(--gold)) 72%, #fff8e8);
    font-size: 0.55rem;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
  }

  body.match-active .tower-meta-row {
    width: 100%;
    min-height: 17px;
  }

  body.match-active .tower-trait-list--compact {
    gap: 3px;
    min-width: 0;
  }

  body.match-active .tower-trait-chip--compact {
    max-width: 68px;
    min-height: 15px;
    padding: 1px 4px;
    font-size: 0.48rem;
  }

  body.match-active .tower-panel .tower-meta-row {
    justify-content: center;
  }

  body.match-active .tower-panel .tower-trait-list--compact {
    flex: 0 1 auto;
    justify-content: center;
    max-width: 100%;
  }

  body.match-active .tower-panel .tower-tags {
    display: none;
  }

  body.match-active .bench-panel {
    overflow: hidden;
  }

  body.match-active .barracks-panel .panel-title {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  body.match-active .barracks-panel .panel-title h2 {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.match-active .barracks-panel .panel-title > span {
    display: none;
  }

  body.match-active .bench-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
    gap: 6px;
    height: calc(100% - 32px);
    min-height: 0;
    overflow: hidden;
  }

  body.match-active .bench-slot {
    min-height: 0;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    padding: 4px 6px;
  }

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

  body.match-active .bench-main {
    display: grid;
    gap: 4px;
    min-width: 0;
  }

  body.match-active .bench-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    min-width: 0;
  }

  body.match-active .bench-title span {
    min-width: 0;
    overflow: hidden;
    font-size: 0.68rem;
    font-weight: 900;
    text-align: left;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
  }

  body.match-active .bench-title strong {
    flex: 0 0 auto;
    color: #efe0ad;
    font-size: 0.62rem;
  }

  body.match-active .bench-tags {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
  }

  body.match-active .bench-tags .shop-decision-badge {
    min-height: 17px;
    max-width: 74px;
    padding: 2px 5px;
    font-size: 0.52rem;
  }

  body.match-active .bench-tags .shop-decision-icon {
    width: 11px;
    height: 11px;
  }

  body.match-active .bench-empty {
    grid-column: 1 / -1;
  }
}

@media (min-width: 981px) {
  body.match-active .barracks-panel .panel-title {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  body.match-active .barracks-panel .panel-title > span {
    display: none;
  }

  body.match-active .barracks {
    gap: 10px;
    height: calc(100% - 44px);
  }

  body.match-active .unit-shop-card {
    min-height: 116px;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: stretch;
    gap: 12px;
    padding: 10px 12px;
    border-color: color-mix(in srgb, var(--rarity-color, var(--gold)) 34%, rgba(255, 240, 190, 0.14));
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--rarity-color, var(--gold)) 14%, transparent), transparent 58%),
      radial-gradient(circle at 18% 22%, color-mix(in srgb, var(--rarity-color, var(--gold)) 20%, transparent), transparent 34%),
      rgba(8, 13, 10, 0.9);
    text-align: left;
  }

  body.match-active .unit-shop-card:hover {
    border-color: color-mix(in srgb, var(--rarity-color, var(--gold)) 68%, #fff8e8);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--rarity-color, var(--gold)) 30%, transparent), 0 14px 28px rgba(0, 0, 0, 0.28);
  }

  body.match-active .unit-shop-card:disabled {
    border-color: rgba(255, 240, 190, 0.08);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 58%),
      rgba(4, 6, 5, 0.88);
    color: rgba(180, 188, 174, 0.42);
    cursor: not-allowed;
    filter: grayscale(0.88) saturate(0.42);
    opacity: 1;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.42);
  }

  body.match-active .unit-shop-card:disabled::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    background:
      linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.16)),
      repeating-linear-gradient(-45deg, rgba(255, 240, 190, 0.035) 0 5px, transparent 5px 11px);
    pointer-events: none;
  }

  body.match-active .unit-shop-card:disabled .choice-icon {
    filter: grayscale(1) brightness(0.48) contrast(0.85);
    opacity: 0.52;
  }

  body.match-active .unit-shop-card:disabled .choice-name,
  body.match-active .unit-shop-card:disabled .unit-shop-pill,
  body.match-active .unit-shop-card:disabled .unit-shop-details > span {
    color: rgba(214, 220, 202, 0.42);
  }

  body.match-active .unit-shop-card:disabled .unit-shop-pill,
  body.match-active .unit-shop-card:disabled .unit-shop-details > span {
    border-color: rgba(255, 240, 190, 0.08);
    background: rgba(0, 0, 0, 0.28);
  }

  body.match-active .unit-shop-card:disabled .choice-cost {
    border-color: color-mix(in srgb, var(--gold) 58%, rgba(255, 255, 255, 0.18));
    background: rgba(34, 24, 5, 0.9);
    color: var(--gold);
    filter: none;
    opacity: 1;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28), 0 0 14px rgba(242, 184, 75, 0.2);
  }

  body.match-active .unit-shop-card:disabled.is-too-expensive .choice-cost {
    border-color: rgba(255, 170, 74, 0.7);
    background: rgba(42, 24, 3, 0.94);
    color: #ffd36b;
  }

  body.match-active .unit-shop-card:disabled .choice-main,
  body.match-active .unit-shop-card:disabled .choice-cost,
  body.match-active .unit-shop-card:disabled .choice-icon {
    position: relative;
    z-index: 3;
  }

  body.match-active .unit-shop-card:disabled:hover {
    box-shadow: none;
    transform: none;
  }

  body.match-active .unit-shop-card.is-pending {
    border-color: rgba(98, 234, 208, 0.8);
    background:
      linear-gradient(180deg, rgba(98, 234, 208, 0.14), transparent 58%),
      rgba(5, 16, 15, 0.92);
    filter: none;
    cursor: wait;
    box-shadow: inset 0 0 0 1px rgba(98, 234, 208, 0.22), 0 0 22px rgba(98, 234, 208, 0.16);
  }

  body.match-active .unit-shop-card .choice-icon {
    align-self: center;
    width: 88px;
    height: 88px;
    border-radius: 8px;
  }

  body.match-active .unit-shop-card .choice-main {
    display: grid;
    align-content: center;
    justify-items: stretch;
    gap: 7px;
    min-width: 0;
  }

  body.match-active .unit-shop-card .choice-name {
    min-width: 0;
    overflow: hidden;
    padding-right: 64px;
    color: #fff8e8;
    font-size: 0.84rem;
    line-height: 1.08;
    text-align: left;
    text-transform: uppercase;
    white-space: normal;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body.match-active .unit-shop-card .choice-cost {
    position: absolute;
    top: 9px;
    right: 9px;
    align-self: auto;
    justify-self: auto;
    padding: 5px 7px;
    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.86rem;
  }

  body.match-active .unit-shop-floating-stats {
    position: absolute;
    top: 9px;
    left: 9px;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: calc(100% - 92px);
    pointer-events: none;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-floating-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    max-width: 78px;
  }

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

  body.match-active .unit-shop-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    min-height: 30px;
    padding: 5px 7px;
    border: 1px solid rgba(207, 217, 200, 0.16);
    border-radius: 6px;
    background: rgba(4, 8, 6, 0.62);
    color: #efe0ad;
    font-size: 0.76rem;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
  }

  body.match-active .unit-shop-hp {
    border-color: rgba(255, 120, 128, 0.34);
    background: linear-gradient(180deg, rgba(255, 116, 126, 0.18), rgba(36, 8, 12, 0.74));
    color: #ffadb4;
  }

  body.match-active .unit-shop-eco {
    border-color: rgba(134, 230, 153, 0.34);
    background: linear-gradient(180deg, rgba(114, 225, 143, 0.17), rgba(7, 31, 15, 0.74));
    color: #dff4ba;
  }

  body.match-active .unit-shop-floating-stats .unit-shop-pill {
    min-width: 54px;
    min-height: 25px;
    padding: 3px 7px;
    border-color: rgba(255, 240, 190, 0.22);
    border-radius: 999px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
    font-size: 0.68rem;
  }

  body.match-active .unit-shop-pill .heart-icon {
    width: 0.82em;
    height: 0.82em;
    margin: 0 0.12em 0 0;
  }

  body.match-active .unit-shop-pill .heart-icon::before,
  body.match-active .unit-shop-pill .heart-icon::after {
    width: 0.82em;
    height: 0.82em;
  }

  body.match-active .unit-shop-pill .heart-icon::before {
    top: -0.41em;
  }

  body.match-active .unit-shop-pill .heart-icon::after {
    left: 0.41em;
  }

  body.match-active .unit-shop-pill .income-icon {
    width: 1.2em;
    height: 1.06em;
    filter: drop-shadow(0 0 6px rgba(115, 228, 154, 0.34));
  }

  body.match-active .unit-shop-decision-row {
    justify-content: center;
    gap: 4px;
    min-height: 20px;
  }

  body.match-active .unit-shop-decision-row .shop-decision-badge {
    min-height: 18px;
    padding: 3px 6px;
    border-color: rgba(255, 240, 190, 0.2);
    background-color: rgba(4, 8, 7, 0.66);
    font-size: 0.58rem;
  }

  body.match-active .unit-shop-pill .selected-stat-icon {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    padding: 2px;
    border-radius: 4px;
  }

  body.match-active .unit-shop-pill .selected-stat-icon .stat-icon {
    width: 12px;
    height: 12px;
  }

  body.match-active .unit-shop-income {
    color: #dff4ba;
  }

  body.match-active .unit-shop-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    opacity: 0.72;
    transition: opacity 150ms ease;
  }

  body.match-active .unit-shop-card:hover .unit-shop-details,
  body.match-active .unit-shop-card:focus-visible .unit-shop-details {
    opacity: 1;
  }

  body.match-active .unit-shop-details > span {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 4px 5px;
    border-radius: 5px;
    background: rgba(4, 8, 6, 0.38);
    color: #cfd9c8;
    font-size: 0.62rem;
    line-height: 1.05;
  }

  body.match-active .unit-shop-details > span > span,
  body.match-active .unit-shop-details > span > strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.match-active .unit-shop-details > span > span {
    color: rgba(207, 217, 200, 0.72);
    font-weight: 700;
  }

  body.match-active .unit-shop-details > span > strong {
    color: #fff8e8;
    font-size: 0.68rem;
  }

  body.match-active .unit-shop-card .stat-icon {
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
  }
}

@media (min-width: 1500px) {
  body.match-active .sidebar {
    grid-template-columns: minmax(132px, 0.2fr) minmax(500px, 0.78fr) minmax(300px, 0.42fr) minmax(620px, 0.92fr);
  }

  body.match-active .barracks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: minmax(178px, 1fr);
    overflow-y: hidden;
  }

  body.match-active .unit-shop-card {
    min-height: 178px;
    grid-template-columns: 1fr;
    grid-template-rows: 96px auto auto;
    justify-items: stretch;
    gap: 9px;
    text-align: center;
  }

  body.match-active .unit-shop-card .choice-icon {
    justify-self: center;
    width: 118px;
    height: 96px;
  }

  body.match-active .unit-shop-card .choice-name {
    text-align: center;
  }

  body.match-active .unit-shop-details {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 981px) {
  body.match-active:not(.mobile-ui) .tower-panel .choice-button,
  body.match-active:not(.mobile-ui) .barracks .unit-shop-card {
    border-color: color-mix(in srgb, var(--rarity-color, var(--gold)) 52%, rgba(255, 240, 190, 0.14));
    border-radius: 8px;
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--rarity-color, var(--gold)) 18%, transparent), transparent 46%),
      radial-gradient(circle at 50% 24%, color-mix(in srgb, var(--rarity-color, var(--gold)) 24%, transparent), transparent 42%),
      rgba(4, 8, 7, 0.94);
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.035),
      inset 0 -34px 52px rgba(0, 0, 0, 0.34);
    overflow: hidden;
  }

  body.match-active:not(.mobile-ui) .tower-panel .choice-button:hover,
  body.match-active:not(.mobile-ui) .barracks .unit-shop-card:hover {
    border-color: color-mix(in srgb, var(--rarity-color, var(--gold)) 78%, #fff8e8);
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--rarity-color, var(--gold)) 24%, transparent), transparent 48%),
      radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--rarity-color, var(--gold)) 34%, transparent), transparent 44%),
      rgba(7, 13, 10, 0.98);
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--rarity-color, var(--gold)) 34%, transparent),
      0 16px 28px rgba(0, 0, 0, 0.34),
      inset 0 -34px 52px rgba(0, 0, 0, 0.28);
  }

  body.match-active:not(.mobile-ui) .tower-panel .choice-button::before,
  body.match-active:not(.mobile-ui) .barracks .unit-shop-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    display: block;
    border-radius: inherit;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 24%),
      linear-gradient(90deg, var(--rarity-color, var(--gold)) 0 4px, transparent 4px);
    opacity: 0.9;
    pointer-events: none;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-card:disabled {
    border-color: rgba(255, 240, 190, 0.08);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 58%),
      rgba(4, 6, 5, 0.88);
    color: rgba(180, 188, 174, 0.42);
    cursor: not-allowed;
    filter: none;
    opacity: 1;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.42);
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-card:disabled::before {
    z-index: 2;
    background:
      linear-gradient(135deg, rgba(0, 0, 0, 0.44), rgba(0, 0, 0, 0.18)),
      repeating-linear-gradient(-45deg, rgba(255, 240, 190, 0.035) 0 5px, transparent 5px 11px);
  }

  body.match-active:not(.mobile-ui) .tower-panel .mobile-shop-rarity,
  body.match-active:not(.mobile-ui) .barracks .mobile-shop-rarity {
    display: none;
  }

  body.match-active:not(.mobile-ui) .tower-panel .choice-cost,
  body.match-active:not(.mobile-ui) .barracks .unit-shop-card .choice-cost {
    z-index: 7;
    border: 1px solid rgba(255, 210, 117, 0.54);
    background: rgba(7, 8, 5, 0.86);
    color: #ffd978;
    font-weight: 950;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28), 0 0 12px rgba(242, 184, 75, 0.18);
  }

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

  body.match-active:not(.mobile-ui) .tower-panel .choice-icon {
    align-self: stretch;
    justify-self: stretch;
    width: 100%;
    height: 100%;
    min-height: 114px;
    border: 0;
    border-radius: 7px 7px 3px 3px;
    background:
      radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--rarity-color, var(--gold)) 20%, transparent), transparent 46%),
      rgba(2, 5, 5, 0.32) !important;
    box-shadow: inset 0 -28px 38px rgba(0, 0, 0, 0.4);
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-premium-icon img,
  body.match-active:not(.mobile-ui) .tower-panel .tower-rendered-icon img,
  body.match-active:not(.mobile-ui) .barracks .unit-premium-icon img,
  body.match-active:not(.mobile-ui) .barracks .unit-sheet-sprite {
    filter: none;
    transform: scale(1.12);
  }

  body.match-active:not(.mobile-ui) .tower-panel .choice-main {
    position: relative;
    z-index: 4;
    display: grid;
    align-content: center;
    gap: 5px;
    min-height: 74px;
    margin-top: -14px;
    padding: 18px 7px 7px;
    border-radius: 0 0 7px 7px;
    background: linear-gradient(180deg, transparent, rgba(1, 4, 4, 0.82) 16%, rgba(1, 4, 4, 0.94));
  }

  body.match-active:not(.mobile-ui) .tower-panel .choice-name {
    color: #fff8e8;
    font-size: 0.72rem;
    font-weight: 950;
    letter-spacing: 0;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.75);
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-stat-grid {
    display: none;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-stat-grid > .stat-pill {
    min-height: 20px;
    padding: 2px 3px;
    background: rgba(0, 0, 0, 0.34);
    font-size: 0.54rem;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-meta-row {
    display: none;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 7px;
    min-height: 28px;
    margin-bottom: 6px;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-header h2 {
    white-space: nowrap;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-header .odds-preview {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow: hidden;
    gap: 4px;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-header .odds-pill {
    min-height: 18px;
    padding: 2px 5px;
    font-size: 0.56rem;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-header .odds-pill strong {
    font-size: 0.58rem;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-header .shop-action {
    min-height: 28px;
    padding-inline: 8px;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-list {
    height: calc(100% - 34px);
  }

  body.match-active:not(.mobile-ui) .tower-panel .shop-decision-row,
  body.match-active:not(.mobile-ui) .barracks .shop-decision-row {
    justify-content: center;
  }

  body.match-active:not(.mobile-ui) .tower-panel .shop-decision-row {
    align-content: start;
    max-height: 38px;
    overflow: hidden;
    gap: 3px;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-floating-badges {
    position: absolute;
    top: -56px;
    left: 7px;
    right: 7px;
    z-index: 7;
    display: block;
    pointer-events: none;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-floating-badge {
    position: absolute;
    top: 0;
    display: inline-flex;
    max-width: 72px;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-floating-badge--element {
    left: 0;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-floating-badge--target {
    right: 0;
    top: 10px;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-floating-badge .shop-decision-badge {
    min-height: 21px;
    padding: 3px 7px;
    border-width: 1px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.11), transparent 62%),
      rgba(1, 7, 7, 0.78);
    box-shadow: 0 5px 13px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 248, 232, 0.14);
    font-size: 0.58rem;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-floating-badge .shop-decision-badge--element {
    min-height: 30px;
    padding: 4px;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-floating-badge--element .shop-decision-icon {
    width: 21px;
    height: 21px;
  }

  body.match-active:not(.mobile-ui) .tower-panel .shop-decision-row--plan {
    justify-content: center;
    max-height: 20px;
    margin-top: 1px;
  }

  body.match-active:not(.mobile-ui) .tower-panel .shop-decision-row--combat {
    justify-content: center;
    max-height: 42px;
    margin-top: 1px;
  }

  body.match-active:not(.mobile-ui) .tower-panel .shop-decision-badge,
  body.match-active:not(.mobile-ui) .barracks .shop-decision-badge {
    min-height: 18px;
    max-width: 100%;
    padding: 2px 6px;
    font-size: 0.56rem;
  }

  body.match-active:not(.mobile-ui) .tower-panel .shop-decision-badge {
    min-height: 17px;
    max-width: 82px;
    padding: 2px 5px;
    font-size: 0.52rem;
  }

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

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

  body.match-active:not(.mobile-ui) .tower-panel .tower-shop-floating-badge--element .shop-decision-badge--element-icon .shop-decision-icon {
    width: 24px;
    height: 24px;
    transform: scale(1.08);
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-trait-chip--compact {
    max-width: 96px;
    border-color: color-mix(in srgb, var(--rarity-color, var(--gold)) 36%, rgba(255, 240, 190, 0.12));
    background: rgba(0, 0, 0, 0.28);
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-card {
    grid-template-columns: minmax(118px, 0.42fr) minmax(0, 1fr);
    min-height: 136px;
    gap: 10px;
    padding: 8px 10px 8px 8px;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-card .choice-icon {
    align-self: stretch;
    justify-self: stretch;
    width: 100%;
    height: 100%;
    min-height: 118px;
    border: 0;
    border-radius: 7px;
    background:
      radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--rarity-color, var(--gold)) 20%, transparent), transparent 46%),
      rgba(2, 5, 5, 0.32) !important;
    box-shadow: inset 0 -28px 38px rgba(0, 0, 0, 0.4);
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-card .choice-main {
    position: relative;
    z-index: 4;
    align-content: center;
    gap: 8px;
    padding-top: 0;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-card .choice-name {
    display: -webkit-box;
    max-height: 2.1em;
    padding-right: 54px;
    overflow: hidden;
    font-size: 0.86rem;
    font-weight: 950;
    line-height: 1.05;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.72);
  }

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

  body.match-active:not(.mobile-ui) .barracks .unit-shop-pill {
    min-height: 26px;
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.32);
  }

  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;
    align-content: center;
    justify-content: center;
    gap: 4px;
    max-height: 42px;
    margin-top: 0;
    overflow: hidden;
  }

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

@media (min-width: 981px) and (max-width: 1280px) {
  body.match-active:not(.mobile-ui) .sidebar {
    grid-template-columns: minmax(112px, 0.18fr) minmax(400px, 0.82fr) minmax(230px, 0.42fr) minmax(270px, 0.56fr);
    gap: 8px;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-list {
    grid-template-columns: repeat(5, minmax(72px, 1fr));
    gap: 6px;
  }

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

  body.match-active:not(.mobile-ui) .tower-panel .choice-icon {
    min-height: 82px;
  }

  body.match-active:not(.mobile-ui) .tower-panel .choice-main {
    min-height: 58px;
    gap: 5px;
    margin-top: -11px;
    padding: 14px 5px 5px;
  }

  body.match-active:not(.mobile-ui) .tower-panel .choice-name {
    font-size: 0.62rem;
  }

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

  body.match-active:not(.mobile-ui) .tower-panel .tower-stat-grid {
    display: none;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-stat-grid > .stat-pill {
    min-height: 18px;
    padding: 1px 2px;
    font-size: 0.48rem;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-stat-grid .stat-icon {
    width: 10px;
    height: 10px;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-meta-row {
    display: none;
  }

  body.match-active:not(.mobile-ui) .barracks {
    gap: 7px;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-card {
    grid-template-columns: 74px minmax(0, 1fr);
    min-height: 88px;
    gap: 6px;
    padding: 5px 6px 5px 5px;
  }

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

  body.match-active:not(.mobile-ui) .barracks .mobile-shop-rarity {
    display: none;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-card .choice-main {
    align-content: center;
    gap: 4px;
    padding-top: 0;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-card .choice-name {
    padding-right: 42px;
    font-size: 0.66rem;
    line-height: 1.02;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-card .choice-cost {
    top: 5px;
    right: 5px;
    padding: 2px 5px;
    font-size: 0.66rem;
  }

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

  body.match-active:not(.mobile-ui) .barracks .unit-shop-pill {
    min-height: 18px;
    padding: 2px 3px;
    gap: 3px;
    font-size: 0.54rem;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-pill .selected-stat-icon {
    flex-basis: 13px;
    width: 13px;
    height: 13px;
    padding: 1px;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-pill .stat-icon,
  body.match-active:not(.mobile-ui) .barracks .unit-shop-pill .income-icon {
    width: 9px;
    height: 9px;
  }

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

@media (min-width: 1281px) and (max-width: 1499px) {
  body.match-active:not(.mobile-ui) .sidebar {
    grid-template-columns: minmax(124px, 0.2fr) minmax(470px, 0.84fr) minmax(280px, 0.48fr) minmax(330px, 0.62fr);
  }

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

  body.match-active:not(.mobile-ui) .tower-panel .choice-icon {
    min-height: 100px;
  }

  body.match-active:not(.mobile-ui) .tower-panel .choice-main {
    min-height: 66px;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-card {
    grid-template-columns: minmax(104px, 0.4fr) minmax(0, 1fr);
    min-height: 126px;
  }

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

  body.match-active:not(.mobile-ui) .barracks .unit-shop-card .choice-main {
    align-content: center;
    gap: 5px;
    padding-top: 0;
  }

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

@media (min-width: 981px) and (max-height: 820px) {
  body.match-active:not(.mobile-ui) .shell {
    grid-template-rows: minmax(0, 1fr) 242px;
  }

  body.match-active:not(.mobile-ui) .selected-panel:not([hidden]) {
    bottom: 258px;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-list {
    height: calc(100% - 34px);
    padding-bottom: 4px;
  }

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

  body.match-active:not(.mobile-ui) .tower-panel .choice-icon {
    min-height: 76px;
  }

  body.match-active:not(.mobile-ui) .tower-panel .choice-main {
    min-height: 54px;
    gap: 4px;
    margin-top: -10px;
    padding-top: 13px;
  }

  body.match-active:not(.mobile-ui) .tower-panel .choice-name {
    font-size: 0.6rem;
  }

  body.match-active:not(.mobile-ui) .tower-panel .tower-stat-grid > .stat-pill {
    min-height: 16px;
    font-size: 0.46rem;
  }

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

  body.match-active:not(.mobile-ui) .barracks .unit-shop-card {
    min-height: 86px;
  }

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

@media (min-width: 1500px) {
  body.match-active:not(.mobile-ui) .barracks .unit-shop-card {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(126px, 1fr) auto;
    gap: 0;
    padding: 7px;
  }

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

  body.match-active:not(.mobile-ui) .barracks .unit-shop-card .choice-main {
    margin-top: -18px;
    padding: 16px 7px 7px;
    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;
    text-align: center;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-details > span {
    padding: 3px 4px;
    font-size: 0.56rem;
  }

  body.match-active:not(.mobile-ui) .barracks .unit-shop-details > span > strong {
    font-size: 0.62rem;
  }
}

@media (max-width: 980px) {
  body.match-active .unit-shop-card {
    min-height: 102px;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 9px;
    padding: 9px 10px;
  }

  body.match-active .unit-shop-card .choice-icon {
    width: 70px;
    height: 70px;
  }

  body.match-active .unit-shop-card .choice-main {
    justify-items: stretch;
  }

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

  body.match-active .unit-shop-pill {
    min-height: 26px;
    padding: 4px 5px;
    font-size: 0.68rem;
  }

  body.match-active .unit-shop-details {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.match-active .unit-shop-details > span {
    padding: 3px 4px;
    font-size: 0.58rem;
  }
}

/* Responsive game HUD refinements */
body.match-active .topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(78px, 7vw, 104px) 48px;
  align-items: stretch;
  gap: 8px;
  min-height: 60px;
  padding: 0;
}

body.match-active .scoreboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 150px));
  align-items: stretch;
  align-content: start;
  justify-content: start;
  gap: 6px;
  width: 100%;
  overflow: visible;
}

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

body.match-active .score-card {
  min-height: 56px;
  grid-template-columns: clamp(30px, 2.3vw, 40px) minmax(0, 1fr);
  gap: 6px;
  padding: 6px 7px;
}

body.match-active .score-avatar {
  width: clamp(30px, 2.3vw, 40px);
  height: clamp(30px, 2.3vw, 40px);
}

  body.match-active .score-name span:last-child {
    display: none;
  }

  body.match-active .score-values {
    display: flex;
    flex-wrap: wrap;
  gap: 3px 7px;
  margin-top: 3px;
  font-size: clamp(0.68rem, 0.62vw, 0.78rem);
}

body.match-active .round-widget {
  position: relative;
  inset: auto;
  z-index: 1;
  width: auto;
  height: auto;
  min-height: 56px;
  transform: none;
  border-radius: 8px;
}

body.match-active .round-widget::before,
body.match-active .round-widget::after {
  display: none;
}

body.match-active .round-widget span {
  font-size: 0.62rem;
}

body.match-active .round-widget strong {
  font-size: clamp(1.65rem, 2.1vw, 2.25rem);
  line-height: 0.9;
}

body.match-active .round-widget em {
  font-size: 0.72rem;
}

body.match-active .toolbar {
  position: relative;
  top: auto;
  right: auto;
  z-index: 2;
  justify-self: end;
}

body.match-active .tool-button {
  width: 46px;
  height: 46px;
}

body.match-active .stat-row--bar {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
}

body.match-active .resource-bar {
  height: 12px;
}

@media (max-width: 1180px) {
  body.match-active .topbar {
    min-height: 118px;
    grid-template-columns: minmax(0, 1fr) 82px 46px;
    padding: 0;
  }

  body.match-active .scoreboard {
    grid-template-columns: repeat(3, minmax(96px, 138px));
  }

  body.match-active .score-card {
    min-height: 52px;
    padding: 5px 7px;
  }

  body.match-active .score-values {
    font-size: 0.72rem;
  }
}

@media (max-width: 720px) {
  body.match-active .topbar {
    min-height: 168px;
    grid-template-columns: minmax(0, 1fr) 72px 42px;
    padding: 0;
  }

  body.match-active .scoreboard {
    grid-template-columns: repeat(2, minmax(104px, 1fr));
  }

  body.match-active .round-widget {
    min-height: 52px;
  }
}

/* Compact top HUD and collapsible chat */
body.match-active .topbar {
  grid-template-columns: clamp(128px, 12vw, 174px) minmax(0, 1fr) 58px;
  align-items: start;
  gap: 6px;
  min-height: 76px;
  overflow: visible;
}

body.match-active .scoreboard {
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: repeat(6, minmax(82px, 1fr));
  gap: 5px;
  min-width: 0;
  overflow: visible;
}

body.match-active .score-card {
  min-height: 50px;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 5px;
  padding: 5px 6px;
}

body.match-active .score-avatar {
  width: 28px;
  height: 28px;
  font-size: 0.66rem;
}

body.match-active .score-index {
  width: 17px;
  height: 17px;
  font-size: 0.58rem;
}

body.match-active .score-name span:first-child {
  font-size: clamp(0.62rem, 0.56vw, 0.74rem);
}

body.match-active .score-values {
  gap: 2px 5px;
  font-size: clamp(0.62rem, 0.56vw, 0.72rem);
}

body.match-active .round-widget {
  grid-column: 1;
  grid-row: 1;
  width: auto;
  min-width: 0;
  min-height: 74px;
  padding: 8px 10px;
  border-color: rgba(215, 169, 74, 0.68);
  background:
    radial-gradient(circle at 48% 18%, rgba(98, 234, 208, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(255, 240, 190, 0.16), rgba(8, 12, 10, 0.92) 64%),
    rgba(8, 12, 10, 0.94);
}

body.match-active .round-widget strong {
  font-size: clamp(2rem, 2.65vw, 3rem);
}

body.match-active .round-widget span {
  font-size: 0.72rem;
}

body.match-active .round-widget em {
  font-size: 0.9rem;
}

body.match-active .toolbar {
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
}

body.match-active .tool-button {
  width: 42px;
  height: 42px;
}

.chat-content {
  display: grid;
}

.chat-toggle-button {
  position: relative;
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(215, 169, 74, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.1), transparent),
    rgba(9, 14, 11, 0.88);
  color: #efe0ad;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 950;
}

.chat-toggle-button:hover,
.chat-toggle-button:focus-visible {
  border-color: rgba(98, 234, 208, 0.58);
  color: #f6fff4;
}

body.match-active .chat-panel .panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

body.match-active .chat-panel .panel-title > div {
  min-width: 0;
}

body.match-active .chat-panel .panel-title h2 {
  margin: 0;
}

body.match-active .chat-panel .panel-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.match-active .chat-panel {
  top: auto;
  right: 10px;
  bottom: 48px;
  z-index: 38;
  width: min(340px, calc(100vw - 36px));
  padding: 10px;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.34);
}

body.match-active .chat-panel.has-unread {
  border-color: rgba(255, 139, 132, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 139, 132, 0.18), transparent 54%),
    linear-gradient(180deg, rgba(255, 240, 190, 0.08), transparent 56%),
    rgba(15, 13, 11, 0.94);
}

body.match-active .chat-panel.has-unread .panel-title h2::after {
  content: "Nouveau";
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 139, 132, 0.22);
  color: #ffd8d8;
  font-size: 0.58rem;
  font-weight: 950;
  vertical-align: middle;
}

.chat-content[hidden] {
  display: none !important;
}

body.match-active .chat-panel.is-collapsed {
  width: min(220px, calc(100vw - 36px));
  padding: 8px 10px;
}

body.match-active .chat-panel.is-collapsed .panel-title {
  margin-bottom: 0;
}

body.match-active .chat-panel.has-unread .chat-toggle-button::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff8b84;
  box-shadow: 0 0 10px rgba(255, 139, 132, 0.7);
}

@media (max-width: 1180px) {
  body.match-active .topbar {
    grid-template-columns: 116px minmax(0, 1fr) 58px;
    min-height: 116px;
  }

  body.match-active .scoreboard {
    grid-template-columns: repeat(3, minmax(92px, 1fr));
  }

  body.match-active .round-widget {
    min-height: 86px;
  }

  body.match-active .round-widget strong {
    font-size: 2.15rem;
  }
}

@media (max-width: 720px) {
  body.match-active .topbar {
    grid-template-columns: minmax(0, 1fr) 58px;
    min-height: 208px;
  }

  body.match-active .scoreboard {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(2, minmax(92px, 1fr));
  }

  body.match-active .round-widget {
    grid-column: 1;
    grid-row: 1;
    min-height: 58px;
    grid-template-columns: auto auto auto;
    justify-content: start;
    gap: 8px;
  }

  body.match-active .toolbar {
    grid-column: 2;
    grid-row: 1;
  }

  body.match-active .score-card {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  body.match-active .score-avatar {
    width: 24px;
    height: 24px;
  }

  body.match-active .round-widget span {
    font-size: 0.62rem;
  }

  body.match-active .round-widget strong {
    font-size: 1.8rem;
  }

  body.match-active .tool-button {
    width: 38px;
    height: 38px;
  }

  body.match-active .chat-panel {
    right: 8px;
    bottom: 46px;
    width: min(312px, calc(100vw - 24px));
  }
}

/* Mobile game UI */
:root {
  --mobile-hud-height: 76px;
  --mobile-bottom-nav-height: 64px;
  --mobile-panel-radius: 14px;
  --mobile-safe-padding: max(10px, env(safe-area-inset-left));
  --touch-target-size: 46px;
}

.mobile-top-bar,
.mobile-bottom-nav,
.mobile-bottom-sheet-header,
.mobile-placement-toolbar,
.mobile-augments-panel,
.mobile-players-panel {
  display: none;
}

.mobile-shop-rarity {
  display: none;
}

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

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

body.mobile-ui.match-active .game-area {
  display: flex;
  height: 100dvh;
  min-height: 0;
  padding: calc(env(safe-area-inset-top) + 6px) 8px calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom) + 8px);
  gap: 6px;
  overflow: hidden;
}

body.mobile-ui.match-active .mobile-top-bar {
  position: relative;
  z-index: 44;
  display: grid;
  grid-template-columns: minmax(132px, 0.95fr) minmax(0, 2.05fr) auto;
  align-items: center;
  gap: 6px;
  min-height: var(--mobile-hud-height);
  padding: 6px;
  border: 1px solid rgba(215, 169, 74, 0.32);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.11), transparent 58%),
    rgba(7, 12, 9, 0.92);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

body.mobile-ui.match-active .mobile-player-chip {
  display: grid;
  grid-template-columns: 126px 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(3, minmax(34px, 1fr));
  gap: 3px;
}

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.82rem;
}

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

body.mobile-ui.match-active .mobile-player-book-button,
body.mobile-ui.match-active .mobile-player-power-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(--touch-target-size);
  min-height: var(--touch-target-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(10, 15, 12, 0.94);
  color: #fff8e8;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 950;
  cursor: pointer;
  touch-action: manipulation;
}

body.mobile-ui.match-active .mobile-player-book-button {
  font-size: 0.82rem;
  color: #efe0ad;
}

body.mobile-ui.match-active .mobile-player-power-button {
  color: #ffd166;
  font-size: 0.78rem;
}

.power-box-mini-icon {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 auto;
  object-fit: contain;
}

body.mobile-ui.match-active .mobile-player-traits-button {
  min-width: 40px;
  color: #f0dcff;
  font-size: 0.7rem;
}

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

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

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

body.mobile-ui.match-active .mobile-stat-button {
  width: 100%;
  border-color: rgba(98, 234, 208, 0.34);
  color: inherit;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

body.mobile-ui.match-active .mobile-stat-button:not(:disabled) {
  box-shadow: inset 0 0 0 1px rgba(98, 234, 208, 0.12), 0 0 14px rgba(98, 234, 208, 0.08);
}

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

body.mobile-ui.match-active .mobile-stat span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 900;
  text-transform: uppercase;
}

body.mobile-ui.match-active .mobile-stat strong {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: #fff8e8;
  font-size: 0.82rem;
  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--defense strong { color: #aee7ff; }
body.mobile-ui.match-active .mobile-stat--level strong { color: #9ff7ff; }
body.mobile-ui.match-active .mobile-stat--xp strong { color: #9ff7ff; }
body.mobile-ui.match-active .mobile-stat--round strong { color: #9ff7ff; }

body.mobile-ui.match-active .topbar {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 4px);
  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) + 70px);
  right: 8px;
  width: min(310px, calc(100vw - 16px));
  max-height: min(70dvh, 560px);
  overflow: auto;
}

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

body.mobile-ui.match-active .threat-panel,
body.mobile-ui.match-active .round-recap-panel {
  display: none !important;
}

body.mobile-ui.match-active .map-effect-toast {
  top: calc(var(--mobile-top-bar-height) + env(safe-area-inset-top) + 8px);
  right: 8px;
  left: 8px;
  z-index: 57;
  width: auto;
}

body.mobile-ui.match-active canvas {
  width: clamp(2500px, 720vw, 4300px);
  max-width: none;
  aspect-ratio: 3 / 2;
}

body.mobile-ui.match-active .hintbar {
  left: 10px;
  right: 10px;
  bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom) + 8px);
  z-index: 42;
  font-size: 0.72rem;
}

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 {
  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;
  left: 8px;
  right: 8px;
  bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom) + 6px);
  z-index: 56;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  height: min(54dvh, 520px);
  max-height: min(54dvh, 520px);
  min-height: 0;
  padding: 8px;
  border: 1px solid rgba(215, 169, 74, 0.32);
  border-radius: var(--mobile-panel-radius) var(--mobile-panel-radius) 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);
  overflow: hidden;
  transform: translateY(calc(100% + var(--mobile-bottom-nav-height) + 24px));
  transition: transform 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: 44px;
  padding: 4px 2px 8px;
}

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

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

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

body.mobile-ui.match-active .mobile-close-button {
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  font-size: 1.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: 10px;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .sidebar {
  grid-template-rows: auto minmax(0, 1.2fr) minmax(112px, 0.7fr);
}

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

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 {
  grid-template-columns: 1fr;
  grid-auto-flow: row;
  grid-auto-columns: initial;
  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(--touch-target-size);
}

body.mobile-ui.match-active .shop-card,
body.mobile-ui.match-active .unit-shop-card {
  position: relative;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 9px;
  padding: 9px;
}

body.mobile-ui.match-active .tower-panel .choice-button,
body.mobile-ui.match-active .barracks .choice-button {
  height: auto;
  min-height: 116px;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  grid-template-rows: none;
  align-items: start;
  justify-items: stretch;
  align-content: start;
  text-align: left;
}

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

body.mobile-ui.match-active .tower-panel .choice-icon,
body.mobile-ui.match-active .barracks .choice-icon {
  justify-self: stretch;
}

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 {
  padding-right: 0;
  color: #fff8e8;
  font-size: 0.78rem;
  line-height: 1.08;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.mobile-ui.match-active .mobile-shop-rarity {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  display: inline-flex;
  max-width: 76px;
  padding: 2px 5px;
  border: 1px solid rgba(255, 248, 232, 0.18);
  border-radius: 999px;
  background: rgba(3, 7, 5, 0.82);
  color: #efe0ad;
  font-size: 0.52rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

body.mobile-ui.match-active .shop-match-badge + .mobile-shop-rarity {
  top: 24px;
}

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: 24px;
  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.64rem;
  line-height: 1.05;
}

body.mobile-ui.match-active .tower-stat-grid > .stat-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #cfd9c8;
}

body.mobile-ui.match-active .tower-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 18px;
}

body.mobile-ui.match-active .tower-tags > span {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid rgba(151, 184, 211, 0.14);
  border-radius: 5px;
  background: rgba(4, 8, 6, 0.5);
}

body.mobile-ui.match-active .unit-shop-details {
  opacity: 0.92;
}

body.mobile-ui.match-active .unit-shop-details > span {
  display: grid;
  gap: 1px;
}

body.mobile-ui.match-active .unit-shop-details > span > span {
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 900;
  text-transform: uppercase;
}

body.mobile-ui.match-active .unit-shop-details > span > strong,
body.mobile-ui.match-active .unit-shop-pill strong {
  color: #fff8e8;
  font-weight: 950;
}

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: 42px;
  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.78rem;
  text-align: center;
}

body.mobile-ui.match-active .choice-desc,
body.mobile-ui.match-active .unit-shop-details {
  font-size: 0.72rem;
}

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

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 .resource-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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)) 104px;
  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-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 {
  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 {
  min-width: 0;
  overflow: hidden;
  color: #fff8e8;
  font-size: 0.66rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui.match-active .mobile-player-stat--gold b { color: var(--gold); }
body.mobile-ui.match-active .mobile-player-stat--income b { color: #dff4ba; }
body.mobile-ui.match-active .mobile-player-stat--defense b { color: #aee7ff; }

body.mobile-ui.match-active .mobile-player-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--player-color, var(--gold));
  box-shadow: 0 0 12px color-mix(in srgb, var(--player-color, var(--gold)) 55%, transparent);
}

body.mobile-ui.match-active .mobile-player-actions {
  display: grid;
  grid-template-columns: repeat(3, 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: 10px;
  right: 10px;
  top: calc(var(--mobile-hud-height) + env(safe-area-inset-top) + 14px);
  bottom: auto;
  z-index: 50;
  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 .augment-panel,
body.mobile-ui.match-active .augment-book-panel,
body.mobile-ui.match-active .power-book-panel,
body.mobile-ui.match-active .traits-panel,
body.mobile-ui.match-active .power-reveal-panel {
  width: min(calc(100vw - 44px), 560px);
  max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 18px);
  padding: 14px;
  overflow: auto;
}

body.mobile-ui.match-active .augment-overlay {
  background: rgba(1, 5, 4, 0.18);
  backdrop-filter: blur(1px);
}

body.mobile-ui.match-active .augment-panel {
  width: min(calc(100vw - 72px), 420px);
  max-height: min(58dvh, calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 112px));
  padding: 10px;
  border-color: rgba(255, 240, 190, 0.18);
  background:
    linear-gradient(180deg, rgba(17, 24, 18, 0.78), rgba(5, 9, 7, 0.76)),
    rgba(5, 9, 7, 0.72);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
}

body.mobile-ui.match-active .augment-timer {
  min-height: 32px;
  margin: -2px 0 9px;
  padding: 6px 8px;
}

body.mobile-ui.match-active .augment-timer span {
  font-size: 0.64rem;
}

body.mobile-ui.match-active .augment-timer strong {
  font-size: 0.94rem;
}

body.mobile-ui.match-active .augment-choice-grid,
body.mobile-ui.match-active .augment-book-list,
body.mobile-ui.match-active .power-book-list {
  grid-template-columns: 1fr;
}

body.mobile-ui.match-active .augment-choice-grid {
  gap: 8px;
}

body.mobile-ui.match-active .augment-card {
  min-height: 0;
  gap: 7px;
  padding: 9px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--augment-color, #d7a94a) 13%, transparent), transparent 64%),
    rgba(7, 12, 9, 0.72);
}

body.mobile-ui.match-active .augment-card h3 {
  font-size: 0.92rem;
  line-height: 1.1;
}

body.mobile-ui.match-active .augment-card p {
  font-size: 0.72rem;
  line-height: 1.25;
}

body.mobile-ui.match-active .augment-card .augment-rarity {
  padding: 2px 7px;
  font-size: 0.62rem;
}

body.mobile-ui.match-active .augment-actions > button {
  min-height: 36px;
}

body.mobile-ui.match-active .power-reveal-panel {
  width: min(calc(100vw - 32px), 420px);
  gap: 10px;
}

body.mobile-ui.match-active .power-wheel {
  width: min(188px, 54vw);
}

body.mobile-ui.match-active .power-reveal-card {
  grid-template-columns: 48px minmax(0, 1fr);
}

body.mobile-ui.match-active .power-box-card {
  min-height: 96px;
}

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

body.mobile-ui.match-active .chat-panel {
  right: 8px;
  bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom) + 8px);
  z-index: 54;
  width: min(342px, calc(100vw - 16px));
}

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

@media (max-width: 480px) {
  :root {
    --mobile-hud-height: 84px;
    --mobile-bottom-nav-height: 60px;
    --touch-target-size: 44px;
  }

  body.mobile-ui.match-active .mobile-top-bar {
    grid-template-columns: minmax(156px, 1fr) minmax(0, 1.9fr) 46px;
    gap: 4px;
    padding: 5px;
  }

  body.mobile-ui.match-active .mobile-hud-stats {
    gap: 3px;
  }

  body.mobile-ui.match-active .mobile-stat {
    padding: 4px 2px;
  }

  body.mobile-ui.match-active .mobile-stat span {
    font-size: 0.52rem;
  }

  body.mobile-ui.match-active .mobile-stat strong {
    font-size: 0.68rem;
  }

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

  body.mobile-ui.match-active .mobile-menu-button,
  body.mobile-ui.match-active .mobile-action-button {
    font-size: 0.68rem;
  }

  body.mobile-ui.match-active .sidebar {
    left: 6px;
    right: 6px;
  }

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

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

@media (orientation: landscape) and (max-width: 980px) {
  body.mobile-ui.match-active {
    --mobile-hud-height: 52px;
    --mobile-bottom-nav-height: 56px;
  }

  body.mobile-ui.match-active .game-area {
    padding-top: calc(env(safe-area-inset-top) + 4px);
  }

  body.mobile-ui.match-active .mobile-top-bar {
    grid-template-columns: minmax(120px, 0.8fr) minmax(260px, 1.7fr) 58px;
    min-height: var(--mobile-hud-height);
  }

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

  body.mobile-ui.match-active .sidebar {
    top: calc(var(--mobile-hud-height) + env(safe-area-inset-top) + 10px);
    left: auto;
    right: calc(env(safe-area-inset-right) + 8px);
    bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom) + 10px);
    width: min(430px, 46vw);
    height: auto;
    max-height: none;
  }

  body.mobile-ui.match-active .mobile-bottom-nav {
    grid-template-columns: repeat(5, minmax(92px, 1fr));
    justify-content: center;
    left: 50%;
    transform: translateX(-50%);
    width: min(620px, 100vw);
  }

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

body.mobile-ui.match-active[data-mobile-panel="towers"] .sidebar {
  height: min(38dvh, 350px);
  max-height: min(38dvh, 350px);
  padding: 6px;
  gap: 6px;
  grid-template-rows: 34px minmax(142px, 1.25fr) minmax(74px, 0.55fr);
}

body.mobile-ui.match-active[data-mobile-panel="towers"].mobile-sheet-expanded .sidebar {
  height: min(56dvh, 520px);
  max-height: min(56dvh, 520px);
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .mobile-bottom-sheet-header {
  min-height: 34px;
  padding: 0 0 4px;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .mobile-bottom-sheet-header strong {
  font-size: 0.88rem;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .mobile-bottom-sheet-header span {
  font-size: 0.54rem;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .mobile-close-button {
  min-width: 34px;
  min-height: 34px;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .sidebar .panel {
  padding: 7px;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .tower-panel,
body.mobile-ui.match-active[data-mobile-panel="towers"] .bench-panel {
  gap: 5px;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .tower-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .bench-panel {
  grid-template-rows: auto minmax(0, 1fr);
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .panel-title {
  min-height: 22px;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .panel-title h2 {
  font-size: 0.72rem;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .shop-toolbar {
  gap: 5px;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .odds-preview {
  overflow-x: auto;
  white-space: nowrap;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .tower-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(164px, 58vw);
  grid-template-columns: none;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 2px 3px 0;
  scroll-snap-type: x proximity;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .tower-panel .choice-button {
  min-height: 72px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 6px;
  padding: 7px;
  scroll-snap-align: start;
}

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

/* Final key-art launcher overrides: this file contains later responsive blocks,
   so these must stay at the end to preserve the desktop menu composition. */
body.is-authenticated:not(.match-active) .launcher-panel {
  --launcher-main-y: 10%;
  --launcher-main-bottom: 6%;
}

body.is-authenticated:not(.match-active) .play-action-item > .primary-button {
  min-height: clamp(58px, 6vh, 76px);
}

body.is-authenticated:not(.match-active) .play-action-item > .mode-button {
  min-height: clamp(46px, 4.9vh, 58px);
}

/* Anime key-art menu refresh. Keep this near the end so it lightly overrides
   the older portal frame without touching the in-game HUD layout. */
body {
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 152, 46, 0.16), transparent 30%),
    linear-gradient(90deg, rgba(4, 8, 16, 0.76) 0%, rgba(4, 8, 16, 0.26) 30%, rgba(4, 8, 16, 0.12) 62%, rgba(5, 3, 12, 0.58) 100%),
    linear-gradient(180deg, rgba(4, 3, 9, 0.16), rgba(4, 3, 9, 0.72)),
    url("assets/brand/tdt-menu-keyart-bg.jpg?v=20260606-keyart-menu1") center center / cover no-repeat fixed,
    #080611;
}

body::before {
  background:
    radial-gradient(circle at 19% 20%, rgba(88, 215, 255, 0.12), transparent 22%),
    radial-gradient(circle at 82% 44%, rgba(156, 70, 255, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(3, 4, 9, 0.12), rgba(3, 4, 9, 0.5));
  mask-image: none;
}

.brand-logo,
.launcher-brand-logo {
  display: block;
  width: min(100%, 620px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.58));
}

.brand-logo {
  margin: 4px 0 14px;
}

.launcher-brand-logo {
  width: min(100%, clamp(320px, 34vw, 620px));
  margin: -6px 0 -2px;
}

body:not(.is-authenticated) .shell {
  grid-template-columns: minmax(720px, 1180px);
  padding: clamp(20px, 3vw, 42px);
}

body:not(.is-authenticated) .sidebar {
  grid-template-columns: minmax(340px, 0.95fr) minmax(390px, 0.8fr);
  gap: clamp(22px, 3vw, 44px);
  min-height: min(760px, calc(100vh - 72px));
  padding: clamp(22px, 3vw, 40px);
  border-color: rgba(255, 222, 128, 0.24);
  background:
    radial-gradient(circle at 18% 8%, rgba(84, 211, 242, 0.2), transparent 32%),
    radial-gradient(circle at 78% 20%, rgba(255, 139, 68, 0.14), transparent 26%),
    linear-gradient(120deg, rgba(4, 9, 16, 0.46), rgba(4, 18, 24, 0.18) 52%, rgba(3, 5, 12, 0.56));
  box-shadow:
    0 30px 88px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 245, 199, 0.14),
    inset 0 0 0 1px rgba(92, 219, 255, 0.08);
  backdrop-filter: blur(8px) saturate(1.14);
}

body.page-auth .brand {
  align-content: end;
  min-height: 520px;
  padding: 24px clamp(16px, 2.4vw, 34px) 28px 0;
  border-right-color: rgba(255, 225, 142, 0.18);
}

body.page-auth .brand .eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border: 1px solid rgba(106, 239, 219, 0.54);
  border-radius: 7px;
  background: rgba(4, 19, 22, 0.62);
  color: #6aefdb;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

body.page-auth .subtitle {
  max-width: 560px;
  color: #eef8f0;
  font-size: clamp(1rem, 1.4vw, 1.22rem);
  font-weight: 780;
  text-shadow: 0 5px 18px rgba(0, 0, 0, 0.7);
}

body.page-auth .auth-panel {
  align-self: center;
  border-color: rgba(255, 218, 112, 0.28);
  background:
    radial-gradient(circle at 12% 0, rgba(98, 234, 208, 0.14), transparent 34%),
    linear-gradient(145deg, rgba(20, 40, 54, 0.64), rgba(45, 23, 10, 0.28) 58%, rgba(6, 7, 12, 0.66)),
    rgba(3, 8, 13, 0.58);
  box-shadow:
    0 24px 58px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 245, 199, 0.14);
  backdrop-filter: blur(10px) saturate(1.12);
}

body.is-authenticated:not(.match-active) .shell {
  width: min(calc(100vw - 28px), calc((100vh - 24px) * 16 / 9), 1840px);
  height: min(calc(100vh - 30px), calc((100vw - 48px) * 9 / 16));
}

body.is-authenticated:not(.match-active) .launcher-panel::before {
  display: none;
}

body.is-authenticated:not(.match-active) .launcher-panel::after {
  inset: -1px;
  border: 1px solid rgba(255, 228, 142, 0.12);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(2, 8, 14, 0.66) 0%, rgba(2, 8, 14, 0.22) 33%, rgba(2, 8, 14, 0.06) 62%, rgba(2, 4, 11, 0.42) 100%),
    radial-gradient(circle at 16% 82%, rgba(34, 205, 231, 0.16), transparent 22%),
    radial-gradient(circle at 88% 16%, rgba(167, 77, 255, 0.12), transparent 28%);
}

body.is-authenticated:not(.match-active) .launcher-nav {
  top: 10%;
  bottom: 6%;
  width: 21.5%;
}

body.is-authenticated:not(.match-active) .launcher-mark,
body.is-authenticated:not(.match-active) .profile-card,
body.is-authenticated:not(.match-active) .launcher-page-header > div,
body.is-authenticated:not(.match-active) .launcher-audio {
  border-color: rgba(255, 225, 142, 0.18);
  background:
    linear-gradient(135deg, rgba(43, 218, 242, 0.08), transparent 48%),
    rgba(2, 10, 16, 0.42);
  backdrop-filter: blur(8px) saturate(1.08);
}

body.is-authenticated:not(.match-active) .launcher-page-header {
  min-height: clamp(112px, 14vh, 172px);
  padding-bottom: clamp(6px, 0.8vh, 10px);
}

body.is-authenticated:not(.match-active) .launcher-page-header > div {
  display: grid;
  justify-items: start;
  width: fit-content;
  max-width: min(100%, 820px);
  padding: clamp(10px, 1.1vw, 16px) clamp(14px, 1.4vw, 22px);
  border: 1px solid rgba(255, 225, 142, 0.14);
  border-radius: 10px;
}

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

body.is-authenticated:not(.match-active) .launcher-content {
  border: 1px solid rgba(255, 225, 142, 0.08);
  border-radius: 10px;
  background: rgba(2, 8, 12, 0.28);
  backdrop-filter: blur(6px) saturate(1.08);
}

body.is-authenticated:not(.match-active) .play-actions .primary-button {
  min-height: clamp(58px, 6vh, 76px);
}

body.is-authenticated:not(.match-active) .play-actions .mode-button {
  min-height: clamp(46px, 4.9vh, 58px);
}

@media (max-width: 980px) {
  .brand-logo {
    width: min(100%, 480px);
  }

  .launcher-brand-logo {
    width: min(100%, 520px);
  }

  body:not(.is-authenticated) .shell {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }

  body:not(.is-authenticated) .sidebar {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 32px);
  }

  body.page-auth .brand {
    min-height: auto;
    padding: 0 0 14px;
  }

  body.is-authenticated:not(.match-active) .launcher-page-header {
    min-height: auto;
  }
}

.runtime-notice-region {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  right: calc(14px + env(safe-area-inset-right));
  z-index: 100000;
  display: grid;
  gap: 8px;
  width: min(390px, calc(100vw - 28px));
  pointer-events: none;
}

.runtime-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-left: 4px solid #6ee7b7;
  border-radius: 8px;
  background: rgba(12, 18, 28, 0.92);
  color: #f7fbff;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
  pointer-events: auto;
}

.runtime-notice--warning {
  border-left-color: #f8c14d;
}

.runtime-notice--danger {
  border-left-color: #ff5d6c;
}

.runtime-notice--update {
  border-left-color: #70a8ff;
}

.runtime-notice__copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.runtime-notice__copy strong {
  font-size: 0.86rem;
  line-height: 1.15;
}

.runtime-notice__copy span {
  color: rgba(247, 251, 255, 0.78);
  font-size: 0.78rem;
  line-height: 1.3;
}

.runtime-notice__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.runtime-notice__actions button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  color: #f7fbff;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.runtime-notice__actions button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.runtime-notice__actions .runtime-notice__close {
  width: 32px;
  padding: 0;
  font-size: 1rem;
}

@media (max-width: 620px) {
  .runtime-notice-region {
    top: calc(8px + env(safe-area-inset-top));
    right: 8px;
    left: 8px;
    width: auto;
  }

  .runtime-notice {
    gap: 8px;
    padding: 10px;
  }
}

/* In-game backdrop continuity: keep one arena backdrop behind top HUD and shops. */
body.match-active {
  background:
    linear-gradient(180deg, rgba(5, 8, 6, 0.16), rgba(5, 8, 6, 0.7)),
    url("assets/arena-sky-islands-calm-bg.jpg?v=20260519-cache-fix1") center center / cover no-repeat,
    #050908;
  background-attachment: scroll;
}

@media (min-width: 981px) {
  body.match-active:not(.mobile-ui) .game-area {
    background: transparent;
  }

  body.match-active:not(.mobile-ui) .topbar,
  body.match-active:not(.mobile-ui) .sidebar {
    background:
      linear-gradient(180deg, rgba(255, 240, 190, 0.04), rgba(0, 0, 0, 0.02)),
      rgba(5, 9, 7, 0.34);
    backdrop-filter: none;
  }

  body.match-active:not(.mobile-ui) .topbar {
    border: 1px solid rgba(255, 240, 190, 0.06);
    border-radius: 8px;
  }

  body.match-active:not(.mobile-ui) .sidebar {
    border-color: rgba(215, 169, 74, 0.2);
    box-shadow: 0 -12px 38px rgba(0, 0, 0, 0.22);
  }
}

/* Desktop in-game HUD transparency: avoid heavy dark patches over the board. */
@media (min-width: 981px) {
  body.match-active:not(.mobile-ui) .canvas-wrap {
    background:
      radial-gradient(circle at 50% 18%, rgba(215, 169, 74, 0.035), transparent 26%),
      linear-gradient(180deg, rgba(0, 0, 0, 0.015), rgba(0, 0, 0, 0.08));
    scrollbar-color: rgba(215, 169, 74, 0.38) rgba(6, 10, 8, 0.24);
  }

  body.match-active:not(.mobile-ui) .hintbar {
    background:
      linear-gradient(90deg, rgba(215, 169, 74, 0.035), transparent 58%),
      rgba(5, 9, 7, 0.26);
    border-color: rgba(255, 240, 190, 0.08);
    box-shadow: none;
    color: rgba(238, 232, 210, 0.72);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.78);
  }

  body.match-active:not(.mobile-ui) .score-card {
    background:
      linear-gradient(90deg, color-mix(in srgb, var(--player-color, var(--gold)) 12%, transparent), transparent 44%),
      radial-gradient(circle at 20% 28%, color-mix(in srgb, var(--player-color, var(--gold)) 13%, transparent), transparent 36%),
      linear-gradient(180deg, rgba(255, 240, 190, 0.045), rgba(0, 0, 0, 0.025)),
      rgba(7, 11, 9, 0.58);
    box-shadow:
      inset 0 1px 0 rgba(255, 240, 190, 0.08),
      inset 0 -1px 0 rgba(0, 0, 0, 0.28),
      0 0 0 1px color-mix(in srgb, var(--player-color, var(--gold)) 16%, transparent),
      0 8px 24px rgba(0, 0, 0, 0.18);
  }

  body.match-active:not(.mobile-ui) .round-widget,
  body.match-active:not(.mobile-ui) .minimap-panel,
  body.match-active:not(.mobile-ui) .chat-panel {
    background:
      linear-gradient(180deg, rgba(255, 240, 190, 0.055), transparent 58%),
      rgba(7, 11, 9, 0.58);
    box-shadow:
      inset 0 1px 0 rgba(255, 240, 190, 0.08),
      0 12px 34px rgba(0, 0, 0, 0.24);
    backdrop-filter: none;
  }

  body.match-active:not(.mobile-ui) .minimap-panel {
    top: var(--desktop-minimap-top);
    right: var(--desktop-right-panel-x);
    width: var(--desktop-right-panel-width);
    opacity: 0.88;
    transition: opacity 160ms ease, border-color 160ms ease;
  }

  body.match-active:not(.mobile-ui) .minimap-panel.is-collapsed {
    width: var(--desktop-right-panel-width);
    padding: 7px;
    border-color: rgba(215, 169, 74, 0.34);
    opacity: 0.7;
  }

  body.match-active:not(.mobile-ui) .minimap-panel.is-collapsed .minimap-head {
    margin-bottom: 0;
  }

  body.match-active:not(.mobile-ui) .minimap-panel.is-collapsed .minimap-head > div > span {
    display: none;
  }
}

/* Desktop scoreboard resilience: the game area can be much narrower than the
   viewport when the sidebar is open, so player cards must wrap before their
   values collapse into ellipses. */
@media (min-width: 981px) {
  body.match-active:not(.mobile-ui) .topbar {
    grid-template-columns: minmax(88px, 116px) minmax(0, 1fr) 48px;
    grid-template-rows: auto auto;
    align-items: stretch;
    min-height: 0;
    gap: 7px;
  }

  body.match-active:not(.mobile-ui) .round-widget {
    grid-column: 1;
    grid-row: 1;
    min-height: 64px;
  }

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

  body.match-active:not(.mobile-ui) .scoreboard {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(166px, 100%), 1fr));
    gap: 6px;
    width: 100%;
    min-width: 0;
    overflow: visible;
  }

  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;
    min-width: 0;
  }

  body.match-active:not(.mobile-ui) .score-card {
    min-height: 72px;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 7px;
    padding: 7px 8px;
  }

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

  body.match-active:not(.mobile-ui) .score-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  body.match-active:not(.mobile-ui) .score-name {
    min-width: 0;
  }

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

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

  body.match-active:not(.mobile-ui) .score-values > span {
    min-width: 0;
    padding-inline: 5px;
  }

  body.match-active:not(.mobile-ui) .score-values .icon-value {
    justify-content: space-between;
    gap: 4px;
    min-width: 0;
    font-size: clamp(0.68rem, 0.64vw, 0.82rem);
  }

  body.match-active:not(.mobile-ui) .score-values .icon-value > span:last-child {
    min-width: max-content;
    overflow: visible;
    text-overflow: clip;
  }
}

@media (min-width: 1550px) {
  body.match-active:not(.mobile-ui) .topbar {
    grid-template-columns: clamp(134px, 9vw, 168px) minmax(0, 1fr) 54px;
    grid-template-rows: auto;
    min-height: 82px;
  }

  body.match-active:not(.mobile-ui) .round-widget {
    grid-column: 1;
    grid-row: 1;
    min-height: 78px;
  }

  body.match-active:not(.mobile-ui) .scoreboard {
    grid-column: 2;
    grid-row: 1;
    grid-template-columns: repeat(auto-fit, minmax(min(158px, 100%), 1fr));
    align-content: stretch;
  }

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

@media (min-width: 2200px) {
  body.match-active:not(.mobile-ui) .score-values {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* True in-game underlay: the scrollable canvas runs beneath the HUD and shop. */
@media (min-width: 981px) {
  body.match-active:not(.mobile-ui) .shell {
    grid-template-rows: minmax(0, 1fr) clamp(242px, 29vh, 310px);
  }

  body.match-active:not(.mobile-ui) .game-area {
    grid-row: 1 / 3;
    position: relative;
    display: block;
    height: 100vh;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    background: transparent;
  }

  body.match-active:not(.mobile-ui) .canvas-wrap {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: grid;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
  }

  body.match-active:not(.mobile-ui) .topbar {
    position: absolute;
    top: 8px;
    right: 8px;
    left: 8px;
    z-index: 30;
    width: auto;
    pointer-events: none;
    background:
      linear-gradient(180deg, rgba(255, 240, 190, 0.025), rgba(0, 0, 0, 0.01)),
      rgba(5, 9, 7, 0.18);
    backdrop-filter: none;
  }

  body.match-active:not(.mobile-ui) .topbar > *,
  body.match-active:not(.mobile-ui) .game-menu {
    pointer-events: auto;
  }

  body.match-active:not(.mobile-ui) .sidebar {
    grid-row: 2;
    z-index: 24;
    background:
      linear-gradient(180deg, rgba(255, 240, 190, 0.03), transparent 44%),
      rgba(5, 9, 7, 0.24);
    backdrop-filter: none;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
  }

  body.match-active:not(.mobile-ui) .hintbar,
  body.match-active:not(.mobile-ui) .minimap-panel,
  body.match-active:not(.mobile-ui) .chat-panel,
  body.match-active:not(.mobile-ui) .desktop-trait-rail {
    z-index: 26;
  }

  body.match-active:not(.mobile-ui) .minimap-panel {
    z-index: 28;
  }

  body.match-active:not(.mobile-ui) .chat-panel {
    z-index: 25;
  }
}

/* Desktop match polish: keep utility panels away from the bottom shop. */
@media (min-width: 981px) {
  body.match-active:not(.mobile-ui) .hintbar {
    display: none;
  }

  body.match-active:not(.mobile-ui).perf-debug-active .hintbar {
    display: flex;
    top: 76px;
    right: auto;
    bottom: auto;
    left: 12px;
    width: min(560px, calc(100vw - 380px));
    min-height: 26px;
    opacity: 0.78;
    pointer-events: none;
  }

  body.match-active:not(.mobile-ui) .chat-panel {
    top: auto;
    right: 10px;
    bottom: 322px;
    z-index: 25;
    width: min(320px, calc(100vw - 40px));
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  }

  body.match-active:not(.mobile-ui) .chat-panel.is-collapsed {
    top: auto;
    bottom: 322px;
  }

  body.match-active:not(.mobile-ui) .chat-log {
    min-height: 92px;
    max-height: min(148px, 22vh);
  }

  body.match-active:not(.mobile-ui) .score-avatar {
    position: relative;
    display: grid;
    grid-template-rows: 1fr;
    place-items: center;
    overflow: visible;
    border: 2px solid color-mix(in srgb, var(--player-color, var(--gold)) 70%, rgba(255, 240, 190, 0.36));
    background:
      radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.16), transparent 26%),
      color-mix(in srgb, var(--player-color, var(--gold)) 28%, rgba(4, 10, 12, 0.96));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.18),
      0 0 0 1px rgba(0, 0, 0, 0.34),
      0 0 14px color-mix(in srgb, var(--player-color, var(--gold)) 18%, transparent);
    filter: none;
  }

  body.match-active:not(.mobile-ui) .score-avatar-initial {
    color: #fff8e8;
    font-size: clamp(0.78rem, 0.72vw, 1rem);
    font-weight: 950;
    line-height: 1;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.72);
  }

  body.match-active:not(.mobile-ui) .score-avatar-level {
    position: absolute;
    right: -5px;
    bottom: -5px;
    display: grid;
    min-width: 18px;
    height: 18px;
    place-items: center;
    padding: 0 4px;
    border: 1px solid rgba(255, 228, 150, 0.88);
    border-radius: 999px;
    background: rgba(6, 9, 7, 0.96);
    color: #ffd978;
    font-size: 0.58rem;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.42);
  }

  body.match-active:not(.mobile-ui) .score-index {
    display: none;
  }
}

@media (min-width: 981px) and (max-height: 820px) {
  body.match-active:not(.mobile-ui) .chat-panel,
  body.match-active:not(.mobile-ui) .chat-panel.is-collapsed {
    bottom: 254px;
  }

  body.match-active:not(.mobile-ui) .chat-log {
    min-height: 48px;
    max-height: min(72px, 14vh);
  }
}

@media (min-width: 981px) {
  body.match-active:not(.mobile-ui) {
    --desktop-shop-height: clamp(242px, 29vh, 310px);
    --desktop-top-clearance: 118px;
    --desktop-right-panel-gap: 14px;
    --desktop-right-panel-width: min(318px, calc(100vw - 36px));
    --desktop-right-panel-x: 10px;
    --desktop-minimap-top: 120px;
    --desktop-minimap-reserved-height: 276px;
  }

  body.match-active:not(.mobile-ui) .selected-panel:not([hidden]) {
    bottom: calc(var(--desktop-shop-height) + 10px);
    max-height: min(520px, calc(100vh - var(--desktop-shop-height) - var(--desktop-top-clearance) - 18px));
    overflow: auto;
    overscroll-behavior: contain;
  }

  body.match-active:not(.mobile-ui).selected-panel-open .selected-panel:not([hidden]) {
    z-index: 40;
  }

  body.match-active:not(.mobile-ui).round-recap-open .round-recap-panel {
    top: calc(var(--desktop-minimap-top) + var(--desktop-minimap-reserved-height) + var(--desktop-right-panel-gap));
    right: var(--desktop-right-panel-x);
    width: var(--desktop-right-panel-width);
    max-height: calc(100vh - var(--desktop-shop-height) - var(--desktop-minimap-top) - var(--desktop-minimap-reserved-height) - 28px);
    overflow: auto;
    overscroll-behavior: contain;
  }
}

@media (min-width: 1280px) {
  body.match-active:not(.mobile-ui).selected-panel-open .selected-panel:not([hidden]) {
    left: 164px;
  }
}

@media (min-width: 981px) and (max-width: 1279px) {
  body.match-active:not(.mobile-ui).selected-panel-open .desktop-trait-rail {
    opacity: 0;
    pointer-events: none;
  }

  body.match-active:not(.mobile-ui) .threat-panel {
    left: 156px;
    width: min(300px, calc(100vw - 480px));
  }

  body.match-active:not(.mobile-ui).selected-panel-open.threat-panel-open .selected-panel:not([hidden]) {
    max-height: min(430px, calc(100vh - var(--desktop-shop-height) - 154px));
  }
}

@media (min-width: 981px) and (max-height: 760px) {
  body.match-active:not(.mobile-ui) {
    --desktop-top-clearance: 100px;
    --desktop-right-panel-width: min(286px, calc(100vw - 36px));
    --desktop-minimap-top: 120px;
    --desktop-minimap-reserved-height: 246px;
  }

  body.match-active:not(.mobile-ui) .selected-panel:not([hidden]) {
    max-height: calc(100vh - var(--desktop-shop-height) - 110px);
  }

  body.match-active:not(.mobile-ui).round-recap-open .round-recap-panel {
    max-height: calc(100vh - var(--desktop-shop-height) - var(--desktop-minimap-top) - var(--desktop-minimap-reserved-height) - 22px);
  }
}

.perf-debug-overlay {
  position: fixed;
  top: 78px;
  right: 14px;
  z-index: 1400;
  min-width: 220px;
  max-width: min(280px, calc(100vw - 28px));
  padding: 10px 12px;
  border: 1px solid rgba(111, 231, 199, 0.45);
  border-radius: 8px;
  background: rgba(8, 13, 18, 0.94);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.36);
  color: #e9fff8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  pointer-events: none;
  backdrop-filter: none;
  contain: layout style;
}

.perf-debug-title {
  margin-bottom: 6px;
  color: #6fe7c7;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.perf-debug-body {
  white-space: pre;
  font-size: 0.68rem;
  line-height: 1.45;
}

body.mobile-ui .perf-debug-overlay {
  top: calc(var(--mobile-hud-height, 74px) + 8px);
  right: 8px;
  min-width: 198px;
  padding: 8px 9px;
}

body.match-active[data-render-quality="low"] .score-card,
body.match-active[data-render-quality="low"] .score-card.is-local,
body.match-active[data-render-quality="low"] .score-card.is-observed,
body.match-active[data-render-quality="low"] .round-widget,
body.match-active[data-render-quality="low"] .minimap-panel,
body.match-active[data-render-quality="low"] .chat-panel,
body.match-active[data-render-quality="low"] .topbar,
body.match-active[data-render-quality="low"] .sidebar,
body.match-active[data-render-quality="low"] .choice-button.shop-card,
body.match-active[data-render-quality="low"] .choice-button.unit-shop-card,
body.match-active[data-render-quality="low"] .unit-shop-card,
body.match-active[data-render-quality="low"] .choice-cost,
body.match-active[data-render-quality="low"] .shop-decision-badge,
body.match-active[data-render-quality="low"] .unit-shop-pill {
  animation: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  filter: none !important;
  transition: none !important;
}

body.match-active[data-render-quality="low"] .score-card {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--player-color, var(--gold)) 11%, transparent), transparent 52%),
    rgba(7, 11, 9, 0.7) !important;
}

body.match-active[data-render-quality="low"] .score-card::before {
  opacity: 0.64;
}

body.match-active[data-render-quality="low"] .score-card::after {
  opacity: 0.46;
}

body.match-active[data-render-quality="low"] .score-card.is-dead {
  filter: none !important;
  opacity: 0.54;
}

body.match-active[data-render-quality="low"] .score-avatar::before {
  background: rgba(6, 10, 8, 0.82) !important;
  box-shadow: none !important;
}

body.match-active[data-render-quality="low"] .score-rank-frame,
body.match-active[data-render-quality="low"] .score-card.rank-diamond .score-rank-frame,
body.match-active[data-render-quality="low"] .score-card.rank-master .score-rank-frame,
body.match-active[data-render-quality="low"] .score-card.rank-elite .score-rank-frame {
  filter: none !important;
  opacity: 0.78;
}

body.match-active[data-render-quality="low"] .score-rank-division {
  background: rgba(9, 14, 11, 0.92) !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

body.match-active[data-render-quality="low"] .score-avatar-level,
body.match-active[data-render-quality="low"] .score-avatar-initial,
body.match-active[data-render-quality="low"] .score-values,
body.match-active[data-render-quality="low"] .hintbar,
body.match-active[data-render-quality="low"] .choice-cost {
  text-shadow: none !important;
}

body.match-active[data-render-quality="low"] .round-widget,
body.match-active[data-render-quality="low"] .minimap-panel,
body.match-active[data-render-quality="low"] .chat-panel,
body.match-active[data-render-quality="low"] .topbar,
body.match-active[data-render-quality="low"] .sidebar {
  background: rgba(7, 11, 9, 0.58) !important;
}

body.match-active[data-render-quality="low"] .choice-button.shop-card,
body.match-active[data-render-quality="low"] .choice-button.unit-shop-card {
  background: rgba(8, 13, 10, 0.9) !important;
}

body.match-active[data-render-quality="low"] .coin-icon,
body.match-active[data-render-quality="low"] .heart-icon,
body.match-active[data-render-quality="low"] .income-icon,
body.match-active[data-render-quality="low"] .defense-icon,
body.match-active[data-render-quality="low"] .shop-decision-icon,
body.match-active[data-render-quality="low"] .choice-icon,
body.match-active[data-render-quality="low"] .unit-shop-floating-stats {
  filter: none !important;
}

body.match-active[data-render-quality="low"] .unit-shop-card:disabled {
  filter: none !important;
}

body.match-active[data-render-quality="low"] .unit-shop-card:disabled::before {
  background: rgba(0, 0, 0, 0.38) !important;
}

body.match-active[data-render-quality="low"] .unit-shop-card:disabled .choice-icon,
body.match-active[data-render-quality="low"] .unit-shop-card:disabled .choice-main,
body.match-active[data-render-quality="low"] .unit-shop-card:disabled .unit-shop-floating-stats {
  filter: none !important;
  opacity: 0.46 !important;
}

body.match-active[data-render-quality="low"] .unit-shop-card:disabled.is-too-expensive .choice-cost {
  transform: none !important;
  border-width: 1px !important;
  background: rgba(48, 27, 4, 0.96) !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

body.match-active[data-render-quality="low"] .unit-shop-card.is-pending:disabled.is-too-expensive::after {
  animation: none !important;
  background: rgba(98, 234, 208, 0.12) !important;
}

body.match-active .unit-shop-card:disabled.is-too-expensive {
  border-color: rgba(255, 183, 77, 0.42) !important;
  background: rgba(5, 6, 5, 0.92) !important;
  filter: none !important;
  opacity: 1 !important;
}

body.match-active .unit-shop-card:disabled.is-too-expensive::before {
  z-index: 4 !important;
  background: rgba(0, 0, 0, 0.34) !important;
  opacity: 1 !important;
}

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

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

body.match-active .unit-shop-card:disabled.is-too-expensive .choice-cost {
  position: absolute !important;
  inset: 8px 8px auto auto !important;
  align-self: auto !important;
  justify-self: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 54px !important;
  min-height: 28px !important;
  padding: 5px 9px !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: scale(1.08) !important;
  transform-origin: top right !important;
  z-index: 30 !important;
  border-width: 2px !important;
  border-color: rgba(255, 202, 103, 0.96) !important;
  background: linear-gradient(180deg, rgba(86, 48, 7, 0.98), rgba(40, 22, 3, 0.98)) !important;
  color: #ffe08a !important;
  font-size: 0.9rem !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.56), 0 0 22px rgba(242, 184, 75, 0.36) !important;
}

body.match-active .unit-shop-card.is-pending:disabled,
body.match-active .unit-shop-card.is-pending:disabled.is-too-expensive {
  cursor: wait !important;
  filter: none !important;
}

body.match-active .unit-shop-card.is-pending:disabled.is-too-expensive::after {
  content: "" !important;
  inset: 0 !important;
  z-index: 5 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: inherit !important;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 220, 126, 0.3), transparent 22%),
    radial-gradient(circle at 50% 48%, rgba(98, 234, 208, 0.18), transparent 38%),
    linear-gradient(120deg, transparent 12%, rgba(255, 248, 232, 0.1) 42%, transparent 64%) !important;
  box-shadow: none !important;
  animation: shopPurchaseWash 720ms ease-in-out infinite !important;
}

body.match-active .unit-shop-card.is-pending:disabled.is-too-expensive .choice-cost {
  opacity: 0.28 !important;
  visibility: visible !important;
}

/* Mobile compact tower shop: TFT-like strip. Desktop is untouched by body.mobile-ui. */
body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .sidebar {
  left: 6px;
  right: 6px;
  bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom) + 7px);
  height: 132px;
  max-height: 132px;
  grid-template-rows: 76px 44px;
  gap: 4px;
  padding: 4px;
  border-color: rgba(215, 169, 74, 0.14);
  border-radius: 10px;
  background: rgba(4, 8, 7, 0.2);
  box-shadow: 0 -8px 26px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(5px);
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .mobile-bottom-sheet-header {
  position: absolute;
  left: 6px;
  top: 6px;
  z-index: 3;
  min-height: 32px;
  padding: 0;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .mobile-bottom-sheet-header > div:first-child,
body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .mobileSheetTitle,
body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) #mobileSheetTitle,
body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) #mobileSheetEyebrow,
body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) #mobileSheetCloseButton {
  display: none !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) #mobileSheetExpandButton {
  min-width: 24px;
  min-height: 24px;
  border-color: rgba(215, 169, 74, 0.42);
  border-radius: 7px;
  background: rgba(4, 8, 7, 0.72);
  font-size: 0.74rem;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .tower-panel,
body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .bench-panel {
  min-height: 0;
  padding: 4px;
  border-color: rgba(98, 234, 208, 0.14);
  border-radius: 9px;
  background: rgba(4, 8, 7, 0.46);
  box-shadow: none;
  overflow: hidden;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .tower-panel {
  position: relative;
  grid-template-rows: minmax(0, 1fr);
  padding-right: 48px;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .tower-panel .panel-title,
body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .bench-panel .panel-title,
body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .odds-preview {
  display: none !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .shop-toolbar {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  display: block;
  width: 40px;
  height: 64px;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .tower-panel .shop-action {
  width: 40px;
  min-width: 40px;
  height: 64px;
  min-height: 64px;
  padding: 0;
  border-radius: 8px;
  font-size: 0.62rem;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .tower-panel .shop-action .action-cost {
  display: block;
  margin-top: 2px;
  font-size: 0.58rem;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .tower-list {
  display: grid;
  width: calc(100% - 48px);
  height: 64px;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 16px) / 5);
  grid-template-columns: none;
  gap: 4px;
  overflow: hidden;
  padding: 0;
  scrollbar-width: none;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .tower-list::-webkit-scrollbar,
body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .bench-list::-webkit-scrollbar {
  display: none;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .tower-panel .choice-button {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 34px 20px;
  align-items: center;
  justify-items: center;
  min-width: 0;
  min-height: 0;
  height: 64px;
  gap: 2px;
  padding: 4px 3px 3px;
  border-color: color-mix(in srgb, var(--rarity-color, #9fb4a6) 78%, rgba(255, 240, 190, 0.08));
  border-left-width: 3px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--rarity-color, #9fb4a6) 18%, transparent), transparent 68%),
    rgba(4, 8, 7, 0.76);
  text-align: center;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .tower-panel .choice-icon {
  grid-row: 1;
  width: 32px;
  height: 32px;
  border-color: color-mix(in srgb, var(--rarity-color, #9fb4a6) 82%, rgba(255, 255, 255, 0.12));
  border-radius: 7px;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .shop-card .choice-main {
  display: contents;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .shop-card .choice-name,
body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .tower-meta-row,
body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .tower-trait-list,
body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .tower-tags,
body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .mobile-shop-rarity,
body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .shop-match-badge {
  display: none !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .tower-stat-grid {
  position: absolute;
  right: 2px;
  top: 2px;
  display: block;
  width: auto;
}

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

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .tower-stat-grid > .stat-pill:first-child {
  min-height: 14px;
  max-width: 32px;
  padding: 1px 3px;
  border-color: color-mix(in srgb, var(--rarity-color, #9fb4a6) 48%, rgba(255, 240, 190, 0.12));
  border-radius: 999px;
  background: rgba(2, 5, 4, 0.72);
  color: #fff8e8;
  font-size: 0.45rem;
  line-height: 1;
}

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

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .tower-stat-grid > .stat-pill:first-child strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: clip;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .shop-card .choice-cost {
  grid-row: 2;
  justify-self: center;
  min-width: 34px;
  min-height: 18px;
  padding: 2px 4px;
  border-radius: 999px;
  font-size: 0.56rem;
  line-height: 1;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .shop-card .choice-cost .coin-icon {
  width: 11px;
  height: 11px;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .bench-panel {
  grid-template-rows: minmax(0, 1fr);
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .bench-list {
  display: grid;
  height: 36px;
  grid-auto-flow: column;
  grid-auto-columns: 64px;
  grid-template-columns: none;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0;
  scrollbar-width: none;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .bench-slot {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  min-height: 0;
  height: 36px;
  padding: 3px 4px;
  border-radius: 7px;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .bench-slot .choice-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .bench-main {
  display: block;
  min-width: 0;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .bench-title {
  display: grid;
  gap: 0;
  min-width: 0;
  font-size: 0.5rem;
  line-height: 1;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .bench-title span,
body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .bench-title strong {
  min-width: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .bench-title strong {
  color: #efe0ad;
  font-size: 0.54rem;
}

body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .bench-slot .tower-stat-grid,
body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .bench-slot .tower-meta-row,
body.mobile-ui.match-active[data-mobile-panel="towers"]:not(.mobile-sheet-expanded) .bench-empty {
  display: none !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"].mobile-sheet-expanded .mobile-bottom-sheet-header {
  position: static;
}

body.mobile-ui.match-active[data-mobile-panel="towers"].mobile-sheet-expanded .mobile-bottom-sheet-header > div:first-child,
body.mobile-ui.match-active[data-mobile-panel="towers"].mobile-sheet-expanded #mobileSheetTitle,
body.mobile-ui.match-active[data-mobile-panel="towers"].mobile-sheet-expanded #mobileSheetEyebrow,
body.mobile-ui.match-active[data-mobile-panel="towers"].mobile-sheet-expanded #mobileSheetCloseButton {
  display: block !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"].mobile-sheet-expanded .tower-panel .panel-title,
body.mobile-ui.match-active[data-mobile-panel="towers"].mobile-sheet-expanded .bench-panel .panel-title,
body.mobile-ui.match-active[data-mobile-panel="towers"].mobile-sheet-expanded .odds-preview,
body.mobile-ui.match-active[data-mobile-panel="towers"].mobile-sheet-expanded .shop-card .choice-name,
body.mobile-ui.match-active[data-mobile-panel="towers"].mobile-sheet-expanded .tower-meta-row,
body.mobile-ui.match-active[data-mobile-panel="towers"].mobile-sheet-expanded .tower-trait-list,
body.mobile-ui.match-active[data-mobile-panel="towers"].mobile-sheet-expanded .tower-tags {
  display: revert !important;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .sidebar,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .sidebar {
  left: 8px;
  right: 8px;
  bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom) + 8px);
  border-color: rgba(215, 169, 74, 0.4);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.08), transparent 48%),
    rgba(5, 9, 8, 0.88);
  box-shadow: 0 -10px 34px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(10px);
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .sidebar {
  height: clamp(232px, 31dvh, 292px);
  max-height: clamp(232px, 31dvh, 292px);
  grid-template-rows: 30px minmax(128px, 1fr) minmax(56px, 0.48fr);
}

body.mobile-ui.match-active[data-mobile-panel="monsters"] .sidebar {
  height: clamp(170px, 23dvh, 230px);
  max-height: clamp(170px, 23dvh, 230px);
  grid-template-rows: 30px minmax(0, 1fr);
}

body.mobile-ui.match-active[data-mobile-panel="towers"].mobile-sheet-expanded .sidebar {
  height: clamp(310px, 42dvh, 390px);
  max-height: clamp(310px, 42dvh, 390px);
}

body.mobile-ui.match-active[data-mobile-panel="monsters"].mobile-sheet-expanded .sidebar {
  height: clamp(240px, 34dvh, 330px);
  max-height: clamp(240px, 34dvh, 330px);
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .mobile-bottom-sheet-header,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .mobile-bottom-sheet-header {
  min-height: 30px;
  padding: 0 0 3px;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .mobile-bottom-sheet-header strong,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .mobile-bottom-sheet-header strong {
  font-size: 0.84rem;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .mobile-bottom-sheet-header span,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .mobile-bottom-sheet-header span {
  font-size: 0.5rem;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .mobile-close-button,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .mobile-close-button {
  min-width: 32px;
  min-height: 32px;
  border-radius: 9px;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .sidebar .panel,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .sidebar .panel {
  padding: 7px;
  border-color: rgba(98, 234, 208, 0.18);
  background:
    linear-gradient(180deg, rgba(122, 197, 162, 0.08), transparent 60%),
    rgba(9, 14, 11, 0.8);
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .tower-panel {
  grid-template-rows: 20px 36px minmax(0, 1fr);
}

body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks-panel {
  grid-template-rows: 28px minmax(0, 1fr) 0;
  overflow: hidden;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .panel-title,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .panel-title {
  min-height: 20px;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .panel-title h2,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .panel-title h2 {
  font-size: 0.68rem;
  letter-spacing: 0;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .shop-toolbar {
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 5px;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .shop-action,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .shop-action {
  min-height: 34px;
  border-radius: 9px;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .tower-list,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: none;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 2px 3px 0;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .tower-list {
  grid-auto-columns: minmax(124px, 32vw);
}

body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks {
  grid-auto-columns: minmax(142px, 38vw);
}

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 {
  scroll-snap-align: start;
  min-height: 0;
  height: 100%;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 44px minmax(0, 1fr) 24px;
  align-items: stretch;
  justify-items: center;
  gap: 4px;
  padding: 6px;
  text-align: center;
}

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 {
  width: 44px;
  height: 44px;
  justify-self: center;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .shop-card .choice-main,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .unit-shop-card .choice-main {
  align-content: start;
  justify-items: center;
  gap: 3px;
  width: 100%;
  padding: 0;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .shop-card .choice-name,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .unit-shop-card .choice-name {
  font-size: 0.62rem;
  line-height: 1.05;
  text-align: center;
  -webkit-line-clamp: 2;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .tower-stat-grid,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .unit-shop-primary,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .unit-shop-details {
  display: none;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .shop-card .choice-cost,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .unit-shop-card .choice-cost {
  align-self: end;
  justify-self: center;
  min-width: 42px;
  min-height: 22px;
  padding: 3px 6px;
  font-size: 0.66rem;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .tower-list {
  grid-auto-columns: minmax(168px, 54vw);
}

body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks {
  grid-auto-columns: minmax(180px, 58vw);
}

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 {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  justify-items: stretch;
  gap: 7px;
  text-align: left;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .shop-card .choice-main,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .unit-shop-card .choice-main {
  align-content: center;
  justify-items: stretch;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .shop-card .choice-name,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .unit-shop-card .choice-name {
  max-width: 100%;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  word-break: normal;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .shop-card .choice-cost,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .unit-shop-card .choice-cost {
  align-self: start;
  justify-self: end;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .mobile-shop-rarity,
body.mobile-ui.match-active[data-mobile-panel="monsters"] .mobile-shop-rarity {
  top: 5px;
  left: 5px;
  max-width: 72px;
  padding: 2px 4px;
  font-size: 0.48rem;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .bench-panel {
  grid-template-rows: 20px minmax(0, 1fr);
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .bench-list {
  grid-auto-columns: minmax(58px, 15vw);
  gap: 5px;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .bench-slot {
  grid-template-columns: 1fr;
  min-height: 0;
  height: 100%;
  justify-items: center;
  padding: 5px;
}

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

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

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

@media (max-width: 430px) {
  body.mobile-ui.match-active[data-mobile-panel="towers"] .tower-list {
    grid-auto-columns: minmax(152px, 50vw);
  }

  body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks {
    grid-auto-columns: minmax(166px, 54vw);
  }

  body.mobile-ui.match-active[data-mobile-panel="towers"] .bench-list {
    grid-auto-columns: minmax(52px, 16vw);
  }
}

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

body.mobile-ui.match-active[data-mobile-panel="towers"] .tower-stat-grid > .stat-pill {
  min-height: 18px;
  padding: 2px 4px;
  font-size: 0.54rem;
}

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

body.mobile-ui.match-active[data-mobile-panel="towers"] .shop-card .choice-name {
  font-size: 0.72rem;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .shop-card .choice-cost {
  min-width: 34px;
  padding: 4px 5px;
  font-size: 0.68rem;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .bench-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(120px, 42vw);
  grid-template-columns: none;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 3px;
  scroll-snap-type: x proximity;
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .bench-slot {
  min-height: 64px;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 6px;
  padding: 6px;
  scroll-snap-align: start;
}

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

body.mobile-ui.match-active[data-mobile-panel="towers"] .bench-title {
  font-size: 0.66rem;
}

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

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

/* Desktop HUD polish: keep late in the cascade so responsive mobile rules stay intact. */
@media (min-width: 981px) {
  body.match-active:not(.mobile-ui) .topbar {
    display: grid;
    grid-template-columns: clamp(142px, 12vw, 184px) minmax(0, 1fr) 54px;
    align-items: stretch;
    gap: 8px;
    min-height: 84px;
  }

  body.match-active:not(.mobile-ui) .round-widget {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 2px;
    min-height: 78px;
    padding: 8px 10px;
    text-align: center;
  }

  body.match-active:not(.mobile-ui) .round-widget span,
  body.match-active:not(.mobile-ui) .round-widget strong,
  body.match-active:not(.mobile-ui) .round-widget em {
    display: block;
    width: 100%;
    text-align: center;
  }

  body.match-active:not(.mobile-ui) .scoreboard {
    display: grid;
    grid-template-columns: repeat(6, minmax(96px, 1fr));
    align-items: stretch;
    align-content: stretch;
    gap: 6px;
    min-width: 0;
  }

  body.match-active:not(.mobile-ui) .score-card {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: stretch;
    min-height: 78px;
    gap: 6px;
    padding: 6px 7px;
  }

  body.match-active:not(.mobile-ui) .score-main {
    display: grid;
    align-content: center;
    gap: 3px;
    min-width: 0;
  }

  body.match-active:not(.mobile-ui) .score-header,
  body.match-active:not(.mobile-ui) .score-name {
    min-width: 0;
  }

  body.match-active:not(.mobile-ui) .score-values {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 3px 7px;
    margin-top: 0;
    min-width: 0;
  }

  body.match-active:not(.mobile-ui) .score-values > span,
  body.match-active:not(.mobile-ui) .icon-value {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    line-height: 1;
  }

  body.match-active:not(.mobile-ui) .toolbar {
    align-self: start;
    justify-self: end;
  }

  body.match-active:not(.mobile-ui) .panel-title,
  body.match-active:not(.mobile-ui) .shop-toolbar,
  body.match-active:not(.mobile-ui) .selected-stat-row,
  body.match-active:not(.mobile-ui) .unit-shop-details > span,
  body.match-active:not(.mobile-ui) .tower-stat-grid > .stat-pill {
    align-items: center;
  }

  body.match-active:not(.mobile-ui) .panel-title h2,
  body.match-active:not(.mobile-ui) .choice-name,
  body.match-active:not(.mobile-ui) .bench-title span,
  body.match-active:not(.mobile-ui) .selected-tower-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (min-width: 981px) and (max-width: 1280px) {
  body.match-active:not(.mobile-ui) .topbar {
    grid-template-columns: 124px minmax(0, 1fr) 52px;
    min-height: 116px;
  }

  body.match-active:not(.mobile-ui) .scoreboard {
    grid-template-columns: repeat(3, minmax(108px, 1fr));
  }

  body.match-active:not(.mobile-ui) .round-widget {
    min-height: 92px;
  }
}

/* Trait modal readability: tower names must never sit under sprites. */
.traits-panel .trait-card {
  min-width: 0;
}

.traits-panel .trait-card.is-open {
  contain: layout paint;
}

.traits-panel .trait-card-toggle {
  min-width: 0;
}

.traits-panel .trait-card-main {
  flex: 1 1 auto;
}

.traits-panel .trait-progress,
.traits-panel .trait-requirement,
.traits-panel .trait-tower-list {
  align-items: center;
  min-width: 0;
}

.traits-panel .trait-progress > span,
.traits-panel .trait-requirement > span,
.traits-panel .trait-tower-list > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.traits-panel .trait-reference-towers {
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 8px;
}

.traits-panel .reference-tower-card {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 58px;
  overflow: visible;
}

.traits-panel .reference-tower-card .choice-icon {
  position: relative;
  z-index: 0;
  grid-column: 1;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
}

.traits-panel .reference-tower-card > span:not(.choice-icon) {
  z-index: 1;
  grid-column: 2;
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 0;
}

.traits-panel .reference-tower-card strong {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 981px) {
  .traits-panel {
    width: min(1120px, calc(100vw - 56px));
  }

  .traits-panel .traits-card-grid {
    grid-template-columns: repeat(2, minmax(320px, 1fr));
  }

  .traits-panel .trait-card.is-open {
    grid-column: 1 / -1;
  }

  .traits-panel .trait-card.is-open .trait-card-detail {
    grid-template-columns: minmax(0, 0.95fr) minmax(300px, 1.05fr);
    align-items: start;
    column-gap: 14px;
  }

  .traits-panel .trait-card.is-open .trait-card-detail > p,
  .traits-panel .trait-card.is-open .trait-card-detail > .trait-bonus-block--inline,
  .traits-panel .trait-card.is-open .trait-card-detail > .trait-tower-list,
  .traits-panel .trait-card.is-open .trait-card-detail > .trait-tier-roadmap,
  .traits-panel .trait-card.is-open .trait-card-detail > .trait-bonus-block:last-child {
    grid-column: 1 / -1;
  }

  .traits-panel .trait-tier-row-head,
  .traits-panel .trait-tier-row-body {
    grid-template-columns: minmax(120px, 0.42fr) minmax(0, 1fr);
  }
}

/* Mobile refinements kept behind body.mobile-ui so desktop layout stays unchanged. */
body.mobile-ui.match-active .desktop-trait-rail {
  position: fixed;
  top: calc(var(--mobile-hud-height) + env(safe-area-inset-top) + 10px);
  left: 8px;
  z-index: 49;
  display: grid !important;
  gap: 5px;
  width: 42px;
  max-height: calc(100dvh - var(--mobile-hud-height) - var(--mobile-bottom-nav-height) - 28px);
  overflow: visible;
  pointer-events: none;
}

body.mobile-ui.match-active .desktop-trait-item {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--trait-color, #d7a94a) 58%, rgba(255, 240, 190, 0.14));
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--trait-color, #d7a94a) 18%, transparent), transparent 70%),
    rgba(1, 10, 14, 0.68);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
  opacity: 0.86;
  pointer-events: auto;
}

body.mobile-ui.match-active .desktop-trait-item.is-active {
  opacity: 1;
}

body.mobile-ui.match-active .desktop-trait-item > .trait-icon {
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--trait-color, #d7a94a) 78%, #fff8e8);
}

body.mobile-ui.match-active .desktop-trait-item > .trait-icon svg {
  width: 19px;
  height: 19px;
}

body.mobile-ui.match-active .desktop-trait-name,
body.mobile-ui.match-active .desktop-trait-popover {
  display: none !important;
}

body.mobile-ui.match-active .desktop-trait-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  min-width: 16px;
  height: 16px;
  place-items: center;
  padding: 0 4px;
  border: 1px solid color-mix(in srgb, var(--trait-color, #d7a94a) 62%, rgba(255, 248, 232, 0.18));
  border-radius: 999px;
  background: rgba(3, 7, 5, 0.94);
  color: #fff8e8;
  font-size: 0.54rem;
  font-weight: 950;
  line-height: 1;
}

body.mobile-ui.match-active .desktop-trait-page-button {
  width: 38px;
  height: 26px;
  border: 1px solid rgba(255, 240, 190, 0.18);
  border-radius: 999px;
  background: rgba(1, 10, 14, 0.72);
  color: rgba(255, 248, 232, 0.82);
  font-size: 0.58rem;
  font-weight: 950;
  pointer-events: auto;
}

body.mobile-ui.match-active .desktop-trait-item.is-mobile-selected {
  opacity: 1;
  border-color: color-mix(in srgb, var(--trait-color, #d7a94a) 78%, rgba(255, 248, 232, 0.3));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--trait-color, #d7a94a) 24%, transparent), 0 8px 18px rgba(0, 0, 0, 0.28);
}

.mobile-trait-popover[hidden] {
  display: none !important;
}

body.mobile-ui.match-active .mobile-trait-popover {
  position: fixed;
  top: calc(var(--mobile-hud-height) + env(safe-area-inset-top) + 10px);
  left: 56px;
  z-index: 63;
  display: grid;
  gap: 8px;
  width: min(330px, calc(100vw - 68px));
  max-height: min(44dvh, 360px);
  padding: 10px;
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--trait-color, #d7a94a) 58%, rgba(255, 240, 190, 0.14));
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--trait-color, #d7a94a) 13%, transparent), transparent 46%),
    rgba(1, 10, 14, 0.95);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
  pointer-events: auto;
}

body.mobile-ui.match-active .mobile-trait-popover header {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
}

body.mobile-ui.match-active .mobile-trait-popover header .trait-icon {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--trait-color, #d7a94a) 78%, #fff8e8);
}

body.mobile-ui.match-active .mobile-trait-popover h3,
body.mobile-ui.match-active .mobile-trait-popover h4,
body.mobile-ui.match-active .mobile-trait-popover p {
  margin: 0;
}

body.mobile-ui.match-active .mobile-trait-popover header span,
body.mobile-ui.match-active .mobile-trait-popover header em,
body.mobile-ui.match-active .mobile-trait-popover h4 {
  color: var(--muted);
  font-size: 0.64rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

body.mobile-ui.match-active .mobile-trait-popover h3 {
  min-width: 0;
  overflow: hidden;
  color: #fff8e8;
  font-size: 0.92rem;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui.match-active .mobile-trait-popover p {
  color: rgba(255, 248, 232, 0.78);
  font-size: 0.72rem;
  line-height: 1.3;
}

body.mobile-ui.match-active .mobile-trait-popover-close {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 240, 190, 0.14);
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.07);
  color: #fff8e8;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

body.mobile-ui.match-active .mobile-trait-popover-status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

body.mobile-ui.match-active .mobile-trait-popover-status > span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 6px;
  border: 1px solid rgba(255, 240, 190, 0.1);
  border-radius: 7px;
  background: rgba(2, 9, 12, 0.5);
}

body.mobile-ui.match-active .mobile-trait-popover-status small {
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

body.mobile-ui.match-active .mobile-trait-popover section,
body.mobile-ui.match-active .mobile-trait-popover .desktop-trait-next,
body.mobile-ui.match-active .mobile-trait-popover .desktop-trait-requirements {
  display: grid;
  gap: 6px;
}

body.mobile-ui.match-active .mobile-trait-popover .desktop-trait-requirements .trait-requirement {
  padding: 6px 7px;
  border-color: rgba(255, 240, 190, 0.12);
  background: rgba(2, 9, 12, 0.54);
  font-size: 0.64rem;
}

body.mobile-ui.match-active .mobile-trait-popover .desktop-trait-requirements .trait-requirement--complete {
  border-color: color-mix(in srgb, var(--trait-color, #d7a94a) 42%, rgba(98, 234, 208, 0.28));
  color: #9ff7ff;
}

body.mobile-ui.match-active .mobile-trait-popover .desktop-trait-towers {
  display: flex;
  gap: 6px;
  padding-bottom: 2px;
  overflow-x: auto;
}

body.mobile-ui.match-active .mobile-trait-popover .desktop-trait-tower {
  display: grid;
  flex: 0 0 112px;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 5px;
  border: 1px solid color-mix(in srgb, var(--rarity-color, #9fb4a6) 42%, rgba(255, 240, 190, 0.12));
  border-radius: 7px;
  background: rgba(4, 10, 12, 0.56);
}

body.mobile-ui.match-active .mobile-trait-popover .desktop-trait-tower .choice-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

body.mobile-ui.match-active .mobile-trait-popover .desktop-trait-tower strong {
  min-width: 0;
  overflow: hidden;
  color: #fff8e8;
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui.match-active .mobile-trait-popover .desktop-trait-empty {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"] .sidebar {
  height: 118px;
  max-height: 118px;
  grid-template-rows: 26px minmax(0, 1fr);
  padding: 4px;
  border-color: rgba(215, 169, 74, 0.18);
  background: rgba(4, 8, 7, 0.28);
  backdrop-filter: blur(6px);
}

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

body.mobile-ui.match-active[data-mobile-panel="monsters"] .mobile-bottom-sheet-header {
  min-height: 26px;
  padding: 0 0 2px;
}

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

body.mobile-ui.match-active[data-mobile-panel="monsters"] .mobile-close-button {
  min-width: 26px;
  min-height: 26px;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks-panel {
  grid-template-rows: minmax(0, 1fr);
  padding: 4px;
  overflow: hidden;
}

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

body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks {
  display: grid;
  width: 100%;
  height: 76px;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 8px) / 3);
  grid-template-columns: none;
  gap: 4px;
  overflow: hidden;
  padding: 0;
  scrollbar-width: none;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks::-webkit-scrollbar {
  display: none;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks .choice-button.unit-shop-card {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) !important;
  grid-template-rows: 1fr 18px !important;
  align-items: center;
  gap: 3px 5px;
  min-width: 0;
  min-height: 0;
  height: 76px;
  padding: 4px;
  border-left-width: 3px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--rarity-color, #9fb4a6) 16%, transparent), transparent 68%),
    rgba(4, 8, 7, 0.78);
}

body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks .choice-button.unit-shop-card .choice-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks .choice-button.unit-shop-card .choice-main {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks .choice-button.unit-shop-card .choice-name {
  min-width: 0;
  overflow: hidden;
  font-size: 0.56rem;
  line-height: 1;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

body.mobile-ui.match-active[data-mobile-panel="monsters"] .unit-shop-pill {
  min-height: 16px;
  padding: 1px 3px;
  gap: 2px;
  border-radius: 5px;
  font-size: 0.5rem;
}

body.mobile-ui.match-active[data-mobile-panel="monsters"] .unit-shop-pill .selected-stat-icon {
  width: 12px;
  height: 12px;
  padding: 1px;
}

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

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

body.mobile-ui.match-active[data-mobile-panel="monsters"] .barracks .choice-button.unit-shop-card .choice-cost {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: center;
  min-width: 36px;
  min-height: 16px;
  padding: 1px 5px;
  font-size: 0.54rem;
  line-height: 1;
}

body.mobile-ui.match-active[data-mobile-panel="upgrades"] .sidebar {
  left: 8px;
  right: auto;
  bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom) + 8px);
  width: min(360px, calc(100vw - 16px));
  height: auto;
  max-height: min(238px, 34dvh);
  grid-template-rows: 28px minmax(0, 1fr);
  padding: 6px;
  border-radius: 12px;
  background: rgba(5, 9, 8, 0.9);
}

body.mobile-ui.match-active[data-mobile-panel="upgrades"] .mobile-bottom-sheet-header {
  min-height: 28px;
  padding: 0;
}

body.mobile-ui.match-active[data-mobile-panel="upgrades"] .mobile-bottom-sheet-header strong {
  font-size: 0.78rem;
}

body.mobile-ui.match-active[data-mobile-panel="upgrades"] .selected-panel {
  gap: 5px;
  padding: 8px;
  overflow: auto;
}

body.mobile-ui.match-active[data-mobile-panel="upgrades"] #placedTowerName {
  font-size: 0.82rem;
  line-height: 1;
}

body.mobile-ui.match-active[data-mobile-panel="upgrades"] .selected-tower-stats {
  max-height: 62px;
  margin: 0;
  overflow: auto;
  font-size: 0.62rem;
  line-height: 1.2;
}

body.mobile-ui.match-active[data-mobile-panel="upgrades"] .selected-stat-row {
  gap: 5px;
}

body.mobile-ui.match-active[data-mobile-panel="upgrades"] .selected-panel .mode-button,
body.mobile-ui.match-active[data-mobile-panel="upgrades"] .selected-panel .danger-button {
  min-height: 32px;
  font-size: 0.68rem;
}

body.mobile-ui.match-active[data-mobile-panel="upgrades"] #benchTowerButton {
  order: -1;
  border-color: rgba(98, 234, 208, 0.58);
  background:
    linear-gradient(180deg, rgba(98, 234, 208, 0.12), transparent),
    rgba(5, 16, 15, 0.82);
  color: #9ff7ff;
}

/* Desktop scoreboard: spread player stats across the card instead of clustering them. */
@media (min-width: 981px) {
  body.match-active:not(.mobile-ui) .score-card {
    align-items: stretch;
    min-height: 74px;
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 8px 9px;
  }

  body.match-active:not(.mobile-ui) .score-avatar {
    align-self: center;
    width: 36px;
    height: 36px;
  }

  body.match-active:not(.mobile-ui) .score-main {
    display: grid;
    align-content: center;
    gap: 4px;
    min-width: 0;
  }

  body.match-active:not(.mobile-ui) .score-header {
    display: flex;
    align-items: center;
    gap: 7px;
  }

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

  body.match-active:not(.mobile-ui) .score-values > span {
    display: grid;
    align-content: center;
    gap: 2px;
    min-width: 0;
    min-height: 29px;
    padding: 3px 5px;
    border: 1px solid rgba(255, 240, 190, 0.08);
    border-radius: 6px;
    background: rgba(3, 8, 6, 0.36);
  }

  body.match-active:not(.mobile-ui) .score-values > span::before {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: rgba(255, 248, 232, 0.52);
    font-size: 0.48rem;
    font-weight: 950;
    letter-spacing: 0;
    line-height: 1;
    text-transform: uppercase;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.match-active:not(.mobile-ui) .score-values > span:nth-child(1)::before { content: "PV"; }
  body.match-active:not(.mobile-ui) .score-values > span:nth-child(2)::before { content: "Or"; }
  body.match-active:not(.mobile-ui) .score-values > span:nth-child(3)::before { content: "Eco"; }
  body.match-active:not(.mobile-ui) .score-values > span:nth-child(4)::before { content: "Def"; }

  body.match-active:not(.mobile-ui) .score-values .icon-value {
    width: 100%;
    min-width: 0;
    justify-content: space-between;
    gap: 4px;
    font-size: clamp(0.72rem, 0.58vw, 0.88rem);
    font-variant-numeric: tabular-nums;
  }

  body.match-active:not(.mobile-ui) .score-values .icon-value > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
  }
}

@media (min-width: 1550px) {
  body.match-active:not(.mobile-ui) .topbar {
    grid-template-columns: clamp(154px, 10vw, 190px) minmax(0, 1fr) 54px;
    min-height: 86px;
  }

  body.match-active:not(.mobile-ui) .scoreboard {
    grid-template-columns: repeat(6, minmax(152px, 1fr));
    gap: 8px;
  }

  body.match-active:not(.mobile-ui) .score-card {
    min-height: 78px;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 8px;
    padding: 9px 10px;
  }

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

@media (min-width: 2200px) {
  body.match-active:not(.mobile-ui) .score-values {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 981px) and (max-width: 1280px) {
  body.match-active:not(.mobile-ui) .score-card {
    min-height: 66px;
  }

  body.match-active:not(.mobile-ui) .score-values {
    grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  }
}

@media (min-width: 981px) {
  body.match-active:not(.mobile-ui) .score-values {
    grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  }

  body.match-active:not(.mobile-ui) .score-value--defense {
    grid-column: 1;
    grid-row: 2;
  }

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

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

  body.match-active:not(.mobile-ui) .score-value--income .income-icon {
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
  }

  body.match-active:not(.mobile-ui) .score-value--income .icon-value > span:last-child {
    min-width: max-content;
    overflow: visible;
    text-overflow: clip;
  }
}

@media (min-width: 2200px) {
  body.match-active:not(.mobile-ui) .score-values {
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 0.85fr) minmax(0, 1.45fr) minmax(0, 0.8fr);
  }

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

@media (min-width: 981px) {
  body.match-active:not(.mobile-ui) .topbar {
    min-height: 96px;
  }

  body.match-active:not(.mobile-ui) .score-card {
    min-height: 86px;
  }

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

  body.match-active:not(.mobile-ui) .score-values > span {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 2px 4px;
  }

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

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

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

  body.match-active:not(.mobile-ui) .score-values .icon-value > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
  }
}

/* Mobile HUD polish: isolated from desktop with body.mobile-ui and max-width guards. */
@media (max-width: 980px) {
  body.mobile-ui.match-active {
    --mobile-hud-height: 112px;
    --mobile-bottom-nav-height: 66px;
    --touch-target-size: 46px;
  }

  body.mobile-ui.match-active .game-area {
    padding: calc(env(safe-area-inset-top) + 6px) 6px calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom) + 7px);
    gap: 6px;
  }

  body.mobile-ui.match-active .mobile-top-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: stretch;
    gap: 6px;
    min-height: var(--mobile-hud-height);
    padding: 6px;
  }

  body.mobile-ui.match-active .mobile-player-chip {
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: 118px minmax(0, 1fr);
    min-width: 0;
    padding: 2px 0;
  }

  body.mobile-ui.match-active .mobile-status-buttons {
    grid-template-columns: repeat(3, minmax(36px, 1fr));
  }

  body.mobile-ui.match-active .mobile-status-buttons .mobile-player-book-button,
  body.mobile-ui.match-active .mobile-status-buttons .mobile-player-power-button,
  body.mobile-ui.match-active .mobile-status-buttons .mobile-player-traits-button {
    min-width: 38px;
    min-height: 38px;
    border-radius: 9px;
  }

  body.mobile-ui.match-active .mobile-menu-button {
    grid-column: 2;
    grid-row: 1;
    align-self: stretch;
    min-width: 52px;
    padding-inline: 7px;
    border-radius: 9px;
  }

  body.mobile-ui.match-active .mobile-hud-stats {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
  }

  body.mobile-ui.match-active .mobile-stat {
    align-content: center;
    min-height: 42px;
    padding: 4px 3px;
    border-radius: 7px;
  }

  body.mobile-ui.match-active .mobile-stat span {
    font-size: clamp(0.48rem, 1.9vw, 0.58rem);
    line-height: 1;
  }

  body.mobile-ui.match-active .mobile-stat strong {
    font-size: clamp(0.66rem, 2.7vw, 0.84rem);
    line-height: 1.08;
  }

  body.mobile-ui.match-active .mobile-bottom-nav {
    gap: 4px;
    padding-inline: 6px;
  }

  body.mobile-ui.match-active .mobile-action-button {
    min-width: 0;
    padding: 0 3px;
    border-radius: 9px;
    font-size: clamp(0.62rem, 2.35vw, 0.76rem);
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  body.mobile-ui.match-active .sidebar {
    left: 6px;
    right: 6px;
    height: min(58dvh, 540px);
    max-height: min(58dvh, 540px);
    padding: 7px;
    border-radius: 13px 13px 10px 10px;
  }

  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) - 18px);
    max-height: calc(100dvh - var(--mobile-hud-height) - var(--mobile-bottom-nav-height) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 18px);
  }

  body.mobile-ui.match-active .mobile-bottom-sheet-header {
    min-height: 42px;
    padding-bottom: 6px;
  }

  body.mobile-ui.match-active .sidebar .panel {
    padding: 9px;
  }

  body.mobile-ui.match-active[data-mobile-panel="towers"] .sidebar {
    grid-template-rows: auto minmax(0, 1.15fr) minmax(116px, 0.72fr);
  }

  body.mobile-ui.match-active .tower-panel .choice-button,
  body.mobile-ui.match-active .barracks .choice-button {
    min-height: 124px;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px;
  }

  body.mobile-ui.match-active .tower-panel .choice-icon,
  body.mobile-ui.match-active .barracks .choice-icon {
    width: 60px;
    height: 60px;
  }

  body.mobile-ui.match-active .shop-card .choice-name,
  body.mobile-ui.match-active .unit-shop-card .choice-name {
    font-size: 0.82rem;
    line-height: 1.12;
  }

  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(3, minmax(0, 1fr));
  }

  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-height: 26px;
    padding: 4px 5px;
    font-size: 0.64rem;
  }

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

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

  body.mobile-ui.match-active .mobile-player-row {
    grid-template-columns: minmax(96px, 1.2fr) repeat(3, minmax(46px, 0.55fr)) 104px;
    gap: 6px;
  }

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

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

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

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

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

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

  body.mobile-ui.match-active .mobile-stat span {
    font-size: 0.5rem;
  }

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

  body.mobile-ui.match-active .mobile-bottom-nav {
    min-height: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom));
  }

  body.mobile-ui.match-active .tower-panel .choice-button,
  body.mobile-ui.match-active .barracks .choice-button {
    grid-template-columns: 54px minmax(0, 1fr) auto;
    min-height: 118px;
    gap: 8px;
    padding: 9px;
  }

  body.mobile-ui.match-active .tower-panel .choice-icon,
  body.mobile-ui.match-active .barracks .choice-icon {
    width: 52px;
    height: 52px;
  }

  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)) 104px;
  }
}

@media (orientation: landscape) and (max-width: 980px) {
  body.mobile-ui.match-active {
    --mobile-hud-height: 58px;
    --mobile-bottom-nav-height: 58px;
  }

  body.mobile-ui.match-active .mobile-top-bar {
    grid-template-columns: minmax(156px, 0.9fr) minmax(0, 1.8fr) auto;
    grid-template-rows: 1fr;
    min-height: var(--mobile-hud-height);
    padding: 5px;
  }

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

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

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

  body.mobile-ui.match-active .mobile-stat {
    min-height: 44px;
    grid-template-columns: 1fr;
    text-align: center;
  }

  body.mobile-ui.match-active .sidebar {
    height: auto;
    max-height: none;
  }
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .sidebar {
  height: min(38dvh, 350px);
  max-height: min(38dvh, 350px);
  grid-template-rows: 34px minmax(142px, 1.25fr) minmax(74px, 0.55fr);
}

body.mobile-ui.match-active[data-mobile-panel="towers"].mobile-sheet-expanded .sidebar {
  height: min(56dvh, 520px);
  max-height: min(56dvh, 520px);
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .tower-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .bench-panel {
  grid-template-rows: auto minmax(0, 1fr);
}

body.mobile-ui.match-active[data-mobile-panel="towers"] .tower-panel .choice-button {
  min-height: 72px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 6px;
  padding: 7px;
}

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

/* True final desktop launcher override. Keep at EOF. */
@media (min-width: 981px) {
  body.is-authenticated:not(.match-active) .launcher-panel {
    --launcher-left-y: 10%;
    --launcher-left-bottom: 5.8%;
    --launcher-left-w: 21.5%;
    --launcher-main-y: 5.2%;
    --launcher-main-bottom: 5.8%;
  }

  body.is-authenticated:not(.match-active) .launcher-workspace {
    overflow: visible;
    grid-template-rows: clamp(142px, 16vh, 184px) minmax(0, 1fr);
  }

  body.is-authenticated:not(.match-active) .launcher-page-header {
    align-items: start;
    min-height: clamp(142px, 16vh, 184px);
    padding: 0 6px clamp(12px, 1.4vh, 18px);
  }

  body.is-authenticated:not(.match-active) .launcher-page-header > div {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    transform: translateY(-10px);
  }

  body.is-authenticated:not(.match-active) .launcher-page-header .eyebrow {
    display: inline-flex;
    width: fit-content;
    margin: 0 0 4px;
    padding: 7px 11px;
    border: 1px solid rgba(98, 234, 208, 0.48);
    border-radius: 999px;
    background: rgba(2, 15, 21, 0.62);
    color: #8ff7ff;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  }

  body.is-authenticated:not(.match-active) .launcher-brand-logo {
    width: min(100%, clamp(420px, 39vw, 700px));
    margin: -8px 0 -8px;
    filter:
      drop-shadow(0 20px 24px rgba(0, 0, 0, 0.68))
      drop-shadow(0 0 18px rgba(255, 129, 48, 0.34));
  }

  body.is-authenticated:not(.match-active) .launcher-page-subtitle {
    margin-top: 0;
    border-color: rgba(255, 210, 106, 0.36);
    background: rgba(24, 14, 8, 0.58);
    color: #ffe5a0;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
  }

  body.is-authenticated:not(.match-active) .launcher-tabs .tab-button {
    min-height: clamp(39px, 4vh, 48px);
    padding: 0 30px 0 42px;
    border: 1px solid rgba(255, 225, 142, 0.30);
    border-radius: 8px;
    background:
      linear-gradient(90deg, rgba(98, 234, 208, 0.10), rgba(4, 24, 32, 0.68) 42%, rgba(2, 9, 14, 0.78)),
      rgba(2, 13, 18, 0.66);
    color: rgba(255, 248, 232, 0.82);
    font-size: 0.8rem;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 8px 18px rgba(0, 0, 0, 0.18);
  }

  body.is-authenticated:not(.match-active) .launcher-tabs .tab-button::before {
    left: 15px;
    width: 13px;
    height: 13px;
    border-color: rgba(98, 234, 208, 0.72);
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.44), transparent 32%),
      rgba(98, 234, 208, 0.22);
    box-shadow: 0 0 14px rgba(98, 234, 208, 0.18);
  }

  body.is-authenticated:not(.match-active) .launcher-tabs .tab-button::after {
    right: 13px;
    border-color: rgba(255, 225, 142, 0.58);
    box-shadow: none;
  }

  body.is-authenticated:not(.match-active) .launcher-tabs .tab-button:hover {
    border-color: rgba(98, 234, 208, 0.68);
    background:
      linear-gradient(90deg, rgba(98, 234, 208, 0.18), rgba(7, 43, 52, 0.72) 42%, rgba(2, 12, 18, 0.82)),
      rgba(3, 20, 26, 0.72);
    color: #effcff;
  }

  body.is-authenticated:not(.match-active) .launcher-tabs .tab-button.active {
    border-color: rgba(255, 216, 118, 0.78);
    background:
      linear-gradient(90deg, rgba(255, 202, 76, 0.42), rgba(98, 234, 208, 0.18) 48%, rgba(2, 20, 27, 0.76)),
      rgba(5, 28, 34, 0.72);
    color: #fff8e8;
    box-shadow:
      inset 0 1px 0 rgba(255, 248, 218, 0.18),
      0 0 0 1px rgba(255, 216, 118, 0.08),
      0 0 22px rgba(255, 202, 76, 0.16);
  }

  body.is-authenticated:not(.match-active) .play-actions {
    gap: clamp(9px, 1vh, 12px);
    padding: 12px;
    border-color: rgba(255, 240, 190, 0.15);
    background:
      linear-gradient(180deg, rgba(255, 240, 190, 0.08), transparent 42%),
      radial-gradient(circle at 100% 0, rgba(181, 118, 255, 0.16), transparent 34%),
      rgba(2, 10, 15, 0.50);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 18px 42px rgba(0, 0, 0, 0.22);
  }

  body.is-authenticated:not(.match-active) .play-action-item > button,
  body.is-authenticated:not(.match-active) .play-actions > button {
    justify-items: start;
    align-content: center;
    min-height: clamp(58px, 6vh, 74px);
    padding: 12px 16px 12px 58px;
    border: 1px solid rgba(255, 240, 190, 0.18);
    border-radius: 8px;
    background:
      linear-gradient(100deg, rgba(98, 234, 208, 0.10), rgba(5, 23, 31, 0.76) 44%, rgba(2, 10, 15, 0.88)),
      rgba(2, 13, 18, 0.76);
    color: #fff7df;
    font-size: clamp(0.9rem, 0.86vw, 1.02rem);
    line-height: 1.05;
    text-align: left;
    text-transform: uppercase;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.09),
      0 10px 24px rgba(0, 0, 0, 0.22);
    transition:
      border-color 140ms ease,
      background 140ms ease,
      box-shadow 140ms ease,
      transform 140ms ease;
  }

  body.is-authenticated:not(.match-active) .play-action-item > button:hover:not(:disabled),
  body.is-authenticated:not(.match-active) .play-actions > button:hover:not(:disabled),
  body.is-authenticated:not(.match-active) .play-action-item > button:focus-visible,
  body.is-authenticated:not(.match-active) .play-actions > button:focus-visible {
    border-color: rgba(98, 234, 208, 0.66);
    background:
      linear-gradient(100deg, rgba(98, 234, 208, 0.20), rgba(7, 39, 49, 0.82) 44%, rgba(2, 11, 16, 0.88)),
      rgba(3, 19, 25, 0.82);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.12),
      0 14px 30px rgba(0, 0, 0, 0.26),
      0 0 22px rgba(98, 234, 208, 0.10);
    transform: translateY(-1px);
  }

  body.is-authenticated:not(.match-active) .play-action-item > button::before,
  body.is-authenticated:not(.match-active) .play-actions .primary-button::before,
  body.is-authenticated:not(.match-active) .play-actions #queueRankedButton::before,
  body.is-authenticated:not(.match-active) .play-actions #tutorialButton.is-recommended::before,
  body.is-authenticated:not(.match-active) .play-actions #createLobbyButton::before {
    content: "";
    position: absolute;
    left: 20px;
    top: 50%;
    inset: auto auto auto 20px;
    width: 22px;
    height: 22px;
    border: 2px solid currentColor;
    border-radius: 6px;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.30), transparent 36%),
      rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 17px color-mix(in srgb, currentColor 34%, transparent);
    opacity: 0.95;
    transform: translateY(-50%) rotate(45deg);
  }

  body.is-authenticated:not(.match-active) .play-action-item > button::after {
    margin-top: 6px;
    color: rgba(255, 248, 232, 0.66);
    font-size: 0.67rem;
    line-height: 1.22;
    white-space: normal;
  }

  body.is-authenticated:not(.match-active) .play-actions #queueRankedButton {
    min-height: clamp(72px, 7.6vh, 92px);
    border-color: rgba(196, 126, 255, 0.68);
    background:
      radial-gradient(circle at 100% 0, rgba(255, 202, 96, 0.22), transparent 34%),
      linear-gradient(105deg, rgba(132, 70, 189, 0.76), rgba(32, 13, 52, 0.88) 58%, rgba(10, 8, 20, 0.92)),
      rgba(15, 8, 28, 0.86);
    color: #d9a8ff;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.16),
      0 16px 34px rgba(0, 0, 0, 0.30),
      0 0 30px rgba(181, 118, 255, 0.16);
  }

  body.is-authenticated:not(.match-active) .play-actions #queueRankedButton::after,
  body.is-authenticated:not(.match-active) .play-action-item--ranked #queueRankedButton::after {
    content: "6 joueurs - points ranked - rang alpha";
    color: rgba(255, 235, 190, 0.78);
  }

  body.is-authenticated:not(.match-active) .play-actions #queueNormalButton {
    min-height: clamp(66px, 7vh, 84px);
    border-color: rgba(255, 216, 118, 0.68);
    background:
      radial-gradient(circle at 96% 0, rgba(255, 216, 118, 0.24), transparent 34%),
      linear-gradient(105deg, rgba(118, 80, 21, 0.76), rgba(9, 49, 54, 0.78) 56%, rgba(3, 17, 24, 0.9)),
      rgba(4, 18, 24, 0.82);
    color: #ffd874;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.14),
      0 14px 30px rgba(0, 0, 0, 0.28),
      0 0 26px rgba(255, 216, 118, 0.12);
  }

  body.is-authenticated:not(.match-active) .play-actions #queueSoloButton {
    color: #78e7ff;
  }

  body.is-authenticated:not(.match-active) .play-actions #tutorialButton {
    color: #7cffb0;
  }

  body.is-authenticated:not(.match-active) .play-actions #createLobbyButton {
    border-color: rgba(255, 216, 118, 0.28);
    background:
      linear-gradient(105deg, rgba(255, 216, 118, 0.12), rgba(7, 36, 43, 0.72) 46%, rgba(2, 10, 15, 0.88)),
      rgba(3, 16, 22, 0.76);
    color: #ffe19a;
  }

  body.is-authenticated:not(.match-active) .play-actions #leaveQueueButton {
    min-height: 42px;
    padding-left: 16px;
    border-color: rgba(255, 115, 106, 0.30);
    background: rgba(36, 8, 12, 0.54);
    color: rgba(255, 210, 206, 0.82);
  }

  body.is-authenticated:not(.match-active) .play-actions #leaveQueueButton::before {
    display: none;
  }

  body.is-authenticated:not(.match-active) .launcher-audio .mode-button {
    border-radius: 8px;
    border-color: rgba(255, 225, 142, 0.22);
    background: rgba(2, 12, 17, 0.50);
    color: rgba(255, 248, 232, 0.78);
  }
}

@media (min-width: 981px) {
  body.is-authenticated:not(.match-active) .launcher-workspace {
    grid-template-rows: clamp(232px, 24vh, 278px) minmax(0, 1fr);
  }

  body.is-authenticated:not(.match-active) .launcher-page-header {
    min-height: clamp(232px, 24vh, 278px);
  }

  body.is-authenticated:not(.match-active) .play-action-item > button::before,
  body.is-authenticated:not(.match-active) .play-actions .primary-button::before,
  body.is-authenticated:not(.match-active) .play-actions #queueRankedButton::before,
  body.is-authenticated:not(.match-active) .play-actions #tutorialButton.is-recommended::before,
  body.is-authenticated:not(.match-active) .play-actions #createLobbyButton::before {
    inset: auto;
    left: 20px;
    top: 50%;
  }

  body.is-authenticated:not(.match-active) .launcher-page-subtitle {
    display: none;
  }

  body.is-authenticated:not(.match-active) .play-actions {
    gap: clamp(7px, 0.78vh, 9px);
    padding: 10px;
  }

  body.is-authenticated:not(.match-active) .play-action-item > button,
  body.is-authenticated:not(.match-active) .play-actions > button {
    min-height: clamp(48px, 5.2vh, 60px);
    padding: 10px 13px 10px 52px;
    font-size: clamp(0.84rem, 0.78vw, 0.96rem);
  }

  body.is-authenticated:not(.match-active) .play-action-item > button::before,
  body.is-authenticated:not(.match-active) .play-actions .primary-button::before,
  body.is-authenticated:not(.match-active) .play-actions #queueRankedButton::before,
  body.is-authenticated:not(.match-active) .play-actions #tutorialButton.is-recommended::before,
  body.is-authenticated:not(.match-active) .play-actions #createLobbyButton::before {
    left: 17px;
    width: 20px;
    height: 20px;
  }

  body.is-authenticated:not(.match-active) .play-action-item > button::after {
    margin-top: 4px;
    font-size: 0.63rem;
  }

  body.is-authenticated:not(.match-active) .play-actions #queueRankedButton {
    min-height: clamp(62px, 6.6vh, 76px);
  }

  body.is-authenticated:not(.match-active) .play-actions #queueNormalButton {
    min-height: clamp(58px, 6.1vh, 70px);
  }

  body.is-authenticated:not(.match-active) .play-actions #leaveQueueButton:not(.is-relevant) {
    display: none;
  }
}

@media (min-width: 981px) {
  body.page-auth .brand {
    align-content: center;
    justify-items: center;
    min-height: min(560px, calc(100vh - 144px));
    padding: clamp(22px, 3vh, 38px) clamp(24px, 3vw, 44px) clamp(28px, 3.4vh, 48px);
    text-align: center;
    border-right-color: rgba(255, 225, 142, 0.14);
  }

  body.page-auth .brand .eyebrow {
    justify-self: center;
    margin: 0 0 clamp(10px, 1.8vh, 18px);
    transform: translateY(-76px);
  }

  body.page-auth .brand-logo {
    width: min(100%, clamp(430px, 39vw, 640px));
    margin: 0 auto clamp(16px, 2.2vh, 26px);
    transform: translateY(-76px);
    filter:
      drop-shadow(0 20px 24px rgba(0, 0, 0, 0.66))
      drop-shadow(0 0 18px rgba(255, 129, 48, 0.34));
  }

  body.page-auth .subtitle {
    max-width: 610px;
    margin: 0 auto;
    text-align: center;
    transform: translateY(-68px);
  }
}

@media (min-width: 981px) {
  body.is-authenticated:not(.match-active) .launcher-page-header > div {
    display: grid;
    justify-items: start;
    align-content: start;
    gap: 5px;
  }

  body.is-authenticated:not(.match-active) .launcher-brand-logo {
    width: min(100%, clamp(430px, 38vw, 700px));
    margin: -10px 0 -2px;
  }

  body.is-authenticated:not(.match-active) .launcher-page-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 2px;
  }

  body.is-authenticated:not(.match-active) .launcher-page-header .eyebrow,
  body.is-authenticated:not(.match-active) .launcher-page-subtitle {
    display: inline-flex !important;
    align-items: center;
    min-height: 28px;
    margin: 0;
    padding: 6px 11px;
    border: 1px solid rgba(98, 234, 208, 0.42);
    border-radius: 999px;
    background:
      linear-gradient(90deg, rgba(98, 234, 208, 0.16), rgba(3, 18, 25, 0.46)),
      rgba(2, 12, 17, 0.46);
    color: #8ff7ff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  }

  body.is-authenticated:not(.match-active) .launcher-page-subtitle {
    border-color: rgba(255, 210, 106, 0.36);
    background:
      linear-gradient(90deg, rgba(255, 179, 73, 0.18), rgba(29, 17, 8, 0.42)),
      rgba(18, 10, 5, 0.36);
    color: #ffe4a0;
  }

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

  body.is-authenticated:not(.match-active) .launcher-tabs {
    gap: clamp(7px, 0.82vh, 10px);
    padding: 2px 2px 2px 0;
  }

  body.is-authenticated:not(.match-active) .launcher-tabs .tab-button {
    min-height: clamp(42px, 4.5vh, 52px);
    padding: 0 28px 0 54px;
    border: 0;
    border-radius: 10px;
    background:
      linear-gradient(90deg, rgba(2, 9, 14, 0.18), rgba(2, 9, 14, 0.04)),
      url("assets/brand/launcher-tab-bg-arena-v3.png?v=20260607-arena-tabs2") center center / 100% 100% no-repeat;
    background-color: transparent;
    color: rgba(255, 248, 232, 0.9);
    font-size: clamp(0.76rem, 0.72vw, 0.84rem);
    font-weight: 880;
    text-shadow:
      0 2px 8px rgba(0, 0, 0, 0.84),
      0 0 10px rgba(66, 220, 255, 0.08);
    box-shadow:
      0 7px 16px rgba(0, 0, 0, 0.12),
      0 0 14px rgba(30, 207, 238, 0.03);
  }

  body.is-authenticated:not(.match-active) .launcher-tabs .tab-button::before {
    left: 25px;
    width: 7px;
    height: 7px;
    border: 1px solid rgba(191, 251, 255, 0.64);
    border-radius: 50%;
    background:
      radial-gradient(circle, rgba(221, 255, 255, 0.94), rgba(61, 237, 255, 0.68) 48%, rgba(19, 104, 128, 0.1) 74%);
    box-shadow:
      0 0 12px rgba(69, 240, 255, 0.32),
      0 0 18px rgba(255, 183, 73, 0.04);
    transform: translateY(-50%);
  }

  body.is-authenticated:not(.match-active) .launcher-tabs .tab-button::after {
    display: none;
  }

  body.is-authenticated:not(.match-active) .launcher-tabs .tab-button:hover {
    background:
      linear-gradient(90deg, rgba(46, 226, 255, 0.06), rgba(255, 181, 70, 0.04)),
      url("assets/brand/launcher-tab-bg-arena-v3-active.png?v=20260607-arena-tabs2") center center / 100% 100% no-repeat;
    color: #f7feff;
    filter: brightness(1.04);
    transform: translateX(1px);
  }

  body.is-authenticated:not(.match-active) .launcher-tabs .tab-button.active {
    background:
      linear-gradient(90deg, rgba(255, 201, 76, 0.08), rgba(61, 237, 255, 0.06)),
      url("assets/brand/launcher-tab-bg-arena-v3-active.png?v=20260607-arena-tabs2") center center / 100% 100% no-repeat;
    color: #fff8e8;
    filter: brightness(1.03);
    box-shadow:
      0 8px 18px rgba(0, 0, 0, 0.14),
      0 0 18px rgba(255, 202, 76, 0.10),
      0 0 22px rgba(45, 224, 255, 0.06);
  }

  body.is-authenticated:not(.match-active) .launcher-tabs .tab-button.active::before {
    border-color: rgba(255, 238, 172, 0.84);
    background:
      radial-gradient(circle, rgba(255, 249, 218, 0.95), rgba(255, 211, 109, 0.76) 52%, rgba(181, 91, 21, 0.12) 78%);
    box-shadow:
      0 0 13px rgba(255, 211, 109, 0.34),
      0 0 18px rgba(69, 240, 255, 0.10);
  }
}

@media (min-width: 981px) {
  body.is-authenticated:not(.match-active) .launcher-mark {
    display: none !important;
  }

  body.is-authenticated:not(.match-active) .launcher-nav {
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: clamp(9px, 1vh, 13px);
  }

  body.is-authenticated:not(.match-active) .launcher-nav > * {
    width: min(100%, 342px);
  }

  body.is-authenticated:not(.match-active) .launcher-page-header {
    position: relative;
  }

  body.is-authenticated:not(.match-active) .launcher-live-card {
    position: relative;
    grid-column: auto;
    justify-self: end;
    align-self: auto;
    z-index: 3;
    order: 99;
    display: grid;
    grid-template-columns: auto auto auto;
    grid-template-rows: auto;
    align-items: center;
    column-gap: 7px;
    min-width: 0;
    width: fit-content;
    margin: 0;
    padding: 7px 10px;
    border: 1px solid rgba(98, 234, 208, 0.28);
    border-radius: 8px;
    background:
      linear-gradient(120deg, rgba(98, 234, 208, 0.12), rgba(2, 13, 18, 0.58)),
      rgba(2, 10, 15, 0.46);
    color: #eafff9;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 12px 28px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(8px) saturate(1.08);
  }

  body.is-authenticated:not(.match-active) .launcher-live-dot {
    grid-row: auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #6aefdb;
    box-shadow: 0 0 14px rgba(106, 239, 219, 0.7);
  }

  body.is-authenticated:not(.match-active) .launcher-live-card strong {
    color: #fff8e8;
    font-size: 0.92rem;
    line-height: 1;
  }

  body.is-authenticated:not(.match-active) .launcher-live-card small {
    color: rgba(216, 240, 234, 0.72);
    font-size: 0.6rem;
    font-weight: 850;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
  }

  body.is-authenticated:not(.match-active) .profile-card {
    position: relative;
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    align-items: center;
    min-height: 108px;
    gap: 4px 12px;
    padding: 13px 15px 13px 13px;
    border: 0;
    border-radius: 13px;
    background:
      linear-gradient(115deg, color-mix(in srgb, var(--rank-color, #c6d4df) 14%, transparent), rgba(2, 9, 14, 0.06)),
      url("assets/brand/player-card-bg-arena-v1.png?v=20260607-player-card1") center center / 100% 100% no-repeat;
    box-shadow:
      0 11px 24px rgba(0, 0, 0, 0.17),
      0 0 18px color-mix(in srgb, var(--rank-color, #c6d4df) 14%, transparent);
    overflow: hidden;
  }

  body.is-authenticated:not(.match-active) .profile-card[data-rank-tier] {
    border-color: transparent;
  }

  body.is-authenticated:not(.match-active) .profile-card[data-rank-tier]::before {
    content: "";
    position: absolute;
    inset: 2px;
    width: auto;
    height: auto;
    border: 1px solid color-mix(in srgb, var(--rank-color, #c6d4df) 56%, rgba(255, 224, 142, 0.18));
    border-radius: 13px;
    background:
      radial-gradient(circle at 12% 38%, color-mix(in srgb, var(--rank-color, #c6d4df) 26%, transparent), transparent 28%),
      linear-gradient(90deg, color-mix(in srgb, var(--rank-color, #c6d4df) 12%, transparent), transparent 48%);
    clip-path: none;
    opacity: 0.9;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 0 18px color-mix(in srgb, var(--rank-color, #c6d4df) 18%, transparent);
    pointer-events: none;
  }

  body.is-authenticated:not(.match-active) .profile-card[data-rank-tier]::after {
    content: attr(data-rank-ornament);
    position: absolute;
    left: 66px;
    top: 18px;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 242, 184, 0.58);
    border-radius: 5px;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.72), color-mix(in srgb, var(--rank-color, #c6d4df) 68%, #ffffff) 45%, rgba(28, 54, 68, 0.9));
    color: rgba(5, 15, 20, 0.9);
    font-size: 0.58rem;
    font-weight: 950;
    line-height: 1;
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    box-shadow:
      0 4px 10px rgba(0, 0, 0, 0.34),
      0 0 14px color-mix(in srgb, var(--rank-color, #c6d4df) 28%, transparent);
    pointer-events: none;
  }

  body.is-authenticated:not(.match-active) .profile-avatar-wrap,
  body.is-authenticated:not(.match-active) .profile-meta,
  body.is-authenticated:not(.match-active) .profile-status,
  body.is-authenticated:not(.match-active) .profile-card-stats {
    position: relative;
    z-index: 1;
  }

  body.is-authenticated:not(.match-active) .profile-avatar-wrap {
    grid-column: 1;
    grid-row: 1 / span 3;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 7px;
    min-width: 0;
  }

  body.is-authenticated:not(.match-active) .profile-avatar {
    grid-row: auto;
    grid-column: auto;
    width: 58px;
    height: 58px;
    border: 2px solid color-mix(in srgb, var(--rank-color, #c6d4df) 70%, rgba(255, 224, 142, 0.34));
    background:
      radial-gradient(circle at 38% 24%, rgba(255, 255, 255, 0.28), transparent 26%),
      radial-gradient(circle at 50% 72%, color-mix(in srgb, var(--rank-color, #c6d4df) 44%, rgba(31, 202, 229, 0.22)), transparent 46%),
      rgba(6, 23, 31, 0.94);
    color: #fff8e8;
    font-size: 1.25rem;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.16),
      0 0 18px color-mix(in srgb, var(--rank-color, #c6d4df) 28%, transparent);
  }

  body.is-authenticated:not(.match-active) .profile-level-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 22px;
    padding: 3px 8px;
    border: 1px solid rgba(255, 224, 142, 0.32);
    border-radius: 999px;
    background: rgba(2, 11, 16, 0.52);
    color: rgba(255, 246, 220, 0.78);
    font-size: 0.62rem;
    font-weight: 880;
    text-transform: uppercase;
  }

  body.is-authenticated:not(.match-active) .profile-level-badge strong {
    color: #fff8e8;
    font-size: 0.76rem;
  }

  body.is-authenticated:not(.match-active) .profile-meta {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
  }

  body.is-authenticated:not(.match-active) .profile-meta h2 {
    color: #fff8e8;
    font-size: clamp(1.02rem, 0.95vw, 1.18rem);
    line-height: 1.04;
  }

  body.is-authenticated:not(.match-active) .profile-meta span {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    margin-top: 5px;
    padding: 3px 8px;
    border: 1px solid color-mix(in srgb, var(--rank-color, #c6d4df) 48%, rgba(255, 224, 142, 0.22));
    border-radius: 999px;
    background: rgba(2, 11, 16, 0.42);
    color: color-mix(in srgb, var(--rank-color, #c6d4df) 70%, #fff8e8);
    font-size: 0.68rem;
    font-weight: 920;
    line-height: 1;
    text-transform: uppercase;
  }

  body.is-authenticated:not(.match-active) .profile-status {
    grid-column: 2;
    grid-row: 2;
    justify-content: flex-start;
    gap: 7px;
    color: rgba(222, 239, 233, 0.68);
    font-size: 0.66rem;
  }

  body.is-authenticated:not(.match-active) .profile-status strong {
    color: #70efc9;
    font-size: 0.66rem;
  }

  body.is-authenticated:not(.match-active) .profile-card-stats {
    grid-column: 2;
    grid-row: 3;
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
  }

  body.is-authenticated:not(.match-active) .profile-card-stats span {
    display: grid;
    min-width: 0;
    padding: 5px 9px;
    border: 1px solid rgba(255, 224, 142, 0.18);
    border-radius: 8px;
    background: rgba(2, 11, 16, 0.46);
  }

  body.is-authenticated:not(.match-active) .profile-card-stats small {
    color: rgba(255, 224, 142, 0.72);
    font-size: 0.57rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
  }

  body.is-authenticated:not(.match-active) .profile-card-stats strong {
    margin-top: 3px;
    color: #fff8e8;
    font-size: 0.78rem;
    line-height: 1;
    white-space: nowrap;
  }

  body.is-authenticated:not(.match-active) .launcher-tabs {
    gap: clamp(8px, 0.92vh, 11px);
  }

  body.is-authenticated:not(.match-active) .launcher-tabs .tab-button {
    min-height: clamp(46px, 5vh, 58px);
    padding-left: 56px;
    font-size: clamp(0.8rem, 0.76vw, 0.9rem);
  }
}

html[lang="en"] body.is-authenticated:not(.match-active) .play-action-item--normal #queueNormalButton::after {
  content: "Open PvP - AI after waiting - Profile XP";
}

html[lang="en"] body.is-authenticated:not(.match-active) .play-action-item--normal #queueNormalButton.is-queueing::after {
  content: "Searching - AI if the queue stays empty";
}

html[lang="en"] body.is-authenticated:not(.match-active) .play-action-item--solo #queueSoloButton::after {
  content: "1 player + bots - no-wait test";
}

html[lang="en"] body.is-authenticated:not(.match-active) .play-action-item--tutorial #tutorialButton::after {
  content: "1 player - basics, economy, upgrades";
}

html[lang="en"] body.is-authenticated:not(.match-active) .play-actions #tutorialButton.is-recommended::after,
html[lang="en"] body.is-authenticated:not(.match-active).fresh-account-onboarding .play-actions #tutorialButton.is-recommended::after {
  content: "New player";
}

html[lang="en"] body.is-authenticated:not(.match-active) .play-action-item--lobby #createLobbyButton::after {
  content: "2-6 players - friend party";
}

html[lang="en"] body.is-authenticated:not(.match-active) .play-actions #queueRankedButton::after,
html[lang="en"] body.is-authenticated:not(.match-active) .play-action-item--ranked #queueRankedButton::after {
  content: "6 players - ranked points - alpha rank";
}

html[lang="en"] body.is-authenticated:not(.match-active) .play-actions #queueRankedButton.is-queueing::after {
  content: "Searching - 6 compatible players";
}

html[lang="en"] body.is-authenticated:not(.match-active) .play-action-item--ranked #queueRankedButton.is-queueing::after {
  content: "Searching - alpha AI if needed";
}

html[lang="en"] body.is-authenticated:not(.match-active).pre-ranked-onboarding .play-action-item--solo #queueSoloButton.is-recommended::after {
  content: "Recommended - 1 player + bots - no wait";
}

html[lang="en"] body.is-authenticated:not(.match-active).pre-ranked-onboarding .play-action-item--ranked #queueRankedButton.is-onboarding-secondary::after {
  content: "Recommended after 2 matches - alpha AI if needed";
}

html[lang="en"] body.match-active:not(.mobile-ui) .score-values > span:nth-child(1)::before {
  content: "HP";
}

/* Avoid live backdrop filters over the game canvases: some GPU/browser paths briefly composite them as black. */
body.match-active .end-overlay,
body.match-active .game-menu-panel,
body.mobile-ui.match-active .mobile-top-bar,
body.mobile-ui.match-active .mobile-bottom-nav,
body.mobile-ui.match-active .mobile-bottom-sheet-header,
body.mobile-ui.match-active .sidebar,
body.mobile-ui.match-active .mobile-trait-popover {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body.match-active .end-overlay {
  contain: paint;
  isolation: isolate;
}

body.match-active.arena-focus-mode .canvas-wrap {
  overflow: hidden;
}

body.match-active.arena-focus-mode .minimap-panel {
  display: none !important;
}

.arena-focus-menu-button.active,
.mobile-arena-mode-button.active {
  border-color: rgba(159, 247, 255, 0.72);
  color: #f7fffb;
  background: linear-gradient(135deg, rgba(24, 93, 105, 0.78), rgba(92, 72, 29, 0.82));
  box-shadow: 0 0 0 1px rgba(159, 247, 255, 0.22), 0 10px 26px rgba(0, 0, 0, 0.28);
}

.arena-return-button {
  position: absolute;
  left: 16px;
  top: 72px;
  z-index: 7;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(159, 247, 255, 0.42);
  border-radius: 7px;
  background: rgba(4, 10, 9, 0.88);
  color: #f7fffb;
  font: 900 0.78rem/1 Inter, sans-serif;
  letter-spacing: 0;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.arena-return-button:hover,
.arena-return-button:focus-visible {
  border-color: rgba(159, 247, 255, 0.82);
  background: rgba(8, 22, 20, 0.94);
}

body.match-active.arena-focus-mode .score-card.is-observed {
  transform: translateY(-1px);
}
