/* ALTERE:GO / MATCH MAP / COMMAND PERIMETER
   Desktop HUD layered over the existing Leaflet map and canonical match engine. */

:root {
  --mm-ink: #050607;
  --mm-panel: rgba(8, 10, 11, 0.91);
  --mm-panel-soft: rgba(8, 10, 11, 0.76);
  --mm-panel-heavy: rgba(4, 5, 6, 0.97);
  --mm-line: rgba(225, 232, 235, 0.2);
  --mm-line-strong: rgba(238, 243, 245, 0.42);
  --mm-silver: #e9edef;
  --mm-silver-dim: #949a9e;
  --mm-silver-faint: #53585b;
  --mm-lime: #c7ff38;
  --mm-red: #ff4259;
  --mm-cyan: #30c8ff;
  --mm-top: 76px;
  --mm-left: 300px;
  --mm-right: 0px;
  --mm-bottom: 164px;
  --mm-gap: 12px;
  --mm-cut: 12px;
  --mm-font-display: "Arial Narrow", "Roboto Condensed", "DIN Condensed", Arial, sans-serif;
  --mm-font-ui: Inter, "Segoe UI", Arial, sans-serif;
  --mm-font-mono: "Roboto Mono", "JetBrains Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body.mm-page {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--mm-ink);
  color: var(--mm-silver);
}

body.mm-page {
  position: relative;
  min-width: 1180px;
  font-family: var(--mm-font-ui);
  color-scheme: dark;
  isolation: isolate;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.mm-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.mm-map {
  position: absolute !important;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 52% 42%, rgba(75, 82, 87, 0.34), transparent 42%),
    #171a1c;
}

.mm-page.is-spb-3d-active .mm-3d-host {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mm-page.is-spb-3d-active .mm-map {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.mm-3d-host,
.mm-3d-host.maplibregl-map {
  z-index: 4;
}

.mm-3d-toggle {
  top: 90px;
  right: 24px;
  z-index: 800;
}

.mm-3d-loading,
.mm-3d-notice,
.mm-3d-tooltip,
.mm-3d-legend {
  z-index: 800;
}

.mm-3d-notice {
  top: 138px;
  right: 24px;
}

.mm-3d-legend {
  right: 24px;
  bottom: 178px;
}

.mm-map .leaflet-tile-pane {
  opacity: 0.96;
  filter: grayscale(1) saturate(0) brightness(1.5) contrast(0.86);
}

.mm-map-vignette,
.mm-map-grid {
  position: fixed;
  inset: 0;
  z-index: 390;
  pointer-events: none;
}

.mm-map-vignette {
  background:
    linear-gradient(rgba(42, 46, 49, 0.18), rgba(26, 29, 31, 0.16)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0, transparent 20%, transparent 76%, rgba(0, 0, 0, 0.3) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.22) 0, transparent 16%, transparent 86%, rgba(0, 0, 0, 0.24) 100%);
}

.mm-map-grid {
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(240, 245, 247, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240, 245, 247, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(circle at 50% 45%, black 0, transparent 78%);
  mask-image: radial-gradient(circle at 50% 45%, black 0, transparent 78%);
}

.mm-command-topbar,
.mm-layer-rail,
.mm-engine-hud,
.mm-action-dock,
.mm-log-panel,
.mm-engine-actions,
.mm-passport,
.mm-engine-banner,
.mm-turn-announcer,
.mm-skill-target-banner {
  position: fixed;
  z-index: 700;
}

.mm-command-topbar::before,
.mm-layer-rail::before,
.mm-engine-hud::before,
.mm-action-dock::before,
.mm-log-panel::before,
.mm-engine-actions::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border: 1px solid var(--mm-line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent 26%),
    linear-gradient(180deg, rgba(16, 19, 21, 0.93), rgba(5, 6, 7, 0.94));
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.38),
    inset 0 1px rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(18px) saturate(0.7);
}

.mm-command-topbar {
  top: 14px;
  left: 16px;
  right: 16px;
  height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mm-command-topbar::before {
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
}

.mm-back,
.mm-brand,
.mm-match-code,
.mm-city,
.mm-zoom,
.mm-player-slot {
  min-height: 38px;
  border-right: 1px solid var(--mm-line);
}

.mm-back {
  width: 44px;
  min-width: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--mm-silver);
  border: 0;
  border-right: 1px solid var(--mm-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  text-decoration: none;
}

.mm-back svg,
.mm-city svg,
.mm-filter-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.mm-brand {
  display: flex;
  align-items: center;
  padding: 0 20px 0 8px;
  color: #f4f6f7;
  font-family: var(--mm-font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-decoration: none;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.18);
}

.mm-match-code {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  font-family: var(--mm-font-mono);
  text-transform: uppercase;
}

.mm-match-code span,
.mm-player-slot small {
  color: var(--mm-silver-faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.mm-code {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  color: #c8cdd0;
  font-size: 12px;
  letter-spacing: 0.1em;
}

.mm-players {
  min-width: 360px;
  height: 100%;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0;
  border: 0;
  border-right: 1px solid var(--mm-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.mm-player-slot {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 0 14px;
}

.mm-player-slot:last-child {
  border-right: 0;
}

.mm-player {
  min-width: 0;
  overflow: hidden;
  color: #dce0e2;
  font-family: var(--mm-font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-player-vs {
  color: var(--mm-silver-faint);
  font-family: var(--mm-font-mono);
  font-size: 9px;
}

.mm-topbar-spacer {
  flex: 1;
}

.mm-city {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
  color: #9ba1a5;
  font-family: var(--mm-font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.mm-city svg {
  width: 17px;
  height: 17px;
}

.mm-zoom {
  position: static;
  inset: auto;
  z-index: auto;
  height: 38px;
  display: flex;
  flex-direction: row;
  align-items: center;
  border: 0;
  border-right: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
}

.mm-zoom-btn {
  width: 40px;
  height: 38px;
  border: 0;
  border-left: 1px solid var(--mm-line);
  background: transparent;
  color: var(--mm-silver);
  cursor: pointer;
  font-size: 19px;
}

.mm-zoom-btn:disabled {
  color: #404447;
  cursor: default;
}

.mm-zoom-label {
  min-width: 74px;
  width: auto;
  padding: 0;
  border: 0;
  text-align: center;
  color: var(--mm-silver-dim);
  font-family: var(--mm-font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.mm-layer-rail {
  top: var(--mm-top);
  bottom: calc(var(--mm-bottom) + var(--mm-gap));
  left: 16px;
  width: var(--mm-left);
  display: flex;
  flex-direction: column;
  transition: width 220ms ease, transform 220ms ease;
}

.mm-layer-rail::before {
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}

.mm-layer-rail-head {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--mm-line);
  color: #e1e5e7;
  font-family: var(--mm-font-mono);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.mm-layer-toggle {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--mm-silver-dim);
  cursor: pointer;
  font-family: var(--mm-font-mono);
}

.mm-filters {
  position: static;
  inset: auto;
  z-index: auto;
  flex: 1;
  min-height: 0;
  max-width: none;
  padding: 7px;
  display: block;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  overflow: auto;
  scrollbar-color: #51565a transparent;
  scrollbar-width: thin;
}

.mm-filter-btn {
  --mm-accent: #dfe4e6;
  position: relative;
  width: 100%;
  min-height: 68px;
  margin: 0 0 5px;
  padding: 9px 32px 9px 10px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 235, 0.2);
  border-radius: 0;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--mm-accent) 5%, transparent), transparent 52%),
    rgba(255, 255, 255, 0.025);
  color: #e5e8e9;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease;
}

.mm-filter-btn::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--mm-accent);
  opacity: 0;
  box-shadow: 0 0 13px var(--mm-accent);
  transition: opacity 140ms ease;
}

.mm-filter-btn:hover,
.mm-filter-btn.is-active {
  border-color: color-mix(in srgb, var(--mm-accent) 56%, rgba(255, 255, 255, 0.2));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--mm-accent) 12%, transparent), transparent 68%),
    rgba(255, 255, 255, 0.025);
  color: #fff;
  box-shadow:
    inset 0 0 22px color-mix(in srgb, var(--mm-accent) 6%, transparent),
    0 0 0 1px rgba(255, 255, 255, 0.025);
}

.mm-filter-btn:hover {
  transform: translateX(2px);
}

.mm-filter-btn.is-active::before {
  opacity: 1;
}

.mm-filter-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--mm-accent) 50%, transparent);
  color: var(--mm-accent);
  background: color-mix(in srgb, var(--mm-accent) 8%, rgba(0, 0, 0, 0.4));
  clip-path: polygon(50% 0, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--mm-accent) 35%, transparent));
}

.mm-filter-icon svg {
  width: 25px;
  height: 25px;
}

.mm-filter-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mm-filter-copy b {
  overflow: hidden;
  font-family: var(--mm-font-mono);
  color: #e7eaec;
  font-family: var(--mm-font-ui);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.015em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.9);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-filter-copy small {
  color: #a0a6aa;
  font-family: var(--mm-font-mono);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.035em;
}

.mm-filter-btn.is-active .mm-filter-copy b {
  color: #fff;
}

.mm-filter-btn.is-active .mm-filter-copy small {
  color: #c7cccf;
}

.mm-filter-signal {
  position: absolute;
  top: 50%;
  right: 11px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--mm-accent);
  border-radius: 50%;
  opacity: 0.35;
  transform: translateY(-50%);
}

.mm-filter-btn.is-active .mm-filter-signal {
  background: var(--mm-accent);
  opacity: 1;
  box-shadow: 0 0 8px var(--mm-accent);
}

.mm-layer-collapse {
  min-height: 48px;
  border: 0;
  border-top: 1px solid var(--mm-line);
  background: transparent;
  color: #a8adb0;
  cursor: pointer;
  font-family: var(--mm-font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mm-page.is-layer-rail-collapsed .mm-layer-rail {
  width: 48px;
}

.mm-page.is-layer-rail-collapsed .mm-layer-rail-head {
  padding: 0 7px;
}

.mm-page.is-layer-rail-collapsed .mm-layer-rail-head > span,
.mm-page.is-layer-rail-collapsed .mm-filter-copy,
.mm-page.is-layer-rail-collapsed .mm-filter-signal,
.mm-page.is-layer-rail-collapsed .mm-layer-collapse {
  display: none;
}

.mm-page.is-layer-rail-collapsed .mm-filters {
  padding: 6px 4px;
  overflow: hidden auto;
}

.mm-page.is-layer-rail-collapsed .mm-filter-btn {
  min-height: 42px;
  padding: 1px;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
}

.mm-page.is-layer-rail-collapsed .mm-filter-icon {
  width: 34px;
  height: 34px;
}

.mm-engine-hud {
  top: var(--mm-top);
  right: 16px;
  width: var(--mm-right);
  max-width: none;
  padding: 0 11px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  font-size: inherit;
}

.mm-engine-hud::before {
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}

.mm-engine-turn {
  min-height: 42px;
  margin: 0 -11px 10px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--mm-line);
  color: var(--mm-silver-dim);
  font-family: var(--mm-font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.mm-engine-hud.is-my-turn .mm-engine-turn {
  color: var(--mm-lime);
  text-shadow: 0 0 14px rgba(199, 255, 56, 0.45);
}

.mm-engine-hud.is-opponent-turn .mm-engine-turn {
  color: #c4c9cc;
}

.mm-turn-metric {
  min-height: 51px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border-bottom: 1px solid rgba(226, 232, 235, 0.1);
}

.mm-turn-metric span {
  color: #6e7477;
  font-family: var(--mm-font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.mm-turn-metric b {
  color: #edf0f1;
  font-family: var(--mm-font-display);
  font-size: 18px;
  letter-spacing: 0.05em;
}

.mm-engine-check {
  margin: 10px 0 0;
  padding: 9px 8px;
  border-left: 2px solid currentColor;
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--mm-font-mono);
  font-size: 9px;
  line-height: 1.45;
}

.mm-engine-check.is-danger {
  color: var(--mm-red);
}

.mm-engine-check.is-opportunity {
  color: var(--mm-lime);
}

.mm-action-dock {
  left: 50%;
  right: auto;
  bottom: 14px;
  width: min(1440px, calc(100vw - 48px));
  height: 148px;
  min-height: 0;
  max-height: 148px;
  display: grid;
  grid-template-columns: 250px minmax(720px, 1fr) 190px;
  grid-template-rows: minmax(0, 1fr);
  gap: 7px;
  padding: 7px;
  overflow: hidden;
  transform: translateX(-50%);
}

.mm-action-dock::before {
  clip-path: polygon(0 12px, 12px 0, 31% 0, calc(31% + 10px) 8px, 69% 8px, calc(69% + 10px) 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px));
}

.mm-player-command,
.mm-turn-phase {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 235, 0.13);
  background: rgba(255, 255, 255, 0.012);
}

.mm-player-command {
  padding: 5px;
  display: grid;
  grid-template-columns: 46px 1fr;
  grid-template-rows: 46px 34px 30px;
  gap: 4px 8px;
}

.mm-player-coin {
  grid-row: 1;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(234, 240, 242, 0.27);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.13), rgba(0, 0, 0, 0.65) 60%),
    #0a0c0d;
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.025),
    0 0 22px rgba(255, 255, 255, 0.07);
}

.mm-player-coin img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mm-player-coin span {
  color: #e6eaec;
  font-family: Georgia, serif;
  font-size: 34px;
  text-shadow: 0 2px 8px #000;
}

.mm-player-command-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mm-player-command-copy strong {
  overflow: hidden;
  color: #f4f6f7;
  font-family: var(--mm-font-display);
  font-size: 20px;
  letter-spacing: 0.11em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.mm-player-command-copy span {
  margin-top: 3px;
  color: #555b5e;
  font-family: var(--mm-font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mm-player-command-copy b {
  margin-top: 1px;
  color: #aeb4b7;
  font-family: var(--mm-font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mm-player-command-stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(226, 232, 235, 0.12);
  border-bottom: 1px solid rgba(226, 232, 235, 0.12);
  background: rgba(255, 255, 255, 0.018);
}

.mm-player-stat {
  min-width: 0;
  min-height: 0;
  height: 34px;
  padding: 3px 7px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  border-right: 1px solid rgba(226, 232, 235, 0.1);
}

.mm-player-stat:last-child {
  border-right: 0;
}

.mm-player-stat small {
  color: #767d81;
  font-family: var(--mm-font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mm-player-stat b {
  overflow: hidden;
  color: #f1f4f5;
  font-family: var(--mm-font-display);
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-player-command-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.mm-find-king-btn,
.mm-log-toggle,
.mm-engine-skill-btn {
  min-height: 0;
  height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(232, 238, 241, 0.34);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    #0b0d0e;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
  color: #eef1f2;
  cursor: pointer;
  font-family: var(--mm-font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.mm-engine-skill-btn {
  width: auto;
  margin: 0;
}

.mm-find-king-btn:hover,
.mm-log-toggle:hover {
  border-color: rgba(199, 255, 56, 0.74);
  background:
    linear-gradient(180deg, rgba(199, 255, 56, 0.13), rgba(199, 255, 56, 0.035)),
    #0b0e08;
  color: #fff;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 0 16px rgba(199, 255, 56, 0.08);
}

.mm-skill-section {
  min-width: 0;
  min-height: 0;
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mm-skill-section-label {
  height: 18px;
  min-height: 18px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #686e71;
  font-family: var(--mm-font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mm-skill-section-label span {
  color: #b0b6b9;
}

.mm-skill-list {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  grid-template-rows: minmax(0, 1fr);
  gap: 6px;
  overflow: hidden;
}

.mm-skill-card {
  --skill-accent: #75d9ff;
  position: relative;
  min-width: 0;
  height: 100%;
  min-height: 0;
  max-height: 116px;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(104px, 45%) minmax(0, 55%);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--skill-accent) 40%, rgba(226, 232, 235, 0.22));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--skill-accent) 7%, transparent), transparent 46%),
    linear-gradient(180deg, #101619, #07090a);
  color: #afb4b7;
  text-align: left;
  cursor: pointer;
  clip-path: polygon(10px 0, calc(100% - 13px) 0, 100% 13px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 10px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.025),
    inset 0 -22px 35px rgba(0, 0, 0, 0.24);
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.mm-skill-card::before {
  content: "";
  position: absolute;
  z-index: 5;
  top: 0;
  left: 24%;
  width: 48%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--skill-accent), transparent);
  opacity: 0.8;
  box-shadow: 0 0 10px var(--skill-accent);
}

.mm-skill-card::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 12px;
  height: 12px;
  border-right: 1px solid var(--skill-accent);
  border-bottom: 1px solid var(--skill-accent);
  opacity: 0.62;
  z-index: 5;
}

.mm-skill-card:hover:not(:disabled),
.mm-skill-card.is-ready {
  border-color: color-mix(in srgb, var(--skill-accent) 48%, rgba(255, 255, 255, 0.2));
}

.mm-skill-card:hover:not(:disabled) {
  transform: translateY(-2px);
  color: #eef1f2;
  box-shadow:
    inset 0 0 26px color-mix(in srgb, var(--skill-accent) 8%, transparent),
    0 0 20px color-mix(in srgb, var(--skill-accent) 12%, transparent);
}

.mm-skill-card.is-targeted {
  border-color: var(--skill-accent);
  box-shadow:
    inset 0 0 28px color-mix(in srgb, var(--skill-accent) 13%, transparent),
    0 0 20px color-mix(in srgb, var(--skill-accent) 22%, transparent);
}

.mm-skill-card.is-cooldown {
  opacity: 1;
  cursor: help;
}

.mm-skill-card.is-locked {
  opacity: 0.72;
  cursor: help;
}

.mm-skill-card.is-locked .mm-skill-art img {
  filter: grayscale(1) brightness(0.52) contrast(0.9);
  opacity: 0.64;
}

.mm-skill-card.is-cooldown .mm-skill-art img {
  filter: grayscale(0.86) brightness(0.54) contrast(0.9);
  opacity: 0.72;
}

.mm-skill-card.is-ultimate {
  --skill-accent: var(--mm-lime);
  background:
    radial-gradient(circle at 28% 50%, rgba(199, 255, 56, 0.12), transparent 48%),
    linear-gradient(180deg, #11170d, #070a06);
}

.mm-skill-card[data-mm-skill-id="active2"] {
  --skill-accent: #75ebe6;
}

.mm-skill-art {
  position: relative;
  grid-column: 1;
  grid-row: 1 / 3;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-right: 1px solid color-mix(in srgb, var(--skill-accent) 28%, transparent);
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--skill-accent) 14%, transparent), transparent 65%),
    #080b0d;
}

.mm-skill-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 76%, rgba(5, 7, 8, 0.42) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), transparent 58%, rgba(0, 0, 0, 0.16));
  box-shadow: inset -8px 0 18px rgba(0, 0, 0, 0.16);
}

.mm-skill-art img {
  min-width: 0;
  min-height: 0;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  display: block;
  object-fit: contain;
  object-position: center;
  filter: none;
  transform: none;
  transition: transform 240ms ease;
}

.mm-skill-card:hover:not(:disabled) .mm-skill-art img {
  transform: scale(1.035);
}

.mm-skill-slot {
  position: absolute;
  z-index: 3;
  top: 7px;
  left: 7px;
  min-width: 25px;
  height: 25px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--skill-accent) 65%, transparent);
  background: rgba(3, 6, 8, 0.82);
  color: var(--skill-accent);
  font-family: var(--mm-font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-shadow: 0 0 10px color-mix(in srgb, var(--skill-accent) 62%, transparent);
}

.mm-skill-copy {
  position: relative;
  z-index: 2;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  padding: 8px 10px 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mm-skill-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--skill-accent) 45%, transparent);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--skill-accent);
}

.mm-skill-icon svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.mm-skill-copy b {
  overflow: hidden;
  color: #f0f3f4;
  font-family: var(--mm-font-display);
  font-size: 20px;
  line-height: 1.05;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.9);
}

.mm-skill-copy p {
  margin: 5px 0 0;
  color: #8a9195;
  font-family: var(--mm-font-ui);
  font-size: 10px;
  line-height: 1.32;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.mm-skill-meta {
  position: relative;
  z-index: 2;
  grid-column: 2;
  grid-row: 2;
  min-height: 24px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(226, 232, 235, 0.08);
  background: rgba(0, 0, 0, 0.18);
  color: #7c8285;
  font-family: var(--mm-font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.mm-skill-cost {
  color: var(--skill-accent);
  text-shadow: 0 0 10px color-mix(in srgb, var(--skill-accent) 42%, transparent);
}

.mm-turn-phase {
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mm-turn-phase > span,
.mm-turn-phase > small {
  color: #646a6d;
  font-family: var(--mm-font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mm-turn-phase > strong {
  margin-top: 5px;
  color: #f0f3f4;
  font-family: var(--mm-font-display);
  font-size: 18px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mm-turn-phase > small {
  margin-top: 4px;
  line-height: 1.3;
  text-transform: none;
}

.mm-turn-phase > i {
  position: relative;
  height: 3px;
  margin-top: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.mm-turn-phase > i::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  background: var(--mm-silver);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.35);
}

.mm-action-dock.is-my-turn .mm-turn-phase > strong,
.mm-action-dock.is-my-turn .mm-turn-phase > i::after {
  color: var(--mm-lime);
  background: var(--mm-lime);
}

.mm-action-dock.is-opponent-turn .mm-turn-phase > i::after {
  width: 18%;
}

.mm-action-dock.is-finished .mm-turn-phase > i::after {
  width: 100%;
}

.mm-log-panel {
  right: calc(var(--mm-right) + 28px);
  bottom: calc(var(--mm-bottom) + 25px);
  width: 410px;
  max-height: 340px;
  padding: 0 12px 12px;
}

.mm-log-panel::before {
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}

.mm-log-panel-head {
  height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--mm-line);
  color: #aeb4b7;
  font-family: var(--mm-font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mm-log-panel-head button {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--mm-silver-dim);
  cursor: pointer;
}

.mm-engine-log {
  max-height: 270px;
  padding-top: 8px;
  overflow: auto;
  border: 0;
}

.mm-engine-log-entry {
  padding: 8px 4px;
  border-bottom: 1px solid rgba(226, 232, 235, 0.08);
  color: #777d80;
  font-family: var(--mm-font-mono);
  font-size: 9px;
  line-height: 1.4;
}

.mm-engine-log-entry:first-child {
  color: #d1d6d8;
}

.mm-engine-actions {
  left: auto;
  top: auto;
  right: calc(var(--mm-right) + 28px);
  bottom: calc(var(--mm-bottom) + 25px);
  transform: none;
  width: 370px;
  max-width: none;
  min-height: 168px;
  padding: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  text-align: left;
}

.mm-engine-actions::before {
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.mm-engine-actions-close,
.mm-passport-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #8f9598;
  cursor: pointer;
  font-size: 18px;
}

.mm-engine-actions-kicker {
  display: block;
  color: #5f6568;
  font-family: var(--mm-font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.mm-engine-actions-title {
  margin-top: 7px;
  margin-bottom: 0;
  padding-right: 34px;
  color: #eef1f2;
  font-family: var(--mm-font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mm-capture-quote {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(211, 219, 222, 0.28);
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.06), transparent 58%),
    rgba(4, 6, 7, 0.86);
  box-shadow: inset 3px 0 0 var(--mm-lime);
  font-family: var(--mm-font-mono);
}

.mm-capture-quote.is-blocked {
  box-shadow: inset 3px 0 0 var(--mm-red);
}

.mm-capture-quote-head,
.mm-capture-quote-balance,
.mm-capture-quote li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mm-capture-quote-head > span,
.mm-capture-quote-balance > span {
  color: #9aa1a4;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.mm-capture-quote-head div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.mm-capture-quote-head strong {
  color: #f7fafb;
  font-family: var(--mm-font-display);
  font-size: 26px;
  line-height: 1;
}

.mm-capture-quote-head del {
  color: #73797c;
  font-size: 12px;
}

.mm-capture-quote-head small {
  color: var(--mm-lime);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.mm-capture-quote-rule {
  position: relative;
  height: 1px;
  margin-top: 12px;
  overflow: visible;
  background: linear-gradient(
    90deg,
    rgba(var(--mm-rarity-rgb), 0.72),
    rgba(var(--mm-rarity-rgb), 0.16) 72%,
    transparent
  );
}

.mm-capture-quote-rule i {
  position: absolute;
  top: -1px;
  left: 0;
  width: 34%;
  height: 3px;
  background: var(--mm-rarity);
  box-shadow: 0 0 12px rgba(var(--mm-rarity-rgb), 0.48);
}

.mm-capture-quote ul {
  margin: 10px 0 0;
  padding: 8px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  list-style: none;
}

.mm-capture-quote li {
  min-height: 21px;
  color: #969da0;
  font-size: 9px;
}

.mm-capture-quote li b {
  color: #dfe4e6;
}

.mm-capture-quote-balance {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.mm-capture-quote-balance b {
  color: #eef2f3;
  font-size: 11px;
}

.mm-capture-quote-loading {
  color: #9da4a7;
  font-size: 9px;
  letter-spacing: 0.12em;
}

.mm-capture-price-badge {
  position: fixed;
  z-index: 1250;
  min-width: 112px;
  padding: 7px 10px;
  transform: translate(-50%, -100%);
  border: 1px solid rgba(185, 194, 198, 0.48);
  background: rgba(5, 7, 8, 0.95);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), inset 0 -2px 0 var(--mm-lime);
  color: #b9c0c3;
  font-family: var(--mm-font-mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  line-height: 1;
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
}

.mm-capture-price-badge strong {
  margin-left: 8px;
  color: #fff;
  font-family: var(--mm-font-display);
  font-size: 17px;
}

.mm-capture-price-badge del {
  margin-left: 8px;
  color: #72787b;
}

.mm-capture-price-badge small {
  margin-left: 3px;
  color: var(--mm-lime);
  font-size: 9px;
}

.mm-capture-price-badge.is-blocked {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), inset 0 -2px 0 var(--mm-red);
}

.mm-engine-actions-buttons {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.mm-engine-action-btn {
  min-height: 42px;
  border: 1px solid var(--mm-line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.025);
  color: #c5cace;
  cursor: pointer;
  font-family: var(--mm-font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mm-engine-action-btn:hover:not(:disabled) {
  border-color: var(--mm-line-strong);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.mm-engine-action-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.mm-engine-actions-error {
  min-height: 14px;
  margin: 8px 0 0;
  color: var(--mm-red);
  font-family: var(--mm-font-mono);
  font-size: 9px;
}

.mm-skill-target-banner,
.mm-engine-banner {
  left: 50%;
  max-width: 620px;
  transform: translateX(-50%);
  border: 1px solid var(--mm-line-strong);
  border-radius: 0;
  background: rgba(4, 5, 6, 0.94);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5);
  color: #e8ecee;
  font-family: var(--mm-font-mono);
  font-size: 9px;
  letter-spacing: 0.07em;
}

.mm-skill-target-banner {
  top: 82px;
  min-height: 46px;
  margin: 0;
  padding: 0 7px 0 16px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.mm-skill-target-cancel {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--mm-line);
  border-radius: 0;
  background: transparent;
  color: #aeb4b7;
  cursor: pointer;
  font-family: var(--mm-font-mono);
  font-size: 9px;
  text-transform: uppercase;
}

.mm-engine-banner {
  top: 84px;
  padding: 12px 18px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
}

.mm-turn-announcer {
  z-index: 790;
  top: calc(var(--mm-top) + 10px);
  left: 50%;
  min-width: 286px;
  max-width: calc(100vw - 40px);
  min-height: 54px;
  padding: 13px 34px 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(221, 226, 229, 0.48);
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.08), transparent 24%, transparent 72%, rgba(255, 255, 255, 0.045)),
    linear-gradient(180deg, rgba(26, 29, 31, 0.98), rgba(6, 7, 8, 0.98));
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #d9dde0;
  font-family: var(--mm-font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.22em;
  line-height: 1;
  text-align: center;
  text-indent: 0.22em;
  text-transform: uppercase;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.mm-turn-announcer::before,
.mm-turn-announcer::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.mm-turn-announcer::before {
  top: 0;
  left: 14px;
  right: 14px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #eef1f2 50%, transparent);
  box-shadow: 0 0 12px rgba(238, 241, 242, 0.32);
}

.mm-turn-announcer::after {
  inset: 5px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  clip-path: inherit;
}

.mm-turn-announcer.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mm-reset {
  position: fixed;
  z-index: 650;
  top: 84px;
  left: calc(var(--mm-left) + 28px);
  right: auto;
  bottom: auto;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--mm-line);
  border-radius: 0;
  background: rgba(4, 5, 6, 0.86);
  box-shadow: none;
  backdrop-filter: none;
  color: #b0b6b9;
  cursor: pointer;
  font-family: var(--mm-font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mm-passport {
  top: var(--mm-top);
  right: calc(var(--mm-right) + 28px);
  bottom: calc(var(--mm-bottom) + var(--mm-gap));
  width: min(410px, 31vw);
  padding: 48px 18px 18px;
  overflow: auto;
  border: 1px solid var(--mm-line);
  background: var(--mm-panel-heavy);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.mm-passport-body {
  margin-top: 0;
  color: #aeb4b7;
}

.mm-passport-body h2,
.mm-passport-body h3 {
  color: #f0f3f4;
  font-family: var(--mm-font-display);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.mm-passport-body p,
.mm-passport-body li {
  font-size: 11px;
  line-height: 1.55;
}

.mm-map .leaflet-control-container {
  pointer-events: none;
}

.mm-map .leaflet-control-zoom,
.mm-map .leaflet-control-layers {
  display: none;
}

.mm-map .leaflet-control-attribution {
  display: block;
  pointer-events: auto;
  margin: 0 10px 10px 0;
  padding: 2px 5px;
  border: 1px solid rgba(154, 212, 0, 0.24);
  background: rgba(4, 5, 6, 0.78);
  color: rgba(220, 225, 227, 0.82);
  font-size: 9px;
}

.mm-map .leaflet-control-attribution a {
  color: #c8ff4d;
}

.mm-map .leaflet-tooltip.mm-tooltip {
  padding: 6px 9px;
  border: 1px solid var(--mm-line-strong);
  border-radius: 0;
  background: rgba(4, 5, 6, 0.9);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.38);
  color: #dce1e3;
  font-family: var(--mm-font-mono);
  font-size: 9px;
}

.mm-map .leaflet-tooltip::before {
  display: none;
}

.mm-map .leaflet-marker-pane,
.mm-map .leaflet-tooltip-pane,
.mm-map .leaflet-overlay-pane {
  z-index: 450;
}

.mm-map .leaflet-popup-pane {
  z-index: 670;
}

.mm-map .leaflet-popup-content-wrapper,
.mm-map .leaflet-popup-tip {
  border: 1px solid var(--mm-line);
  border-radius: 0;
  background: rgba(5, 6, 7, 0.96);
  color: var(--mm-silver);
}

.mm-map .leaflet-popup-content {
  font-family: var(--mm-font-ui);
}

.mm-map .leaflet-container a.leaflet-popup-close-button {
  color: #b8bdc0;
}

body.mm-page.is-skill-targeting {
  cursor: crosshair;
}

body.mm-page.is-skill-targeting .mm-map {
  outline: 1px solid rgba(199, 255, 56, 0.35);
  outline-offset: -2px;
}

.mm-page.is-check .mm-map-vignette {
  box-shadow: inset 0 0 100px rgba(255, 66, 89, 0.08);
}

.mm-page.is-finished .mm-map {
  filter: brightness(0.72);
}

.mm-back:hover,
.mm-brand:hover,
.mm-zoom-btn:hover:not(:disabled),
.mm-layer-toggle:hover,
.mm-layer-collapse:hover,
.mm-passport-close:hover,
.mm-engine-actions-close:hover,
.mm-log-panel-head button:hover {
  color: #fff;
}

:where(button, a):focus-visible {
  outline: 1px solid #f2f5f6;
  outline-offset: 3px;
}

@media (max-width: 1600px), (max-height: 900px) {
  :root {
    --mm-top: 68px;
    --mm-left: 270px;
    --mm-right: 0px;
    --mm-bottom: 150px;
  }

  .mm-command-topbar {
    top: 10px;
    left: 12px;
    right: 12px;
    height: 46px;
  }

  .mm-layer-rail,
  .mm-engine-hud {
    top: var(--mm-top);
  }

  .mm-layer-rail {
    left: 12px;
  }

  .mm-engine-hud {
    right: 12px;
  }

  .mm-filter-btn {
    min-height: 60px;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 11px;
  }

  .mm-filter-icon {
    width: 42px;
    height: 42px;
  }

  .mm-filter-icon svg {
    width: 23px;
    height: 23px;
  }

  .mm-filter-copy b {
    font-size: 15px;
  }

  .mm-filter-copy small {
    font-size: 11px;
  }

  .mm-action-dock {
    left: 50%;
    right: auto;
    bottom: 10px;
    width: min(1280px, calc(100vw - 32px));
    height: 132px;
    min-height: 0;
    max-height: 132px;
    grid-template-columns: 230px minmax(650px, 1fr) 175px;
    gap: 6px;
    padding: 6px;
    transform: translateX(-50%);
  }

  .mm-player-command {
    grid-template-columns: 44px 1fr;
    grid-template-rows: 42px 31px 28px;
    gap: 3px 7px;
    padding: 5px;
  }

  .mm-player-coin {
    width: 42px;
    height: 42px;
  }

  .mm-player-command-copy strong {
    font-size: 18px;
  }

  .mm-player-command-copy span {
    font-size: 9px;
  }

  .mm-player-command-copy b {
    font-size: 9px;
  }

  .mm-find-king-btn,
  .mm-log-toggle {
    min-height: 0;
    height: 28px;
    font-size: 9px;
  }

  .mm-player-stat {
    min-height: 0;
    height: 31px;
    padding: 3px 6px;
  }

  .mm-player-stat small {
    font-size: 9px;
  }

  .mm-player-stat b {
    font-size: 15px;
  }

  .mm-skill-section-label {
    height: 16px;
    min-height: 16px;
    font-size: 9px;
  }

  .mm-skill-card {
    height: 100%;
    min-height: 0;
    max-height: 104px;
    padding: 0;
  }

  .mm-skill-copy {
    padding: 7px 8px 3px;
  }

  .mm-skill-copy b {
    font-size: 18px;
  }

  .mm-skill-copy p {
    margin-top: 4px;
    font-size: 9px;
    line-height: 1.28;
  }

  .mm-skill-slot {
    top: 6px;
    left: 6px;
    min-width: 23px;
    height: 23px;
    font-size: 9px;
  }

  .mm-skill-meta {
    min-height: 22px;
    padding: 0 7px;
    font-size: 9px;
  }

  .mm-turn-phase > span,
  .mm-turn-phase > small {
    font-size: 9px;
  }

  .mm-turn-phase > strong {
    font-size: 16px;
  }

  .mm-log-panel,
  .mm-engine-actions {
    bottom: calc(var(--mm-bottom) + 18px);
  }
}

@media (max-width: 1366px), (max-height: 768px) {
  :root {
    --mm-top: 60px;
    --mm-left: 250px;
    --mm-right: 0px;
    --mm-bottom: 136px;
  }

  .mm-command-topbar {
    top: 7px;
    left: 8px;
    right: 8px;
    height: 42px;
  }

  .mm-back,
  .mm-brand,
  .mm-match-code,
  .mm-city,
  .mm-zoom,
  .mm-player-slot {
    min-height: 34px;
  }

  .mm-brand {
    padding-right: 12px;
    font-size: 17px;
  }

  .mm-match-code {
    padding: 0 10px;
  }

  .mm-players {
    min-width: 300px;
  }

  .mm-player-slot {
    padding: 0 9px;
  }

  .mm-city {
    padding: 0 10px;
  }

  .mm-zoom-label {
    min-width: 58px;
  }

  .mm-layer-rail {
    left: 8px;
  }

  .mm-engine-hud {
    right: 8px;
  }

  .mm-layer-rail-head,
  .mm-engine-turn {
    min-height: 40px;
  }

  .mm-layer-rail-head {
    padding-left: 13px;
    font-size: 12px;
  }

  .mm-filters {
    padding: 5px;
  }

  .mm-filter-btn {
    min-height: 56px;
    margin-bottom: 3px;
    padding: 5px 24px 5px 6px;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
  }

  .mm-filter-icon {
    width: 38px;
    height: 38px;
  }

  .mm-filter-icon svg {
    width: 21px;
    height: 21px;
  }

  .mm-filter-copy {
    gap: 3px;
  }

  .mm-filter-copy b {
    font-size: 14px;
  }

  .mm-filter-copy small {
    font-size: 10px;
  }

  .mm-layer-collapse {
    min-height: 40px;
    font-size: 10px;
  }

  .mm-turn-metric {
    min-height: 40px;
  }

  .mm-action-dock {
    left: 50%;
    right: auto;
    bottom: 7px;
    width: min(1120px, calc(100vw - 20px));
    height: 118px;
    min-height: 0;
    max-height: 118px;
    grid-template-columns: 210px minmax(580px, 1fr) 160px;
    gap: 5px;
    padding: 5px;
    transform: translateX(-50%);
  }

  .mm-player-command {
    grid-template-columns: 40px 1fr;
    grid-template-rows: 38px 27px 26px;
    gap: 3px 6px;
    padding: 4px;
  }

  .mm-player-coin {
    width: 38px;
    height: 38px;
  }

  .mm-player-command-copy strong {
    font-size: 16px;
  }

  .mm-player-command-copy span {
    font-size: 9px;
  }

  .mm-player-command-copy b {
    font-size: 9px;
  }

  .mm-player-command-actions {
    gap: 5px;
  }

  .mm-find-king-btn,
  .mm-log-toggle {
    min-height: 0;
    height: 26px;
    font-size: 9px;
  }

  .mm-player-stat {
    min-height: 0;
    height: 27px;
    padding: 3px 5px;
  }

  .mm-player-stat small {
    font-size: 6.5px;
  }

  .mm-player-stat b {
    font-size: 14px;
  }

  .mm-skill-section-label {
    height: 15px;
    min-height: 15px;
    font-size: 9px;
  }

  .mm-skill-list {
    gap: 5px;
  }

  .mm-skill-card {
    height: 100%;
    min-height: 0;
    max-height: 93px;
    padding: 0;
    grid-template-columns: minmax(84px, 43%) minmax(0, 57%);
    gap: 0;
  }

  .mm-skill-icon {
    width: 54px;
    height: 54px;
  }

  .mm-skill-icon svg {
    width: 28px;
    height: 28px;
  }

  .mm-skill-copy {
    padding: 6px 7px 3px;
  }

  .mm-skill-copy b {
    font-size: 15px;
  }

  .mm-skill-copy p {
    margin-top: 3px;
    font-size: 9px;
    line-height: 1.25;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .mm-skill-slot {
    top: 5px;
    left: 5px;
    min-width: 21px;
    height: 21px;
    font-size: 9px;
  }

  .mm-skill-meta {
    min-height: 20px;
    padding: 0 6px;
    font-size: 9px;
  }

  .mm-turn-phase {
    padding: 6px;
  }

  .mm-turn-phase > strong {
    margin-top: 5px;
    font-size: 15px;
  }

  .mm-turn-phase > span,
  .mm-turn-phase > small {
    font-size: 9px;
  }

  .mm-turn-phase > i {
    margin-top: 9px;
  }

  .mm-log-panel,
  .mm-engine-actions {
    right: calc(var(--mm-right) + 18px);
    bottom: calc(var(--mm-bottom) + 14px);
  }
}

/* COMMAND BAR V2
   MOBA-like composition: persistent character media, compact stats and
   square ability slots. The portrait container also accepts future video. */
:root {
  --mm-bottom: 198px;
}

.mm-action-dock {
  width: min(1180px, calc(100vw - 40px));
  height: 180px;
  max-height: 180px;
  grid-template-columns: 330px minmax(510px, 1fr) 170px;
  gap: 8px;
  padding: 8px;
  overflow: visible;
}

.mm-action-dock::before {
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.58),
    0 0 0 1px rgba(255, 255, 255, 0.025),
    inset 0 1px rgba(255, 255, 255, 0.055);
}

.mm-player-command {
  padding: 6px;
  grid-template-columns: 132px minmax(0, 1fr);
  grid-template-rows: 52px 50px 40px;
  gap: 5px 10px;
  overflow: hidden;
}

.mm-player-portrait {
  position: relative;
  grid-column: 1;
  grid-row: 1 / -1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(232, 238, 241, 0.32);
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.12), transparent 48%),
    #080a0b;
  box-shadow:
    inset 0 0 34px rgba(0, 0, 0, 0.5),
    0 0 18px rgba(255, 255, 255, 0.035);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}

.mm-player-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 54%, rgba(2, 3, 4, 0.74) 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 28%, transparent 72%, rgba(0, 0, 0, 0.3));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.mm-player-portrait-media,
.mm-player-portrait > video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 50%;
  filter: none;
}

.mm-player-portrait .mm-player-coin {
  position: absolute;
  z-index: 3;
  left: 8px;
  bottom: 8px;
  width: 36px;
  height: 36px;
  box-shadow:
    0 0 0 3px rgba(0, 0, 0, 0.72),
    0 0 18px rgba(199, 255, 56, 0.2);
}

.mm-player-command-copy {
  grid-column: 2;
  grid-row: 1;
  justify-content: flex-start;
  padding-top: 2px;
}

.mm-player-command-copy strong {
  font-size: 20px;
  letter-spacing: 0.075em;
}

.mm-player-command-copy span {
  margin-top: 4px;
  font-size: 9px;
}

.mm-player-command-copy b {
  font-size: 10px;
}

.mm-player-command-stats {
  grid-column: 2;
  grid-row: 2;
}

.mm-player-stat {
  height: 50px;
  padding: 5px 7px;
}

.mm-player-stat small {
  font-size: 9px;
}

.mm-player-stat b {
  font-size: 18px;
}

.mm-player-command-actions {
  grid-column: 2;
  grid-row: 3;
}

.mm-find-king-btn,
.mm-log-toggle {
  height: 40px;
  font-size: 9px;
}

.mm-skill-section-label {
  height: 22px;
  min-height: 22px;
  padding-left: 2px;
  font-size: 9px;
}

.mm-skill-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  overflow: visible;
}

.mm-skill-card {
  height: 100%;
  max-height: none;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  clip-path: polygon(8px 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%, 0 8px);
}

.mm-skill-art {
  grid-column: 1;
  grid-row: 1;
  border-right: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--skill-accent) 30%, transparent);
}

.mm-skill-art::after {
  background:
    linear-gradient(180deg, transparent 58%, rgba(3, 5, 6, 0.5) 100%),
    radial-gradient(circle at 50% 40%, transparent 44%, rgba(0, 0, 0, 0.18) 100%);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.16);
}

.mm-skill-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 50%;
  transform: none;
}

.mm-skill-copy {
  display: none;
}

.mm-skill-slot {
  top: 7px;
  left: 7px;
  min-width: 28px;
  height: 28px;
  font-size: 10px;
}

.mm-skill-meta {
  position: absolute;
  z-index: 6;
  left: auto;
  right: 6px;
  bottom: 6px;
  min-height: 22px;
  padding: 0 6px;
  border: 1px solid color-mix(in srgb, var(--skill-accent) 38%, transparent);
  background: rgba(2, 4, 5, 0.82);
  font-size: 9px;
}

.mm-skill-meta > span:first-child {
  display: none;
}

.mm-turn-phase {
  padding: 10px;
  justify-content: center;
}

.mm-turn-phase > strong {
  font-size: 18px;
}

.mm-turn-timer-slot {
  position: relative;
  padding: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.018), transparent 42%),
    rgba(2, 3, 4, 0.22);
}

.mm-turn-timer-slot::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(226, 232, 235, 0.035);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}

@media (max-width: 1600px), (max-height: 900px) {
  :root {
    --mm-bottom: 180px;
  }

  .mm-action-dock {
    width: min(1100px, calc(100vw - 32px));
    height: 164px;
    max-height: 164px;
    grid-template-columns: 292px minmax(480px, 1fr) 156px;
  }

  .mm-player-command {
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-rows: 46px 44px 36px;
  }

  .mm-player-stat {
    height: 44px;
  }

  .mm-find-king-btn,
  .mm-log-toggle {
    height: 36px;
  }

  .mm-skill-section-label {
    height: 19px;
    min-height: 19px;
  }

  .mm-skill-card {
    grid-template-rows: minmax(0, 1fr);
  }

  .mm-skill-meta {
    bottom: 6px;
  }

  .mm-turn-announcer {
    min-width: 258px;
    min-height: 50px;
    padding: 12px 28px 11px;
    font-size: 18px;
  }
}

@media (max-width: 1366px), (max-height: 768px) {
  :root {
    --mm-bottom: 166px;
  }

  .mm-action-dock {
    width: min(1040px, calc(100vw - 24px));
    height: 150px;
    max-height: 150px;
    grid-template-columns: 270px minmax(450px, 1fr) 146px;
  }

  .mm-player-command {
    grid-template-columns: 100px minmax(0, 1fr);
    grid-template-rows: 42px 40px 32px;
    gap: 4px 8px;
  }

  .mm-player-command-copy strong {
    font-size: 17px;
  }

  .mm-player-stat {
    height: 40px;
  }

  .mm-find-king-btn,
  .mm-log-toggle {
    height: 32px;
  }

  .mm-skill-section-label {
    height: 17px;
    min-height: 17px;
  }

  .mm-skill-list {
    gap: 5px;
  }

  .mm-skill-card {
    grid-template-rows: minmax(0, 1fr);
  }

  .mm-skill-meta {
    bottom: 5px;
  }
}

/* SKILL TOOLTIP V3
   Four stable slots. Upgrade controls live inside hover/focus tooltips, so
   they cannot break the ability grid or become nested buttons. */
.mm-skill-section {
  overflow: visible;
}

.mm-skill-points {
  min-height: 20px;
  margin: 0;
  display: flex;
  align-items: center;
  color: #aeb4b7;
  font-family: var(--mm-font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.mm-skill-list {
  grid-template-columns: repeat(4, minmax(0, 122px));
  justify-content: center;
  overflow: visible;
}

.mm-skill-entry {
  --skill-accent: #75d9ff;
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  align-self: center;
}

.mm-skill-entry:hover,
.mm-skill-entry:focus-within {
  z-index: 40;
}

.mm-skill-entry:focus-visible {
  outline: none;
}

.mm-skill-entry:focus-visible > .mm-skill-card {
  outline: 2px solid rgba(232, 238, 241, 0.82);
  outline-offset: 2px;
}

.mm-skill-entry > .mm-skill-card {
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: 1 / 1;
}

.mm-skill-entry[data-mm-skill-id="passive"] {
  --skill-accent: #d6dcdf;
}

.mm-skill-entry[data-mm-skill-id="active2"] {
  --skill-accent: #75ebe6;
}

.mm-skill-entry[data-mm-skill-id="ultimate"] {
  --skill-accent: var(--mm-lime);
}

.mm-skill-card.is-passive {
  --skill-accent: #d6dcdf;
  cursor: default;
}

.mm-skill-entry.can-level-up > .mm-skill-card {
  border-color: color-mix(in srgb, var(--mm-lime) 62%, rgba(255, 255, 255, 0.2));
  box-shadow:
    inset 0 0 22px rgba(199, 255, 56, 0.055),
    0 0 16px rgba(199, 255, 56, 0.075);
}

.mm-skill-tooltip {
  position: absolute;
  z-index: 50;
  left: 50%;
  bottom: calc(100% + 1px);
  width: 300px;
  padding: 14px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  border: 1px solid rgba(232, 238, 241, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), transparent 34%),
    rgba(5, 7, 8, 0.98);
  color: #e8ecee;
  box-shadow:
    0 22px 55px rgba(0, 0, 0, 0.72),
    inset 0 1px rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(18px);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  transform: translate(-50%, 8px);
  transition: opacity 130ms ease, visibility 130ms ease, transform 130ms ease;
}

.mm-skill-entry:first-child .mm-skill-tooltip {
  left: 0;
  transform: translate(0, 8px);
}

.mm-skill-entry:last-child .mm-skill-tooltip {
  right: 0;
  left: auto;
  transform: translate(0, 8px);
}

.mm-skill-entry:hover .mm-skill-tooltip,
.mm-skill-entry:focus-within .mm-skill-tooltip {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.mm-skill-entry:first-child:hover .mm-skill-tooltip,
.mm-skill-entry:first-child:focus-within .mm-skill-tooltip,
.mm-skill-entry:last-child:hover .mm-skill-tooltip,
.mm-skill-entry:last-child:focus-within .mm-skill-tooltip {
  transform: translate(0, 0);
}

.mm-skill-tooltip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #8e969a;
  font-family: var(--mm-font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.mm-skill-tooltip-head b {
  color: var(--mm-lime);
}

.mm-skill-tooltip h3 {
  margin: 10px 0 0;
  color: #f7f9fa;
  font-family: var(--mm-font-display);
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.mm-skill-tooltip > p {
  min-height: 48px;
  margin: 10px 0 0;
  color: #b6bdc0;
  font-family: var(--mm-font-ui);
  font-size: 12px;
  line-height: 1.45;
}

.mm-skill-tooltip-level {
  margin-top: 12px;
}

.mm-skill-tooltip-level > .mm-skill-tooltip-level-label {
  display: block;
  margin-bottom: 6px;
  color: #858d91;
  font-family: var(--mm-font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mm-skill-tooltip-requirement {
  min-height: 30px;
  margin-top: 9px;
  display: block;
  color: #929a9e;
  font-family: var(--mm-font-ui);
  font-size: 10px;
  line-height: 1.35;
}

.mm-skill-tooltip-actions {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.mm-skill-activate-btn,
.mm-skill-levelup-btn {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  cursor: pointer;
  font-family: var(--mm-font-mono);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.075em;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease;
}

.mm-skill-activate-btn {
  border: 1px solid rgba(199, 255, 56, 0.68);
  background:
    linear-gradient(180deg, rgba(199, 255, 56, 0.16), rgba(199, 255, 56, 0.055)),
    #0b0f08;
  color: #f4ffd8;
}

.mm-skill-activate-btn:hover:not(:disabled) {
  border-color: var(--mm-lime);
  background:
    linear-gradient(180deg, rgba(199, 255, 56, 0.25), rgba(199, 255, 56, 0.09)),
    #0d1208;
  box-shadow: 0 0 18px rgba(199, 255, 56, 0.14);
}

.mm-skill-levelup-btn {
  border: 1px solid rgba(232, 238, 241, 0.3);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.018)),
    #080a0b;
  color: #d8dde0;
}

.mm-skill-levelup-btn:hover:not(:disabled) {
  border-color: rgba(232, 238, 241, 0.58);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03)),
    #0b0d0e;
  box-shadow: 0 0 15px rgba(230, 236, 239, 0.08);
}

.mm-skill-activate-btn:disabled,
.mm-skill-levelup-btn:disabled {
  border-color: rgba(232, 238, 241, 0.15);
  background: rgba(255, 255, 255, 0.025);
  color: #656c70;
  cursor: default;
}

/* SQUARE SKILL LEVELS V4
   Card geometry and level state share one compact visual language. */
.mm-skill-level-cells {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 7px;
  min-height: 18px;
  padding: 4px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transform: translateX(-50%);
  border: 1px solid rgba(226, 232, 235, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    rgba(3, 5, 6, 0.84);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.035),
    0 5px 14px rgba(0, 0, 0, 0.34);
  pointer-events: none;
}

.mm-skill-level-cell {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  display: block;
  border: 1px solid color-mix(in srgb, var(--skill-accent) 34%, #7b8285);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 45%),
    #15191b;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.34),
    0 1px 2px rgba(0, 0, 0, 0.6);
}

.mm-skill-level-cell.is-lit {
  border-color: color-mix(in srgb, var(--skill-accent) 88%, #ffffff);
  background: var(--skill-accent);
  box-shadow:
    0 0 5px color-mix(in srgb, var(--skill-accent) 86%, transparent),
    0 0 12px color-mix(in srgb, var(--skill-accent) 56%, transparent),
    inset 0 0 0 1px rgba(255, 255, 255, 0.36);
}

.mm-skill-level-cell.is-new {
  animation: mm-skill-level-ignite 220ms ease-out both;
}

@keyframes mm-skill-level-ignite {
  0% {
    opacity: 0.2;
    transform: scale(0.72);
    box-shadow: 0 0 0 transparent;
  }

  70% {
    opacity: 1;
    transform: scale(1.2);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.mm-skill-cooldown {
  position: absolute;
  z-index: 7;
  inset: 0;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-content: center;
  justify-content: center;
  column-gap: 7px;
  row-gap: 1px;
  color: #d9dddf;
  pointer-events: none;
}

.mm-skill-cooldown::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(10, 12, 13, 0.72) 0 28%, rgba(5, 7, 8, 0.66) 48%, rgba(5, 7, 8, 0.34) 76%),
    rgba(5, 7, 8, 0.28);
}

.mm-skill-cooldown-clock {
  width: 30px;
  height: 30px;
  grid-row: 1 / 3;
  align-self: center;
  fill: rgba(8, 10, 11, 0.82);
  stroke: #aeb4b7;
  stroke-width: 1.6;
  stroke-linecap: square;
  filter: drop-shadow(0 0 8px rgba(215, 221, 224, 0.16));
}

.mm-skill-cooldown strong {
  align-self: end;
  color: #f0f2f3;
  font-family: var(--mm-font-display);
  font-size: 20px;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 8px #000;
}

.mm-skill-cooldown small {
  align-self: start;
  color: #9ca3a7;
  font-family: var(--mm-font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.mm-skill-tooltip-level .mm-skill-level-cells {
  position: static;
  min-height: 24px;
  padding: 5px 7px;
  justify-content: flex-start;
  transform: none;
  border-color: rgba(226, 232, 235, 0.14);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.mm-skill-tooltip-level .mm-skill-level-cell {
  width: 11px;
  height: 11px;
  flex-basis: 11px;
}

@media (max-width: 1600px), (max-height: 900px) {
  .mm-skill-list {
    grid-template-columns: repeat(4, minmax(0, 116px));
  }
}

@media (max-width: 1366px), (max-height: 768px) {
  .mm-skill-list {
    grid-template-columns: repeat(4, minmax(0, 100px));
  }

  .mm-skill-points {
    min-height: 17px;
    font-size: 9px;
  }

  .mm-turn-announcer {
    min-width: 232px;
    min-height: 46px;
    padding: 11px 24px 10px;
    font-size: 16px;
  }

  .mm-skill-tooltip {
    width: 270px;
    padding: 12px;
  }

  .mm-skill-tooltip h3 {
    font-size: 19px;
  }

  .mm-skill-tooltip > p {
    min-height: 42px;
    font-size: 11px;
  }
}

/* MATCH FINALE — server-timed monochrome dissolve */
.mm-match-finale {
  --mm-finale-blackout: 0;
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  color: #f3f5f6;
  font-family: var(--mm-font-mono);
  pointer-events: all;
}

.mm-match-finale[hidden] {
  display: none;
}

.mm-match-finale-particles,
.mm-match-finale-blackout,
.mm-match-finale-scan {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.mm-match-finale-particles {
  z-index: 2;
}

.mm-match-finale-blackout {
  z-index: 1;
  opacity: var(--mm-finale-blackout);
  background: #000;
  clip-path: circle(var(--mm-finale-radius, 0%) at 50% 52%);
  will-change: opacity, clip-path;
}

.mm-match-finale-scan {
  z-index: 3;
  opacity: 0.23;
  background:
    repeating-linear-gradient(180deg, transparent 0 3px, rgba(255, 255, 255, 0.022) 4px),
    radial-gradient(circle at 50% 52%, transparent 0 28%, rgba(0, 0, 0, 0.46) 86%);
  mix-blend-mode: screen;
}

.mm-match-finale-panel {
  position: relative;
  z-index: 5;
  width: min(760px, calc(100vw - 48px));
  min-height: 390px;
  padding: 48px 60px 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(226, 231, 234, 0.36);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 22%, transparent 76%, rgba(255, 255, 255, 0.025)),
    rgba(5, 6, 7, 0.78);
  box-shadow:
    0 34px 100px rgba(0, 0, 0, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 70px rgba(255, 255, 255, 0.018);
  backdrop-filter: blur(18px) saturate(0);
  animation: mm-finale-panel-enter 800ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.mm-match-finale-panel::before,
.mm-match-finale-panel::after {
  content: "";
  position: absolute;
  width: 72px;
  height: 1px;
  top: -1px;
  background: #f1f4f5;
  box-shadow: 0 0 20px rgba(239, 244, 246, 0.32);
}

.mm-match-finale-panel::before {
  left: 36px;
}

.mm-match-finale-panel::after {
  right: 36px;
}

.mm-match-finale-protocol,
.mm-match-finale-status {
  display: block;
  text-align: center;
  letter-spacing: 0.31em;
  text-transform: uppercase;
}

.mm-match-finale-protocol {
  color: #777d81;
  font-size: 10px;
}

.mm-match-finale-status {
  margin-top: 18px;
  color: #c6cbce;
  font-size: 12px;
  font-weight: 800;
}

.mm-match-finale-panel h1 {
  margin: 18px 0 26px;
  color: #f7f8f9;
  font-family: var(--mm-font-display);
  font-size: clamp(52px, 7vw, 96px);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: 0.19em;
  text-indent: 0.19em;
  text-shadow:
    0 1px 0 #fff,
    0 0 28px rgba(232, 237, 240, 0.16);
}

.mm-match-finale-panel.is-defeat h1 {
  color: #c5c9cc;
}

.mm-match-finale-versus {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 48px 1fr;
  align-items: stretch;
  border-block: 1px solid rgba(224, 229, 232, 0.16);
}

.mm-match-finale-player {
  min-width: 0;
  padding: 16px 18px;
  display: grid;
  gap: 7px;
  text-align: center;
}

.mm-match-finale-player span {
  color: #767c80;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.mm-match-finale-player strong {
  overflow: hidden;
  color: #aeb3b6;
  font-family: var(--mm-font-display);
  font-size: 19px;
  letter-spacing: 0.12em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-match-finale-player.is-winner strong {
  color: #f4f6f7;
  text-shadow: 0 0 14px rgba(233, 238, 240, 0.22);
}

.mm-match-finale-vs {
  display: grid;
  place-items: center;
  border-inline: 1px solid rgba(224, 229, 232, 0.12);
  color: #8e9497;
  font-family: var(--mm-font-display);
  font-size: 14px;
  font-weight: 800;
}

.mm-match-finale-countdown {
  margin: 26px 0 13px;
  color: #a9afb2;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-align: center;
}

.mm-match-finale-countdown strong {
  display: inline-block;
  min-width: 2.4ch;
  margin-left: 8px;
  color: #fff;
  font-family: var(--mm-font-display);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.mm-match-finale-progress {
  width: min(460px, 82%);
  height: 2px;
  overflow: hidden;
  background: rgba(226, 231, 234, 0.14);
}

.mm-match-finale-progress i {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(var(--mm-finale-time, 1));
  transform-origin: left center;
  background: linear-gradient(90deg, #62686c, #f1f4f5);
  box-shadow: 0 0 12px rgba(235, 240, 242, 0.25);
  will-change: transform;
}

body.is-finalizing {
  overflow: hidden;
}

body.is-finalizing .mm-command-topbar,
body.is-finalizing .mm-layer-rail,
body.is-finalizing .mm-action-dock,
body.is-finalizing .mm-engine-actions,
body.is-finalizing .mm-log-panel,
body.is-finalizing .mm-turn-announcer,
body.is-finalizing .mm-skill-target-banner,
body.is-finalizing .mm-passport,
body.is-finalizing .mm-reset {
  pointer-events: none !important;
  animation: mm-finale-hud-dismiss 1500ms ease 3200ms both;
}

.mm-dissolve-fragment {
  animation: mm-map-fragment-dissolve var(--mm-dissolve-duration, 7s) cubic-bezier(0.22, 0.72, 0.16, 1)
    var(--mm-dissolve-delay, 0s) both !important;
  will-change: opacity, filter, clip-path;
}

@keyframes mm-map-fragment-dissolve {
  0% {
    opacity: 1;
    filter: grayscale(1) brightness(1);
    clip-path: inset(0 0 0 0);
  }
  42% {
    opacity: 0.78;
    filter: grayscale(1) brightness(1.32) contrast(1.12);
    clip-path: inset(2% 1% 4% 3%);
  }
  72% {
    opacity: 0.24;
    filter: grayscale(1) brightness(1.8) blur(0.7px);
    clip-path: polygon(0 8%, 31% 0, 43% 18%, 76% 3%, 100% 22%, 86% 52%, 100% 83%, 61% 72%, 37% 100%, 10% 76%);
  }
  100% {
    opacity: 0;
    filter: grayscale(1) brightness(2.2) blur(2px);
    clip-path: polygon(18% 32%, 31% 29%, 38% 38%, 61% 34%, 70% 46%, 59% 58%, 44% 61%, 30% 52%);
  }
}

@keyframes mm-finale-panel-enter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes mm-finale-hud-dismiss {
  to {
    opacity: 0;
    filter: blur(5px);
    visibility: hidden;
  }
}

@media (max-width: 720px) {
  .mm-match-finale-panel {
    width: calc(100vw - 28px);
    min-height: 340px;
    padding: 38px 20px 34px;
  }

  .mm-match-finale-panel h1 {
    font-size: clamp(42px, 14vw, 68px);
  }

  .mm-match-finale-versus {
    grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr);
  }

  .mm-match-finale-player {
    padding-inline: 8px;
  }

  .mm-match-finale-player strong {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .mm-turn-announcer,
  .mm-turn-announcer.is-visible {
    transform: translateX(-50%);
  }

  body.is-finalizing .mm-command-topbar,
  body.is-finalizing .mm-layer-rail,
  body.is-finalizing .mm-action-dock,
  body.is-finalizing .mm-engine-actions,
  body.is-finalizing .mm-log-panel,
  body.is-finalizing .mm-turn-announcer,
  body.is-finalizing .mm-skill-target-banner,
  body.is-finalizing .mm-passport,
  body.is-finalizing .mm-reset {
    opacity: 0;
    visibility: hidden;
  }
}

/* OBJECT PASSPORT V2
   Central command-grade object card. Rarity is visual metadata only; the
   canonical capture quote and action availability still come from the engine. */
.mm-engine-actions {
  --mm-rarity: #c4ccd0;
  --mm-rarity-rgb: 196, 204, 208;
  z-index: 1400;
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  width: min(930px, calc(100vw - 48px));
  min-height: 0;
  max-height: calc(100vh - 48px);
  padding: 32px;
  transform: translate(-50%, -50%);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(211, 220, 224, 0.42);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.055), transparent 31%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 4px),
    linear-gradient(145deg, rgba(15, 19, 21, 0.985), rgba(5, 7, 8, 0.99));
  box-shadow:
    0 0 0 100vmax rgba(0, 3, 5, 0.72),
    0 32px 90px rgba(0, 0, 0, 0.78),
    inset 0 1px rgba(255, 255, 255, 0.055);
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px);
  text-align: left;
}

.mm-engine-actions::before {
  inset: 10px;
  border-color: rgba(213, 221, 224, 0.12);
  background: none;
  box-shadow: none;
  backdrop-filter: none;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.mm-engine-actions:not([hidden]) {
  animation: mm-object-passport-in 220ms ease-out both;
}

.mm-engine-actions-kicker,
.mm-object-summary-label,
.mm-object-effects-title,
.mm-object-description-title {
  color: #777f83;
  font-family: var(--mm-font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.mm-engine-actions-kicker {
  padding-left: 2px;
}

.mm-object-summary-label {
  color: #f2f5f6;
  font-size: 14px;
  letter-spacing: 0.12em;
}

.mm-engine-actions-close {
  top: 18px;
  right: 20px;
  z-index: 3;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(211, 220, 224, 0.24);
  color: #aeb6ba;
  font-size: 26px;
}

.mm-engine-actions-close:hover {
  border-color: rgba(232, 238, 240, 0.62);
  background: rgba(255, 255, 255, 0.045);
  color: #f4f7f8;
}

.mm-object-passport-head {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 28px;
  min-height: 136px;
  margin-top: 12px;
  padding: 18px 0 24px 22px;
  border-bottom: 1px solid rgba(218, 225, 228, 0.14);
}

.mm-object-passport-head::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 32px;
  left: 0;
  width: 4px;
  background: var(--mm-lime);
  box-shadow: 0 0 16px rgba(183, 255, 46, 0.24);
}

.mm-object-passport-heading {
  align-self: center;
  min-width: 0;
}

.mm-engine-actions-title {
  max-width: 100%;
  margin: 0;
  padding: 0;
  color: #f2f5f6;
  font-family: var(--mm-font-display);
  font-size: clamp(38px, 4vw, 58px);
  font-weight: 800;
  letter-spacing: 0.055em;
  line-height: 0.98;
  text-wrap: balance;
  text-transform: uppercase;
  text-shadow: 0 2px 0 #050606, 0 0 26px rgba(230, 238, 241, 0.08);
}

.mm-object-passport-context {
  margin-top: 14px;
  color: #8c9498;
  font-family: var(--mm-font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.mm-object-category {
  align-self: end;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding-left: 22px;
  border-left: 1px solid rgba(217, 225, 228, 0.14);
  color: #858d91;
  font-family: var(--mm-font-mono);
  font-size: 10px;
  letter-spacing: 0.11em;
  text-align: center;
  text-transform: uppercase;
}

.mm-object-category-copy {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.mm-object-category-copy b,
.mm-object-category-copy small {
  font: inherit;
  color: inherit;
}

.mm-object-category-copy b {
  font-weight: 700;
}

.mm-object-category-copy small {
  opacity: 0.72;
}

.mm-object-passport-summary {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr 0.62fr;
  gap: 14px;
  margin-top: 20px;
}

.mm-object-summary-card {
  min-height: 148px;
  padding: 18px 20px;
  border: 1px solid rgba(210, 219, 222, 0.22);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.008));
}

.mm-object-summary-rarity[data-rarity="point"] {
  --mm-rarity: #c4ccd0;
  --mm-rarity-rgb: 196, 204, 208;
}

.mm-object-summary-rarity[data-rarity="node"] {
  --mm-rarity: #37aaff;
  --mm-rarity-rgb: 55, 170, 255;
}

.mm-object-summary-rarity[data-rarity="core"] {
  --mm-rarity: #a968ff;
  --mm-rarity-rgb: 169, 104, 255;
}

.mm-object-summary-rarity[data-rarity="dominant"] {
  --mm-rarity: #d6b35a;
  --mm-rarity-rgb: 214, 179, 90;
}

.mm-object-rarity-badge {
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 12px;
  min-height: 62px;
  margin-top: 22px;
  padding: 10px 14px;
  border: 1px solid var(--mm-rarity);
  background:
    linear-gradient(90deg, rgba(var(--mm-rarity-rgb), 0.15), rgba(var(--mm-rarity-rgb), 0.025)),
    rgba(3, 8, 11, 0.72);
  color: var(--mm-rarity);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
  box-shadow: inset 0 0 22px rgba(var(--mm-rarity-rgb), 0.08);
}

.mm-object-rarity-mark {
  grid-row: 1 / span 2;
  font-size: 24px;
  text-shadow: 0 0 14px currentColor;
}

.mm-object-rarity-badge strong {
  font-family: var(--mm-font-display);
  font-size: 20px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mm-object-rarity-badge small {
  color: rgba(var(--mm-rarity-rgb), 0.72);
  font-family: var(--mm-font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.mm-object-summary-status > strong,
.mm-object-owner-row > b,
.mm-object-owner-label {
  display: block;
  font-family: var(--mm-font-mono);
  text-transform: uppercase;
}

.mm-object-summary-status > strong {
  margin-top: 25px;
  color: #56b9ff;
  font-size: 11px;
  letter-spacing: 0.11em;
}

.mm-object-owner-label {
  margin-top: 18px;
  color: #687074;
  font-size: 9px;
  letter-spacing: 0.13em;
}

.mm-object-owner-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}

.mm-object-owner-row > b {
  color: #e9edef;
  font-size: 12px;
  letter-spacing: 0.08em;
}

/* Фото владельца купленного объекта — круглый аватар слева от имени.
   Скрыт по умолчанию (свободные объекты и метро без владельца), показывается
   world-map.js через снятие [hidden] в openPassport(). Пока фото не пришло
   или не задано у спортсмена — виден только ромб-заглушка. */
.mm-object-owner-avatar {
  position: relative;
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(210, 219, 222, 0.35);
  background: rgba(255, 255, 255, 0.06);
}

.mm-object-owner-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.mm-object-owner-avatar-fallback {
  font-size: 11px;
  color: #687074;
}

.mm-object-summary-price .mm-capture-quote {
  min-height: 88px;
  margin: 12px 0 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mm-object-summary-price .mm-capture-quote.is-blocked {
  box-shadow: none;
}

.mm-object-summary-price .mm-capture-quote-head strong {
  font-size: 42px;
}

.mm-object-summary-price .mm-capture-quote-head > span {
  display: none;
}

.mm-object-summary-price .mm-capture-quote-head small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.mm-object-summary-price .mm-capture-quote-rule {
  margin-top: 14px;
}

.mm-object-summary-price .mm-capture-quote ul {
  margin-top: 9px;
  padding-top: 7px;
}

.mm-object-effects {
  min-height: 178px;
  margin-top: 18px;
  padding: 18px 20px 20px;
  border: 1px solid rgba(211, 220, 223, 0.2);
  background: rgba(3, 6, 7, 0.28);
}

.mm-object-effects-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.mm-object-effect,
.mm-object-effect-empty {
  display: grid;
  align-items: center;
  min-height: 66px;
  border: 1px solid rgba(207, 216, 220, 0.14);
  background: rgba(255, 255, 255, 0.012);
}

.mm-object-effect {
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  padding: 10px 18px 10px 10px;
}

.mm-object-effect-empty {
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 14px;
  padding: 8px 16px;
  color: #788084;
}

.mm-object-effect-icon,
.mm-object-effect-empty > span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(183, 255, 46, 0.28);
  color: var(--mm-lime);
  font-size: 21px;
}

.mm-object-effect-icon.has-skill-art {
  width: 56px;
  height: 56px;
  overflow: hidden;
  background: #050708;
}

.mm-object-effect-icon.has-skill-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.mm-object-effect strong,
.mm-object-effect-empty strong {
  display: block;
  color: #dfe4e6;
  font-family: var(--mm-font-display);
  font-size: 18px;
  line-height: 1.08;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mm-object-effect small,
.mm-object-effect-empty small {
  display: block;
  margin-top: 5px;
  color: #737b7f;
  font-family: var(--mm-font-mono);
  font-size: 12px;
  line-height: 1.45;
}

.mm-object-effect[data-polarity="negative"] {
  border-left: 2px solid #ff566c;
}

.mm-object-effect[data-polarity="negative"] .mm-object-effect-icon {
  color: #ff7182;
  border-color: rgba(255, 86, 108, 0.42);
}

.mm-object-effect[data-polarity="positive"] {
  border-left: 2px solid var(--mm-lime);
}

.mm-object-effect[data-polarity="neutral"] {
  border-left: 2px solid #aeb8bc;
}

.mm-object-effect-empty.is-loading > span {
  animation: mm-effect-loading 1.1s steps(3, end) infinite;
}

.mm-object-effect-empty.is-error {
  border-left: 2px solid #ff566c;
}

.mm-object-effect-empty.is-error > span {
  color: #ff7182;
  border-color: rgba(255, 86, 108, 0.42);
}

@keyframes mm-effect-loading {
  50% { opacity: 0.35; }
}

.leaflet-marker-icon.is-reachable {
  filter: brightness(1.18);
}

.mm-object-description {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(211, 220, 223, 0.2);
  background:
    linear-gradient(105deg, rgba(var(--mm-rarity-rgb), 0.055), transparent 62%),
    rgba(4, 6, 7, 0.32);
}

.mm-object-description > p {
  min-height: 48px;
  margin: 10px 0 0;
  color: #d7dde0;
  font-family: var(--mm-font-mono);
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.mm-object-description > p.is-empty {
  color: #858e92;
}

.mm-object-description-editor {
  margin-top: 12px;
}

.mm-object-description-editor button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(var(--mm-rarity-rgb), 0.42);
  background: rgba(var(--mm-rarity-rgb), 0.04);
  color: var(--mm-rarity);
  font-family: var(--mm-font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.mm-object-description-editor textarea {
  display: block;
  width: 100%;
  min-height: 112px;
  resize: vertical;
  padding: 13px 14px;
  border: 1px solid rgba(var(--mm-rarity-rgb), 0.42);
  outline: none;
  background: rgba(1, 3, 4, 0.78);
  color: #f1f4f5;
  font-family: var(--mm-font-mono);
  font-size: 15px;
  line-height: 1.5;
}

.mm-object-description-editor textarea:focus {
  border-color: var(--mm-rarity);
  box-shadow: 0 0 0 1px rgba(var(--mm-rarity-rgb), 0.24);
}

.mm-object-description-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 9px;
}

.mm-object-description-controls > span {
  margin-right: auto;
  color: #9ba4a8;
  font-family: var(--mm-font-mono);
  font-size: 12px;
}

.mm-object-description-status {
  display: block;
  min-height: 18px;
  margin-top: 8px;
  color: #aab3b7;
  font-family: var(--mm-font-mono);
  font-size: 12px;
}

.mm-object-danger {
  margin-top: 16px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 86, 108, 0.32);
  background: rgba(255, 86, 108, 0.05);
}

.mm-object-delete-btn,
.mm-object-delete-controls button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(255, 86, 108, 0.5);
  background: rgba(255, 86, 108, 0.06);
  color: #ff7182;
  font-family: var(--mm-font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.mm-object-delete-panel {
  margin-top: 4px;
}

.mm-object-delete-panel > p {
  margin: 0 0 10px;
  color: #d7dde0;
  font-family: var(--mm-font-mono);
  font-size: 13px;
  line-height: 1.5;
}

.mm-object-delete-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.mm-object-delete-confirm-btn {
  background: rgba(255, 86, 108, 0.18);
}

.mm-object-delete-status {
  display: block;
  min-height: 18px;
  margin-top: 8px;
  color: #ff96a2;
  font-family: var(--mm-font-mono);
  font-size: 12px;
}

.mm-engine-actions-buttons {
  grid-template-columns: 1fr;
  margin-top: 18px;
}

.mm-engine-action-btn {
  min-height: 58px;
  border-color: rgba(255, 73, 87, 0.7);
  background: linear-gradient(90deg, rgba(255, 53, 70, 0.035), rgba(255, 255, 255, 0.018));
  color: #f2f5f6;
  font-family: var(--mm-font-display);
  font-size: 16px;
  letter-spacing: 0.16em;
}

.mm-engine-action-btn.is-move {
  border-color: rgba(183, 255, 46, 0.62);
  color: #f2f5f6;
}

.mm-engine-action-btn.is-release {
  border-color: rgba(214, 179, 90, 0.55);
  color: #f2f5f6;
}

.mm-engine-action-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

.mm-engine-actions-error {
  min-height: 18px;
  margin: 10px 0 -8px;
  font-size: 10px;
  text-align: center;
}

@keyframes mm-object-passport-in {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 14px)) scale(0.985);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    filter: none;
  }
}

@keyframes mm-object-passport-in-top {
  from {
    opacity: 0;
    transform: translateX(-50%) scale(0.985);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    filter: none;
  }
}

@media (max-width: 900px) {
  .mm-engine-actions {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    padding: 24px 18px;
  }

  .mm-object-passport-head {
    grid-template-columns: minmax(0, 1fr) max-content;
  }

  .mm-engine-actions-title {
    font-size: clamp(30px, 7vw, 44px);
  }

  .mm-object-passport-summary {
    grid-template-columns: 1fr 1fr;
  }

  .mm-object-summary-status {
    grid-column: 1 / -1;
    min-height: 108px;
  }

  .mm-object-meta {
    grid-template-columns: 1fr;
  }

  .mm-object-meta > span + span {
    border-top: 1px solid rgba(211, 220, 223, 0.12);
    border-left: 0;
  }
}

/* OBJECT PASSPORT V2.1
   Desktop footprint is 75% of the original 930px passport. The rarity tone
   belongs to the whole metal chassis; object economy remains unchanged. */
.mm-engine-actions[data-rarity="point"] {
  --mm-rarity: #c4ccd0;
  --mm-rarity-rgb: 196, 204, 208;
}

.mm-engine-actions[data-rarity="node"] {
  --mm-rarity: #37aaff;
  --mm-rarity-rgb: 55, 170, 255;
}

.mm-engine-actions[data-rarity="core"] {
  --mm-rarity: #a968ff;
  --mm-rarity-rgb: 169, 104, 255;
}

.mm-engine-actions[data-rarity="dominant"] {
  --mm-rarity: #d6b35a;
  --mm-rarity-rgb: 214, 179, 90;
}

@media (min-width: 901px) {
  .mm-engine-actions {
    top: var(--mm-top);
    bottom: auto;
    width: min(700px, calc(100vw - 48px));
    max-height: calc(100vh - var(--mm-top) - var(--mm-bottom) - var(--mm-gap));
    padding: 18px 24px;
    transform: translateX(-50%);
    overflow-y: hidden;
    scrollbar-width: none;
    border-color: rgba(var(--mm-rarity-rgb), 0.62);
    background:
      radial-gradient(circle at 18% 0%, rgba(var(--mm-rarity-rgb), 0.12), transparent 34%),
      repeating-linear-gradient(0deg, rgba(var(--mm-rarity-rgb), 0.018) 0 1px, transparent 1px 4px),
      linear-gradient(145deg, rgba(15, 19, 21, 0.985), rgba(5, 7, 8, 0.99));
    box-shadow:
      0 0 0 100vmax rgba(0, 3, 5, 0.72),
      0 28px 76px rgba(0, 0, 0, 0.78),
      0 0 34px rgba(var(--mm-rarity-rgb), 0.1),
      inset 0 1px rgba(var(--mm-rarity-rgb), 0.18);
  }

  .mm-engine-actions::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .mm-engine-actions:not([hidden]) {
    animation-name: mm-object-passport-in-top;
  }

  .mm-engine-actions::before {
    inset: 8px;
    border-color: rgba(var(--mm-rarity-rgb), 0.22);
  }

  .mm-engine-actions-kicker,
  .mm-object-effects-title,
  .mm-object-description-title {
    color: rgba(var(--mm-rarity-rgb), 0.7);
    font-size: 9px;
  }

  .mm-object-summary-label {
    color: #f2f5f6;
    font-size: 14px;
    letter-spacing: 0.11em;
    text-shadow: 0 0 12px rgba(var(--mm-rarity-rgb), 0.16);
  }

  .mm-engine-actions-close {
    top: 10px;
    right: 15px;
    width: 38px;
    height: 38px;
    border-color: rgba(var(--mm-rarity-rgb), 0.38);
    color: var(--mm-rarity);
    font-size: 22px;
  }

  .mm-object-passport-head {
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 16px;
    min-height: 78px;
    margin-top: 2px;
    padding: 8px 0 10px 14px;
    border-color: rgba(var(--mm-rarity-rgb), 0.24);
  }

  .mm-object-passport-head::before {
    top: 8px;
    bottom: 14px;
    width: 3px;
    background: var(--mm-rarity);
    box-shadow: 0 0 14px rgba(var(--mm-rarity-rgb), 0.44);
  }

  .mm-engine-actions-title {
    font-size: clamp(28px, 2.65vw, 40px);
    text-shadow: 0 2px 0 #050606, 0 0 24px rgba(var(--mm-rarity-rgb), 0.12);
  }

  .mm-object-passport-context {
    margin-top: 5px;
    color: rgba(var(--mm-rarity-rgb), 0.72);
    font-size: 9px;
  }

  .mm-object-category {
    gap: 5px;
    padding-left: 12px;
    border-color: rgba(var(--mm-rarity-rgb), 0.24);
    color: rgba(var(--mm-rarity-rgb), 0.72);
    font-size: 9px;
  }

  .mm-object-description {
    margin-top: 12px;
    padding: 13px 15px;
  }

  .mm-object-description > p {
    min-height: 42px;
    font-size: 14px;
  }

  .mm-object-passport-summary {
    gap: 11px;
    margin-top: 15px;
  }

  .mm-object-summary-card {
    min-height: 111px;
    padding: 14px 15px;
    border-color: rgba(var(--mm-rarity-rgb), 0.3);
    background: linear-gradient(135deg, rgba(var(--mm-rarity-rgb), 0.065), rgba(var(--mm-rarity-rgb), 0.012));
  }

  .mm-object-rarity-badge {
    min-height: 47px;
    margin-top: 16px;
    padding: 8px 10px;
  }

  .mm-object-rarity-badge strong {
    font-size: 16px;
  }

  .mm-object-summary-status > strong {
    margin-top: 18px;
    color: var(--mm-rarity);
  }

  .mm-object-owner-label {
    margin-top: 12px;
  }

  .mm-object-summary-price .mm-capture-quote {
    min-height: 66px;
    margin-top: 8px;
  }

  .mm-object-summary-price .mm-capture-quote-head strong {
    font-size: 32px;
  }

  .mm-object-effects {
    min-height: 134px;
    margin-top: 14px;
    padding: 14px 15px 15px;
    border-color: rgba(var(--mm-rarity-rgb), 0.28);
    background: rgba(var(--mm-rarity-rgb), 0.025);
  }

  .mm-object-effects-list {
    gap: 7px;
    margin-top: 9px;
  }

  .mm-object-effect,
  .mm-object-effect-empty {
    min-height: 50px;
    border-color: rgba(var(--mm-rarity-rgb), 0.2);
  }

  .mm-object-effect-icon,
  .mm-object-effect-empty > span {
    width: 36px;
    height: 36px;
    border-color: rgba(var(--mm-rarity-rgb), 0.42);
    color: var(--mm-rarity);
  }

  .mm-object-effect-icon.has-skill-art {
    width: 42px;
    height: 42px;
  }

  .mm-object-effect strong,
  .mm-object-effect-empty strong {
    font-size: 16px;
  }

  .mm-object-effect small,
  .mm-object-effect-empty small {
    font-size: 11px;
  }

  .mm-object-meta {
    margin-top: 12px;
    border-color: rgba(var(--mm-rarity-rgb), 0.28);
  }

  .mm-object-meta > span {
    padding: 9px 12px;
  }

  .mm-object-meta > span + span {
    border-color: rgba(var(--mm-rarity-rgb), 0.18);
  }

  .mm-engine-actions-buttons {
    margin-top: 14px;
  }

  .mm-engine-action-btn,
  .mm-engine-action-btn.is-move,
  .mm-engine-action-btn.is-release {
    min-height: 44px;
    border-color: rgba(var(--mm-rarity-rgb), 0.72);
    background: linear-gradient(90deg, rgba(var(--mm-rarity-rgb), 0.1), rgba(var(--mm-rarity-rgb), 0.02));
    color: #f2f5f6;
    font-size: 13px;
    box-shadow: inset 0 0 20px rgba(var(--mm-rarity-rgb), 0.035);
  }
}

@media (max-width: 560px) {
  .mm-object-summary-label {
    font-size: 12px;
  }

  .mm-object-passport-head {
    grid-template-columns: 1fr;
    padding-right: 34px;
  }

  .mm-object-category {
    justify-items: start;
    padding: 12px 0 0;
    border-top: 1px solid rgba(217, 225, 228, 0.14);
    border-left: 0;
    text-align: left;
  }

  .mm-object-category-copy {
    justify-content: flex-start;
  }

  .mm-object-passport-summary {
    grid-template-columns: 1fr;
  }

  .mm-object-summary-status {
    grid-column: auto;
  }

  .mm-object-effect {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .mm-object-effect > b {
    grid-column: 2;
  }
}

/* OBJECT PASSPORT MEDIA
   Rare and higher objects use a 9:16 dossier; common points keep V2.1 intact. */
.mm-object-passport-body {
  display: block;
}

.mm-engine-actions.is-media-passport {
  width: min(1120px, calc(100vw - 48px));
}

.mm-engine-actions.is-media-passport .mm-object-passport-body {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 15px;
}

.mm-engine-actions.is-media-passport .mm-object-passport-summary,
.mm-engine-actions.is-media-passport .mm-object-effects {
  margin-top: 0;
}

.mm-object-passport-content {
  min-width: 0;
}

.mm-object-media {
  min-width: 0;
}

.mm-object-media[hidden],
.mm-object-media-frame img[hidden],
.mm-object-media-placeholder[hidden],
.mm-object-media-editor[hidden],
.mm-object-media-editor button[hidden] {
  display: none !important;
}

.mm-object-media-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 1px solid rgba(var(--mm-rarity-rgb), 0.76);
  background:
    linear-gradient(rgba(var(--mm-rarity-rgb), 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--mm-rarity-rgb), 0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 42%, rgba(var(--mm-rarity-rgb), 0.14), transparent 42%),
    #050708;
  background-size: 26px 26px, 26px 26px, auto, auto;
  box-shadow:
    0 0 28px rgba(var(--mm-rarity-rgb), 0.12),
    inset 0 0 36px rgba(0, 0, 0, 0.72);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
}

.mm-object-media-frame::before,
.mm-object-media-frame::after {
  content: "";
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.mm-object-media-frame::before {
  inset: 9px;
  border: 1px solid rgba(var(--mm-rarity-rgb), 0.25);
}

.mm-object-media-frame::after {
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 4px);
  mix-blend-mode: screen;
}

.mm-object-media-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: none;
  background: #020304;
}

.mm-object-media-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: rgba(var(--mm-rarity-rgb), 0.76);
  font-family: var(--mm-font-mono);
  letter-spacing: 0.16em;
  text-align: center;
}

.mm-object-media-placeholder::before {
  content: "◇";
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 12px;
  border: 1px solid rgba(var(--mm-rarity-rgb), 0.38);
  color: var(--mm-rarity);
  font-size: 36px;
  box-shadow: inset 0 0 22px rgba(var(--mm-rarity-rgb), 0.08);
}

.mm-object-media-placeholder span {
  font-size: 10px;
}

.mm-object-media-placeholder strong {
  color: var(--mm-rarity);
  font-family: var(--mm-font-display);
  font-size: 20px;
  letter-spacing: 0.1em;
}

.mm-object-media-placeholder small {
  font-size: 9px;
}

.mm-object-media-editor {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 7px;
  margin-top: 9px;
}

.mm-object-media-editor button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(var(--mm-rarity-rgb), 0.55);
  background: rgba(var(--mm-rarity-rgb), 0.055);
  color: var(--mm-rarity);
  font-family: var(--mm-font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mm-object-media-editor button:hover:not(:disabled) {
  background: rgba(var(--mm-rarity-rgb), 0.14);
}

.mm-object-media-editor button:disabled {
  cursor: wait;
  opacity: 0.48;
}

.mm-object-media-status {
  min-height: 28px;
  margin: 7px 2px 0;
  color: rgba(var(--mm-rarity-rgb), 0.72);
  font-family: var(--mm-font-mono);
  font-size: 9px;
  line-height: 1.45;
}

@media (max-width: 1100px) {
  .mm-engine-actions.is-media-passport {
    width: calc(100vw - 32px);
  }

  .mm-engine-actions.is-media-passport .mm-object-passport-body {
    grid-template-columns: 280px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .mm-engine-actions.is-media-passport .mm-object-passport-body {
    grid-template-columns: 1fr;
  }

  .mm-object-media {
    width: min(300px, 100%);
    margin: 0 auto;
  }
}
