:root {
  color-scheme: dark;
  --mm-bg: #070b11;
  --mm-bg-2: #101823;
  --mm-panel: rgba(12, 16, 22, 0.9);
  --mm-panel-soft: rgba(24, 30, 39, 0.88);
  --mm-line: rgba(246, 168, 74, 0.18);
  --mm-line-strong: rgba(246, 168, 74, 0.36);
  --mm-text: #f8f1df;
  --mm-muted: #b9b1a2;
  --mm-ore: #f5b441;
  --mm-hot: #ff7138;
  --mm-cool: #78d2ff;
  --mm-good: #9ce36e;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--mm-text);
  font-family: "Space Mono", monospace;
  background:
    radial-gradient(circle at top, rgba(120, 210, 255, 0.1), transparent 25%),
    radial-gradient(circle at 82% 16%, rgba(255, 113, 56, 0.12), transparent 20%),
    linear-gradient(180deg, #04070c 0%, #0b121b 46%, #12150f 100%);
  overflow-x: hidden;
}

.mm-celestial {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.mm-celestial__moon {
  position: absolute;
  top: 5rem;
  right: 6vw;
  width: min(18rem, 34vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 35%, rgba(255, 255, 255, 0.48), transparent 18%),
    radial-gradient(circle at 65% 55%, rgba(0, 0, 0, 0.28), transparent 26%),
    radial-gradient(circle at 50% 50%, #50483e, #2e271f 72%, rgba(17, 17, 17, 0.1) 100%);
  box-shadow: 0 0 80px rgba(245, 180, 65, 0.18);
  opacity: 0.58;
}

.mm-celestial__dust {
  position: absolute;
  inset: auto;
  width: 56vw;
  height: 18vw;
  border-radius: 999px;
  filter: blur(70px);
}

.mm-celestial__dust--one {
  left: -6vw;
  bottom: 6vh;
  background: rgba(255, 113, 56, 0.1);
}

.mm-celestial__dust--two {
  right: -10vw;
  top: 34vh;
  background: rgba(120, 210, 255, 0.08);
}

.mm-shell {
  position: relative;
  z-index: 1;
  width: min(1500px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 18px 0 36px;
}

.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 22%),
    var(--mm-panel);
  border: 1px solid var(--mm-line);
  box-shadow:
    0 26px 48px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  position: relative;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.mm-masthead,
.mm-brief,
.mm-panel,
.mm-arena {
  border-radius: 30px;
}

.mm-masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 16px;
  background:
    linear-gradient(90deg, rgba(245, 180, 65, 0.1), transparent 18%, transparent 82%, rgba(120, 210, 255, 0.08)),
    rgba(12, 16, 22, 0.88);
  border: 1px solid var(--mm-line-strong);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.3);
}

.mm-brand,
.mm-chip {
  text-decoration: none;
}

.mm-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--mm-text);
}

.mm-brand__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 10px 14px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.2)),
    rgba(34, 40, 49, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.mm-brand__logo img {
  display: block;
  width: auto;
  height: 28px;
}

.mm-brand__copy,
.mm-masthead__actions,
.mm-masthead__title {
  min-width: 0;
}

.mm-brand__copy {
  display: grid;
  gap: 3px;
}

.mm-brand__copy strong {
  font-family: "Teko", sans-serif;
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 0.92;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mm-brand__copy span:last-child {
  color: var(--mm-muted);
  font-size: 0.82rem;
}

.mm-masthead__title {
  text-align: center;
}

.mm-kicker {
  margin: 0;
  color: var(--mm-cool);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
}

.mm-masthead__title h1,
.mm-brief h2,
.mm-arena__head h2,
.mm-panel__head h2,
.mm-overlay__card h3,
.mm-contract h3 {
  margin: 0;
  font-family: "Teko", sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mm-masthead__title h1 {
  font-size: clamp(2.2rem, 4vw, 3.9rem);
  line-height: 0.86;
}

.mm-masthead__actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.mm-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.22)),
    rgba(31, 37, 46, 0.9);
  color: var(--mm-text);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.mm-chip--account {
  border-color: rgba(120, 210, 255, 0.24);
}

.mm-chip--coffee {
  border-color: rgba(245, 180, 65, 0.28);
  color: #fff3d7;
}

.mm-brief {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.72fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px 24px;
  margin-bottom: 16px;
}

.mm-brief h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 0.9;
}

.mm-copy {
  margin: 0;
  color: var(--mm-muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.mm-copy strong {
  color: var(--mm-text);
}

.mm-copy--tight {
  max-width: 42ch;
}

.mm-brief__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mm-badge {
  min-width: 0;
  padding: 14px 12px;
  border-radius: 18px;
  background: var(--mm-panel-soft);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 5px;
}

.mm-badge span,
.mm-metric span {
  color: var(--mm-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.mm-badge strong,
.mm-metric strong {
  font-family: "Teko", sans-serif;
  line-height: 0.9;
  letter-spacing: 0.04em;
}

.mm-badge strong {
  font-size: 1.6rem;
}

.mm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.82fr);
  gap: 16px;
  align-items: start;
}

.mm-arena,
.mm-panel {
  padding: 20px;
}

.mm-arena__head,
.mm-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}

.mm-arena__head h2,
.mm-panel__head h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 0.9;
}

.mm-canvas-shell {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(245, 180, 65, 0.26);
  background:
    linear-gradient(180deg, rgba(7, 11, 17, 0.4), rgba(7, 11, 17, 0.84)),
    #070b11;
  aspect-ratio: 16 / 9;
}

#meteorMuleCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.mm-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(7, 11, 17, 0.18);
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.mm-overlay.is-hidden {
  opacity: 0;
}

.mm-overlay__card {
  width: min(100%, 430px);
  padding: 22px 24px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.28)),
    rgba(12, 16, 22, 0.92);
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.34);
}

.mm-overlay__card h3 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.9;
  margin-bottom: 10px;
}

.mm-overlay__card p:last-child {
  margin: 0;
  color: var(--mm-muted);
  line-height: 1.65;
}

.mm-controls {
  margin-top: 16px;
  display: grid;
  gap: 16px;
}

.mm-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.mm-button,
.mm-touch__button,
.mm-touch__kick {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.24)),
    rgba(31, 37, 46, 0.92);
  color: var(--mm-text);
  font-family: "Space Mono", monospace;
  cursor: pointer;
}

.mm-button {
  min-height: 50px;
  padding: 0 18px;
  border-radius: 16px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
}

.mm-button--primary,
.mm-touch__kick {
  border-color: rgba(245, 180, 65, 0.28);
  background:
    linear-gradient(180deg, rgba(245, 180, 65, 0.18), rgba(255, 113, 56, 0.12)),
    rgba(44, 31, 23, 0.94);
}

.mm-touch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  gap: 14px;
}

.mm-touch__pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    ". up ."
    "left . right"
    ". down .";
  gap: 10px;
}

.mm-touch__button,
.mm-touch__kick {
  min-height: 62px;
  border-radius: 18px;
  font-size: 1.15rem;
}

.mm-touch__button--up { grid-area: up; }
.mm-touch__button--left { grid-area: left; }
.mm-touch__button--right { grid-area: right; }
.mm-touch__button--down { grid-area: down; }

.mm-touch__button.is-active,
.mm-touch__button:active,
.mm-touch__kick:active,
.mm-button:active {
  transform: translateY(1px);
  background:
    linear-gradient(180deg, rgba(120, 210, 255, 0.2), rgba(0, 0, 0, 0.24)),
    rgba(27, 46, 58, 0.95);
}

.mm-sidebar {
  display: grid;
  gap: 16px;
}

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

.mm-metric,
.mm-contract {
  min-width: 0;
  padding: 14px;
  border-radius: 18px;
  background: var(--mm-panel-soft);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mm-metric strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.mm-contracts {
  display: grid;
  gap: 12px;
}

.mm-contract {
  display: grid;
  gap: 12px;
  align-items: start;
}

.mm-contract h3 {
  font-size: 1.5rem;
  line-height: 0.9;
  margin-bottom: 8px;
}

.mm-contract p {
  margin: 0;
  color: var(--mm-muted);
  font-size: 0.82rem;
  line-height: 1.7;
}

.mm-contract strong {
  justify-self: start;
  font-size: 1rem;
  color: var(--mm-good);
}

.mm-log {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.mm-log li {
  padding: 12px 14px 12px 22px;
  border-radius: 16px;
  background: var(--mm-panel-soft);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ddd4c4;
  font-size: 0.83rem;
  line-height: 1.65;
  position: relative;
  overflow-wrap: anywhere;
}

.mm-log li::before {
  content: "";
  position: absolute;
  top: 17px;
  left: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mm-ore);
  box-shadow: 0 0 10px rgba(245, 180, 65, 0.5);
}

@media (max-width: 1180px) {
  .mm-masthead {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .mm-masthead__title {
    text-align: left;
  }

  .mm-masthead__actions {
    justify-content: flex-start;
  }

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

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

@media (max-width: 760px) {
  .mm-shell {
    width: min(100vw - 18px, 760px);
    padding-top: 10px;
  }

  .mm-masthead,
  .mm-brief,
  .mm-arena,
  .mm-panel {
    border-radius: 24px;
  }

  .mm-masthead,
  .mm-brief,
  .mm-arena,
  .mm-panel {
    padding-left: 16px;
    padding-right: 16px;
  }

  .mm-brand {
    width: 100%;
  }

  .mm-brand__logo {
    min-width: 96px;
  }

  .mm-brand__logo img {
    height: 24px;
  }

  .mm-brief__stats,
  .mm-metrics {
    grid-template-columns: 1fr;
  }

  .mm-arena__head,
  .mm-panel__head {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .mm-touch__kick {
    min-height: 58px;
  }
}
