/**
 * Home V2 · Layout D (desktop) + Mobile A (accordion).
 * Activates under html[data-mm-home-v2="1"] (localhost or ?v2=1).
 * Core palette only.
 */

/* Stable viewport frame: no horizontal page scroll, no content-box blowouts. */
html[data-mm-home-v2='1'] {
  /* Includes safe-area so body offset matches fixed header height. */
  --mm-v2-header-h: calc(3.75rem + env(safe-area-inset-top, 0px));
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

html[data-mm-home-v2='1'] body {
  background: var(--mm-bg, #0f0f0f);
  color: var(--mm-text, #f0f0f0);
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  /* Room for fixed header (logo row). Mobile adds a second nav row below. */
  padding-top: var(--mm-v2-header-h);
}

html[data-mm-home-v2='1'] main,
html[data-mm-home-v2='1'] .tcg-games-section,
html[data-mm-home-v2='1'] .mm-home-v2-hero,
html[data-mm-home-v2='1'] .mm-home-v2-acc,
html[data-mm-home-v2='1'] .tcg-grid,
html[data-mm-home-v2='1'] .mm-home-v2-ad,
html[data-mm-home-v2='1'] .mm-home-v2-latest,
html[data-mm-home-v2='1'] .latest-content-section,
html[data-mm-home-v2='1'] #site-footer {
  overflow-x: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

html[data-mm-home-v2='1'] *,
html[data-mm-home-v2='1'] *::before,
html[data-mm-home-v2='1'] *::after {
  box-sizing: border-box;
}

/* Fixed header: solid paint, no scroll-driven compact, no sticky jitter. */
html[data-mm-home-v2='1'] .navbar,
html[data-mm-home-v2='1'] .mm-home-v2-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.5rem;
  padding: 0.35rem 0.85rem;
  padding-top: calc(0.35rem + env(safe-area-inset-top, 0px));
  background: #1a1a1a;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  transition: none;
}

html[data-mm-home-v2='1'] .navbar.is-compact {
  padding-top: calc(0.35rem + env(safe-area-inset-top, 0px));
  padding-bottom: 0.35rem;
}

html[data-glass='flat'][data-mm-home-v2='1'] .navbar {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: #1a1a1a;
  box-shadow: none;
}

html[data-mm-home-v2='1'] .navbar-logo,
html[data-mm-home-v2='1'] .navbar-logo img {
  max-height: 2.75rem;
  width: auto;
  transform: none !important;
  transition: none !important;
}

/* V2 global nav: Games | Tools | Buylist | Explore | Upgrade | Log in */
html[data-mm-home-v2='1'] .navbar-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem 0.3rem;
  min-width: 0;
  max-width: 100%;
}

html[data-mm-home-v2='1'] .navbar-links a,
html[data-mm-home-v2='1'] .mm-v2-nav-link {
  width: auto !important;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.82rem;
  padding: 0.38rem 0.55rem;
}

html[data-mm-home-v2='1'] .mm-v2-nav-trigger {
  appearance: none;
  width: auto;
  white-space: nowrap;
  flex-shrink: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #f0f0f0;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.38rem 0.55rem;
  cursor: pointer;
}

html[data-mm-home-v2='1'] .mm-v2-nav-trigger:hover,
html[data-mm-home-v2='1'] .mm-v2-nav-trigger[aria-expanded='true'] {
  background: rgba(240, 240, 240, 0.1);
}

html[data-mm-home-v2='1'] .mm-v2-nav-dd {
  position: relative;
}

html[data-mm-home-v2='1'] .mm-v2-dd-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 80;
  min-width: 12.5rem;
  max-width: min(18rem, 80vw);
  padding: 0.55rem;
  background: #1a1a1a;
  border: 1px solid #303030;
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}

html[data-mm-home-v2='1'] .mm-v2-dd-panel[hidden] {
  display: none;
}

html[data-mm-home-v2='1'] .mm-v2-dd-note {
  margin: 0 0 0.4rem;
  font-size: 0.62rem;
  color: #9a9a9a;
  line-height: 1.35;
}

html[data-mm-home-v2='1'] .mm-v2-dd-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}

html[data-mm-home-v2='1'] .mm-v2-dd-list a {
  display: block;
  width: auto !important;
  padding: 0.38rem 0.45rem;
  border-radius: 4px;
  color: #c0c0c0;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

html[data-mm-home-v2='1'] .mm-v2-dd-list a:hover {
  background: rgba(0, 179, 55, 0.12);
  color: #00e045;
  transform: none;
}

html[data-mm-home-v2='1'] .mm-home-v2-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

/* Context strip scrolls with page (no second sticky layer / no scroll jitter). */
html[data-mm-home-v2='1'] .mm-home-v2-game-nav {
  position: relative;
  top: auto;
  z-index: 1;
  background: #141414;
  border-bottom: 1px solid #303030;
  padding: 0.4rem 0.85rem;
  max-width: 100%;
  overflow-x: hidden;
}

html[data-mm-home-v2='1'] .mm-home-v2-game-nav-inner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  max-width: 1400px;
  margin: 0 auto;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

html[data-mm-home-v2='1'] .mm-home-v2-game-name {
  flex-shrink: 0;
  color: #00e045;
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: none;
  white-space: nowrap;
}

html[data-mm-home-v2='1'] .mm-home-v2-game-tabs {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
  flex: 1 1 auto;
}

html[data-mm-home-v2='1'] .mm-home-v2-game-tab {
  flex: 0 0 auto;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #303030;
  color: #c0c0c0;
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

html[data-mm-home-v2='1'] .mm-home-v2-game-tab:hover {
  border-color: #00b337;
  color: #00b337;
}

html[data-mm-home-v2='1'] .mm-home-v2-game-clear {
  appearance: none;
  margin-left: auto;
  flex-shrink: 0;
  padding: 0.28rem 0.5rem;
  border: 1px solid #303030;
  border-radius: 4px;
  background: transparent;
  color: #9a9a9a;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

html[data-mm-home-v2='1'] .mm-home-v2-game-clear:hover {
  border-color: #00b337;
  color: #00b337;
}

/* Shared V2 footer chrome: solid charcoal, understated endpoint */
html[data-mm-home-v2='1'] .mm-home-v2-footer {
  background: #161616;
  color: #c0c0c0;
  padding: 1.65rem 0 1rem;
  text-align: left;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-mm-home-v2='1'] .mm-home-v2-footer .container {
  display: block;
  align-items: stretch;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.25rem;
  text-align: left;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-inner {
  display: grid;
  gap: 1.15rem;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-top {
  display: grid;
  grid-template-columns: minmax(14rem, 1.15fr) minmax(0, 2.2fr);
  gap: 1.75rem 2.5rem;
  align-items: start;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-brand {
  display: grid;
  gap: 0.7rem;
  align-content: start;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-logo {
  color: #00b337;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  line-height: 1.2;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-logo:hover {
  color: #00e045;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-tagline {
  margin: 0;
  max-width: 22rem;
  color: #9a9a9a;
  font-size: 0.78rem;
  line-height: 1.45;
  font-weight: 500;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-social,
html[data-mm-home-v2='1'] .mm-home-v2-footer-social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.75rem;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  scroll-margin-top: 4.5rem;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  opacity: 0.88;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-social a:hover {
  opacity: 1;
  transform: translateY(-1px);
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-social img,
html[data-mm-home-v2='1'] .mm-home-v2-footer-social i {
  width: 1.5rem;
  height: 1.5rem;
  display: block;
  object-fit: contain;
  font-size: 1.25rem;
  line-height: 1.5rem;
  text-align: center;
  color: #f0f0f0;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-social .fa-discord { color: #5865f2; }
html[data-mm-home-v2='1'] .mm-home-v2-footer-social .fa-youtube { color: #ff0000; }
html[data-mm-home-v2='1'] .mm-home-v2-footer-social .fa-twitch { color: #9146ff; }

html[data-mm-home-v2='1'] .mm-home-v2-footer-support-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.15rem;
  color: var(--mm-gold, #ffc107);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-support-cta:hover {
  color: #ffd54f;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem 1.5rem;
  margin: 0;
  align-content: start;
  min-width: 0;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-col {
  display: grid;
  gap: 0.38rem;
  align-content: start;
  min-width: 0;
  position: relative;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-heading {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #f0f0f0;
  margin-bottom: 0.2rem;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-col a {
  color: #9a9a9a;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
  margin: 0;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-col a:hover {
  color: #00b337;
  text-decoration: none;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-link-accent {
  color: var(--mm-gold, #ffc107) !important;
  font-weight: 700 !important;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-link-accent:hover {
  color: #ffd54f !important;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-meta {
  max-width: 52rem;
  margin: 0;
  padding: 0.95rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-attr,
html[data-mm-home-v2='1'] .mm-home-v2-footer-disc {
  margin: 0 0 0.35rem;
  color: #7a7a7a;
  font-size: 0.7rem;
  line-height: 1.45;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-disc {
  margin-bottom: 0;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-copy {
  margin: 0;
  color: #9a9a9a;
  font-size: 0.72rem;
}

html[data-mm-home-v2='1'] .mm-home-v2-footer-built {
  margin: 0;
  color: #00b337;
  font-size: 0.72rem;
  font-weight: 600;
  max-width: 28rem;
  line-height: 1.4;
}

@media (max-width: 900px) {
  html[data-mm-home-v2='1'] .mm-home-v2-footer-top {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  html[data-mm-home-v2='1'] .mm-home-v2-footer-brand {
    max-width: none;
  }

  html[data-mm-home-v2='1'] .mm-home-v2-footer-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.5rem;
    row-gap: 1.25rem;
    width: 100%;
  }

  html[data-mm-home-v2='1'] .mm-home-v2-footer-col {
    width: auto;
    max-width: none;
  }

  html[data-mm-home-v2='1'] .mm-home-v2-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  html[data-mm-home-v2='1'] {
    --mm-v2-header-h: calc(6.35rem + env(safe-area-inset-top, 0px));
  }

  /* Kill trunk hamburger drawer: always show a single scrollable nav row. */
  html[data-mm-home-v2='1'] .hamburger {
    display: none !important;
  }

  html[data-mm-home-v2='1'] .navbar,
  html[data-mm-home-v2='1'] .mm-home-v2-navbar {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.15rem;
    padding: 0.3rem 0;
    padding-top: calc(0.3rem + env(safe-area-inset-top, 0px));
  }

  html[data-mm-home-v2='1'] .navbar-logo {
    padding: 0 0.75rem;
    flex: 0 0 auto;
  }

  html[data-mm-home-v2='1'] .navbar-links,
  html[data-mm-home-v2='1'] .navbar-links.active {
    display: flex !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: flex-start;
    grid-template-columns: none;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0.2rem 0.75rem 0.45rem;
    padding-right: 1.35rem;
    gap: 0.35rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-padding-inline: 0.75rem;
    scrollbar-width: thin;
    background: transparent;
    box-shadow: none;
  }

  /* Trailing scroll spacer so Log in is not flush-clipped at the edge. */
  html[data-mm-home-v2='1'] .navbar-links::after {
    content: '';
    flex: 0 0 0.75rem;
  }

  html[data-mm-home-v2='1'] .navbar-links a,
  html[data-mm-home-v2='1'] .mm-v2-nav-link,
  html[data-mm-home-v2='1'] .mm-v2-nav-trigger,
  html[data-mm-home-v2='1'] .mm-home-v2-upgrade,
  html[data-mm-home-v2='1'] .mm-home-v2-login,
  html[data-mm-home-v2='1'] .mm-v2-nav-dd,
  html[data-mm-home-v2='1'] .mm-home-v2-account,
  html[data-mm-home-v2='1'] .mm-home-v2-login-wrap {
    width: auto !important;
    height: auto !important;
    margin: 0;
    flex: 0 0 auto;
  }

  html[data-mm-home-v2='1'] .mm-v2-dd-panel {
    position: absolute;
    left: 0;
    right: auto;
    max-width: min(18rem, calc(100vw - 1.5rem));
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
    margin: 0;
  }

  html[data-mm-home-v2='1'] .mm-home-v2-login-menu {
    right: 0;
    left: auto;
  }

  html[data-mm-home-v2='1'] .mm-home-v2-footer {
    padding: 1.35rem 0 0.9rem;
  }

  html[data-mm-home-v2='1'] .mm-home-v2-footer .container {
    padding: 0 0.85rem;
  }

  html[data-mm-home-v2='1'] .mm-home-v2-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  html[data-mm-home-v2='1'] .mm-home-v2-game-nav {
    top: auto;
  }
}

/* Hero: multi-game door; search not hero */
.mm-home-v2-hero {
  max-width: 920px;
  margin: 1.5rem auto 0.75rem;
  padding: 0 1.25rem;
  text-align: center;
}

.mm-home-v2-hero .main-heading {
  margin-bottom: 0.35rem;
  color: var(--mm-brand, #00b337);
}

.mm-home-v2-hero .main-subtitle {
  color: var(--mm-text-muted, #9a9a9a);
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

/* Quiet search omitted until site-wide MVP; hide trunk search host */
html[data-mm-home-v2='1'] #mm-home-search,
html[data-mm-home-v2='1'] .mm-home-search,
html[data-mm-home-v2='1'] .mm-home-legend,
html[data-mm-home-v2='1'] nav[aria-label='What you can do'] {
  display: none !important;
}

/* Equal 4-col cells; odd N leaves empty sibling */
html[data-mm-home-v2='1'] .tcg-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto 1rem;
  padding: 0 1.25rem;
}

@media (max-width: 1100px) {
  html[data-mm-home-v2='1'] .tcg-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

html[data-mm-home-v2='1'] .tcg-game-card {
  background: var(--mm-card, #202020);
  border: 1px solid var(--mm-border, #303030);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  transform: none !important;
  box-shadow: none;
  transition: border-color 0.15s ease;
}

html[data-mm-home-v2='1'] .tcg-game-card:hover {
  transform: none !important;
  box-shadow: none !important;
  border-color: rgba(0, 179, 55, 0.45);
}

/* Art + bottom gradient. Fixed aspect; border-box so padding never exceeds 100%. */
html[data-mm-home-v2='1'] .tcg-banner {
  position: relative;
  aspect-ratio: 760 / 200;
  width: 100%;
  max-width: 100%;
  height: auto !important;
  min-height: 0 !important;
  max-height: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  text-align: left;
  padding: 0.85rem 1rem;
  overflow: hidden;
  contain: layout paint;
}

html[data-mm-home-v2='1'] .tcg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
  pointer-events: none;
}

html[data-mm-home-v2='1'] .tcg-banner h3,
html[data-mm-home-v2='1'] .mm-home-v2-banner-title {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  text-align: left;
  width: auto;
  max-width: 100%;
  line-height: 1.2;
}

html[data-mm-home-v2='1'] .mm-home-v2-banner-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  max-width: 100%;
}

html[data-mm-home-v2='1'] .mm-home-v2-banner-count {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
}

/* Desktop grid cards: title horizontally centered at bottom of art; no tool count. */
html[data-mm-home-v2='1'] .tcg-game-card > .tcg-banner {
  justify-content: center;
  text-align: center;
}
html[data-mm-home-v2='1'] .tcg-game-card > .tcg-banner .mm-home-v2-banner-meta {
  align-items: center;
  text-align: center;
  width: 100%;
}
html[data-mm-home-v2='1'] .tcg-game-card > .tcg-banner h3,
html[data-mm-home-v2='1'] .tcg-game-card > .tcg-banner .mm-home-v2-banner-title {
  text-align: center;
  width: 100%;
}
html[data-mm-home-v2='1'] .tcg-game-card .mm-home-v2-banner-count {
  display: none;
}
/* Mobile accordion: keep title + count bottom-left. */
html[data-mm-home-v2='1'] .mm-home-v2-acc .mm-home-v2-banner-count {
  display: block;
}

/*
 * Full tool chips: equal size, max N cols (desktop/mobile max 3).
 * Flex-wrap + justify-content:center centers incomplete last rows (1-2);
 * full rows of 3 stay even. Never stretch a lone chip full width.
 */
html[data-mm-home-v2='1'] .tcg-tools {
  --mm-chip-min: 5.5rem;
  --mm-chip-cols: 3;
  --mm-chip-gap: 0.3rem;
  --mm-chip-basis: calc(
    (100% - (var(--mm-chip-cols) - 1) * var(--mm-chip-gap))
    / var(--mm-chip-cols)
  );
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  align-content: start;
  gap: var(--mm-chip-gap);
  padding: 0.55rem;
  min-height: 0;
  flex: 1;
}
html[data-mm-home-v2='1'] .tcg-tools[data-cols="2"] { --mm-chip-cols: 2; }
html[data-mm-home-v2='1'] .tcg-tools[data-cols="3"] { --mm-chip-cols: 3; }

html[data-mm-home-v2='1'] .tcg-tools .tool-btn,
html[data-mm-home-v2='1'] .tcg-tools.tcg-tools-cols-3 .tool-btn,
html[data-mm-home-v2='1'] .tcg-tools.tcg-tools-cols-4 .tool-btn,
html[data-mm-home-v2='1'] .tcg-tools > .tool-btn:only-child {
  flex: 0 0 var(--mm-chip-basis);
  width: var(--mm-chip-basis);
  max-width: var(--mm-chip-basis);
  min-width: min(100%, var(--mm-chip-min));
  min-height: 0;
  box-sizing: border-box;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0.42rem 0.48rem;
  background: var(--mm-panel, #1a1a1a);
  border: 1px solid rgba(0, 179, 55, 0.35);
  border-radius: 0;
  color: var(--mm-brand, #00b337);
  font-size: 0.78rem;
  line-height: 1.3;
  text-decoration: none;
  overflow: hidden;
}

html[data-mm-home-v2='1'] .tcg-tools .tool-btn i {
  display: none;
}

html[data-mm-home-v2='1'] .tcg-tools .tool-btn span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-word;
  max-width: 100%;
  font-size: inherit;
  line-height: inherit;
  text-align: center;
}

@media (max-width: 720px) {
  html[data-mm-home-v2='1'] .tcg-tools {
    --mm-chip-min: 5.75rem;
  }
  html[data-mm-home-v2='1'] .tcg-tools .tool-btn {
    font-size: 0.8rem;
    padding: 0.45rem 0.5rem;
  }
}

html[data-mm-home-v2='1'] .tcg-tools .tool-btn:hover {
  border-color: var(--mm-brand-strong, #00e045);
  color: var(--mm-brand-strong, #00e045);
}

html[data-mm-home-v2='1'] .mm-tile-jobs,
html[data-mm-home-v2='1'] .mm-tile-foot {
  display: none !important;
}

/* After-choice band chrome lives in css/mm-house-ads.css (.mm-home-v2-ad). */

html[data-mm-home-v2='1'] .nav-go-ad-free.mm-home-v2-adfree,
html[data-mm-home-v2='1'] .mm-home-v2-adfree,
html[data-mm-home-v2='1'] .mm-home-v2-upgrade {
  width: auto !important;
  border: 1px solid rgba(255, 193, 7, 0.55) !important;
  border-radius: 4px !important;
  padding: 0.25rem 0.55rem !important;
  color: var(--mm-gold, #ffc107) !important;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: none;
}

html[data-mm-home-v2='1'] .mm-home-v2-upgrade:hover {
  background: rgba(255, 193, 7, 0.1) !important;
  color: #ffc107 !important;
  transform: none;
}

.mm-home-v2-account {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  margin-left: 0.35rem;
  position: relative;
  flex-shrink: 0;
}

.mm-home-v2-login-wrap {
  position: relative;
  flex-shrink: 0;
}

.mm-home-v2-login {
  appearance: none;
  background: transparent;
  border: 1px solid var(--mm-brand, #00b337);
  color: var(--mm-brand, #00b337);
  padding: 0.25rem 0.55rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 4px;
  white-space: nowrap;
  width: auto !important;
  min-width: max-content;
  flex-shrink: 0;
  line-height: 1.2;
}

.mm-home-v2-login:hover,
.mm-home-v2-login[aria-expanded='true'] {
  background: rgba(0, 179, 55, 0.12);
  border-color: var(--mm-brand-strong, #00e045);
  color: var(--mm-brand-strong, #00e045);
}

.mm-home-v2-login-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 60;
  min-width: 11.5rem;
  padding: 0.55rem;
  background: var(--mm-panel, #1a1a1a);
  border: 1px solid var(--mm-border, #303030);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  display: grid;
  gap: 0.35rem;
}

.mm-home-v2-login-menu[hidden] {
  display: none;
}

.mm-home-v2-login-note {
  margin: 0;
  font-size: 0.65rem;
  color: var(--mm-text-muted, #9a9a9a);
  line-height: 1.35;
}

.mm-home-v2-account button[data-mm-login] {
  background: #151515;
  border: 1px solid var(--mm-border, #303030);
  color: var(--mm-text-sec, #c0c0c0);
  padding: 0.4rem 0.5rem;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  text-align: left;
}

.mm-home-v2-account button[data-mm-login]:hover {
  border-color: var(--mm-brand, #00b337);
  color: var(--mm-brand, #00b337);
}

.mm-home-v2-latest-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 1400px;
  margin: 0 auto 0.5rem;
  padding: 0 1.25rem;
}

.mm-home-v2-latest-head .section-title {
  margin: 0;
}

/* Latest hub / see-all link removed (owner feedback). */
.mm-home-v2-latest-seeall {
  display: none !important;
}

.mm-home-v2-latest-copy {
  padding: 0.65rem 0.75rem 0.8rem;
  text-align: center;
}

.mm-home-v2-latest-title {
  margin: 0;
  padding: 0;
  color: #f0f0f0;
  font-size: 0.92rem;
  line-height: 1.35;
}

.mm-home-v2-latest-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.2rem 0.15rem;
  margin: 0.35rem 0 0;
  padding: 0;
  color: #9a9a9a;
  font-size: 0.7rem;
  line-height: 1.35;
  font-weight: 500;
}

.mm-home-v2-latest-meta-chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-home-v2-latest-meta-sep {
  margin: 0 0.2rem;
  color: #666;
  font-weight: 400;
}

/* Keep trunk .content-card p padding from doubling with .mm-home-v2-latest-copy. */
html[data-mm-home-v2='1'] .mm-home-v2-latest-card.content-card > a > p,
html[data-mm-home-v2='1'] .mm-home-v2-latest-card .mm-home-v2-latest-copy > p {
  padding: 0;
}

.mm-home-v2-latest-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: 1400px;
  margin: 0 auto 0.65rem;
  padding: 0 1.25rem;
}

.mm-home-v2-latest-filters[hidden] {
  display: none;
}

.mm-home-v2-latest-chip {
  appearance: none;
  border: 1px solid var(--mm-border, #303030);
  background: #151515;
  color: var(--mm-text-muted, #9a9a9a);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
}

.mm-home-v2-latest-chip.is-active,
.mm-home-v2-latest-chip[aria-pressed='true'] {
  border-color: var(--mm-brand, #00b337);
  color: var(--mm-brand, #00b337);
  background: rgba(0, 179, 55, 0.1);
}

.mm-home-v2-latest-band {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.25rem 0.5rem;
}

.mm-home-v2-latest-band .mm-home-v2-latest-row.content-grid {
  max-width: none;
  margin: 0;
  padding: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mm-home-v2-latest-card {
  position: relative;
  transition: opacity 0.18s ease;
}

/* Beat trunk .content-card min-height / 4:3 img rules on live index. */
html[data-mm-home-v2='1'] .mm-home-v2-latest-card.content-card {
  min-height: 0;
}

.mm-home-v2-latest-card.is-rotating {
  opacity: 0.35;
}

@media (max-width: 1024px) and (min-width: 769px) {
  .mm-home-v2-latest-band .mm-home-v2-latest-row.content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .mm-home-v2-latest-band .mm-home-v2-latest-row.content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
}

.mm-home-v2-latest-badge {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  z-index: 1;
  padding: 0.12rem 0.4rem;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
}

.mm-home-v2-latest-badge[data-type='learn'] {
  border-color: rgba(255, 105, 180, 0.45);
  color: #ffb6d5;
}

.mm-home-v2-latest-badge[data-type='decklist'],
.mm-home-v2-latest-badge[data-type='report'] {
  border-color: rgba(255, 193, 7, 0.45);
  color: #ffd666;
}

.mm-home-v2-latest-badge[data-type='video'] {
  border-color: rgba(255, 0, 0, 0.45);
  color: #ff8a8a;
}

.mm-home-v2-latest-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1a1a1a;
  color: #9a9a9a;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mm-home-v2-latest-ph[data-type='learn'] {
  background: linear-gradient(145deg, #1a1a1a, #2a1520);
  color: #ffb6d5;
}

.mm-home-v2-latest-ph[data-type='decklist'],
.mm-home-v2-latest-ph[data-type='report'] {
  background: linear-gradient(145deg, #1a1a1a, #2a2410);
  color: #ffd666;
}

.mm-home-v2-latest-ph[data-type='video'] {
  background: linear-gradient(145deg, #1a1a1a, #2a1010);
  color: #ff8a8a;
}

/* 16:9 media well. Higher specificity so trunk .content-card img { 4/3 } cannot crop videos. */
html[data-mm-home-v2='1'] .mm-home-v2-latest-card img,
.mm-home-v2-latest-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  object-position: center center;
  background: #1a1a1a;
}

/* Video: full YouTube static frame visible (mqdefault 16:9; letterbox OK). */
html[data-mm-home-v2='1'] .mm-home-v2-latest-card img.is-video-thumb,
.mm-home-v2-latest-card img.is-video-thumb {
  object-fit: contain;
  object-position: center center;
}

/* Legend character art: fill the 16:9 well, top-aligned faces (not video treatment). */
html[data-mm-home-v2='1'] .mm-home-v2-latest-card img.is-legend-crop,
.mm-home-v2-latest-card img.is-legend-crop {
  object-fit: cover;
  object-position: top center;
}

.mm-home-v2-latest-empty {
  grid-column: 1 / -1;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--mm-border, #303030);
  border-radius: 8px;
  color: var(--mm-text-muted, #9a9a9a);
  padding: 1rem;
  text-align: center;
}

.mm-home-v2-latest-empty p {
  margin: 0;
}

/* Mobile A: clean vertical stack (stable widths; no mid-scroll scale). */
html[data-mm-home-v2='1'] .mm-home-v2-acc {
  display: none;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto 1rem;
  padding: 0 0.85rem;
  flex-direction: column;
  gap: 0.5rem;
}

html[data-mm-home-v2='1'] .mm-home-v2-acc-tile {
  background: var(--mm-card, #202020);
  border: 1px solid var(--mm-border, #303030);
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  transform: none !important;
}

html[data-mm-home-v2='1'] .mm-home-v2-acc-tile.is-open {
  border-color: rgba(0, 179, 55, 0.45);
}

html[data-mm-home-v2='1'] .mm-home-v2-acc-head {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

html[data-mm-home-v2='1'] .mm-home-v2-acc-head .tcg-banner {
  min-height: 0 !important;
  height: auto !important;
  aspect-ratio: 760 / 200;
  width: 100%;
  max-width: 100%;
  padding: 0.65rem 0.75rem;
  padding-right: 3.5rem;
}

html[data-mm-home-v2='1'] .mm-home-v2-acc-chev {
  position: absolute;
  z-index: 2;
  right: 0.65rem;
  bottom: 0.65rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #041208;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 4px;
  padding: 0.28rem 0.4rem;
}

html[data-mm-home-v2='1'] .mm-home-v2-acc-body {
  display: none;
  padding: 0.55rem;
  border-top: 1px solid var(--mm-border, #303030);
}

html[data-mm-home-v2='1'] .mm-home-v2-acc-tile.is-open .mm-home-v2-acc-body {
  display: block;
}

html[data-mm-home-v2='1'] .mm-home-v2-acc-body .tcg-tools {
  padding: 0;
}

@media (max-width: 720px) {
  html[data-mm-home-v2='1'] .tcg-grid {
    display: none !important;
  }
  html[data-mm-home-v2='1'] .mm-home-v2-acc {
    display: flex;
  }

  html[data-mm-home-v2='1'] .mm-home-v2-hero {
    margin: 0.85rem auto 0.55rem;
    padding: 0 0.85rem;
    max-width: 100%;
  }

  html[data-mm-home-v2='1'] .mm-home-v2-section-label {
    padding: 0 0.85rem;
    max-width: 100%;
  }

  html[data-mm-home-v2='1'] .mm-home-v2-acc-body {
    max-width: 100%;
    overflow-x: hidden;
  }

  html[data-mm-home-v2='1'] .mm-home-v2-acc-body .tcg-tools {
    width: 100%;
    max-width: 100%;
  }

  html[data-mm-home-v2='1'] .mm-home-v2-latest-head,
  html[data-mm-home-v2='1'] .mm-home-v2-latest-band,
  html[data-mm-home-v2='1'] .mm-home-v2-latest-filters {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    max-width: 100%;
  }
}
