/**
 * Home Phase E1 · Layout D desktop + Mobile A accordion
 * Core palette only. Shared by annotated mocks + local proto.
 */
:root {
  --e1-bg: var(--mm-bg, #0f0f0f);
  --e1-panel: var(--mm-panel, #1a1a1a);
  --e1-card: var(--mm-card, #202020);
  --e1-border: var(--mm-border, #303030);
  --e1-text: var(--mm-text, #f0f0f0);
  --e1-sec: var(--mm-text-sec, #c0c0c0);
  --e1-muted: var(--mm-text-muted, #9a9a9a);
  --e1-brand: var(--mm-brand, #00b337);
  --e1-brand-strong: var(--mm-brand-strong, #00e045);
  --e1-gold: var(--mm-gold, #ffc107);
  --e1-font: var(--mm-font, "Roboto", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif);
  --e1-radius: 12px;
}

* { box-sizing: border-box; }

body.e1-home {
  margin: 0;
  font-family: var(--e1-font);
  background: var(--e1-bg);
  color: var(--e1-text);
}

.e1-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  align-items: center;
  padding: 0.55rem 1rem;
  background: rgba(15, 15, 15, 0.96);
  border-bottom: 1px solid var(--e1-border);
  font-size: 0.8rem;
}
.e1-bar strong { color: var(--e1-brand-strong); }
.e1-bar span { color: var(--e1-muted); }
.e1-bar a { color: var(--e1-brand); text-decoration: none; font-weight: 700; }
.e1-bar .e1-picks { margin-left: auto; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.e1-bar .e1-picks a {
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--e1-border);
  border-radius: 4px;
  color: var(--e1-sec);
  font-weight: 600;
}
.e1-bar .e1-picks a.is-on,
.e1-bar .e1-picks a:hover {
  border-color: var(--e1-brand);
  color: var(--e1-brand);
}
.e1-bar button {
  appearance: none;
  border: 1px solid var(--e1-border);
  background: #151515;
  color: var(--e1-sec);
  font: inherit;
  font-weight: 700;
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
}
.e1-bar button:hover { border-color: var(--e1-brand); color: var(--e1-brand); }

.e1-stage {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1rem 1.1rem 3rem;
}
.e1-stage.is-390 {
  max-width: 390px;
  padding: 0.75rem 0.65rem 2.5rem;
}

.e1-chrome {
  position: sticky;
  top: 0;
  /* Above sticky site banners (.banner-container is 50–500) so Games/Tools menus stay clickable. */
  z-index: 600;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  padding: 0.7rem 1rem;
  margin-bottom: 0;
  background: color-mix(in srgb, var(--e1-panel) 78%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  transition: padding 0.18s ease;
}
.e1-chrome.is-compact {
  padding: 0.45rem 0.85rem;
}
.e1-chrome-wrap {
  margin-bottom: 0.85rem;
}
.e1-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #f0f0f0;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.e1-brand:hover {
  opacity: 0.92;
}
/* Real Magical Meta lockup (palette + wordmark). ~2x prior desktop size; clamp on narrow. */
.e1-brand-logo {
  display: block;
  height: clamp(2.25rem, 3.6vw + 1.1rem, 3.7rem);
  width: auto;
  max-width: min(280px, 48vw);
  object-fit: contain;
}
/* Legacy green square — keep for any leftover markup; prefer .e1-brand-logo. */
.e1-brand-mark {
  width: 10px;
  height: 10px;
  background: var(--e1-brand);
  display: inline-block;
}
.e1-brand:has(.e1-brand-logo) .e1-brand-mark {
  display: none;
}
.e1-burger {
  appearance: none;
  margin-left: auto;
  display: none;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0.4rem;
  border: 1px solid var(--e1-border);
  border-radius: 4px;
  background: #151515;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 0.28rem;
}
.e1-burger span {
  display: block;
  height: 2px;
  background: var(--e1-sec);
  border-radius: 1px;
}
.e1-global-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem 0.35rem;
  margin-left: auto;
  flex: 1 1 auto;
  min-width: 0;
}
.e1-nav-link,
.e1-nav-trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.55rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--e1-sec);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.e1-nav-link:hover,
.e1-nav-trigger:hover,
.e1-nav-trigger[aria-expanded="true"] {
  color: var(--e1-text);
  background: rgba(255, 255, 255, 0.06);
}
.e1-nav-dd {
  position: relative;
}
.e1-dd-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 610;
  min-width: 12.5rem;
  max-width: min(18rem, 80vw);
  padding: 0.55rem;
  background: var(--e1-panel);
  border: 1px solid var(--e1-border);
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}
.e1-nav-dd[data-dd="tools"] .e1-dd-panel,
.e1-nav-dd[data-dd="explore"] .e1-dd-panel {
  left: auto;
  right: 0;
}
.e1-dd-panel[hidden] { display: none; }
.e1-dd-note {
  margin: 0 0 0.4rem;
  font-size: 0.62rem;
  color: var(--e1-muted);
  line-height: 1.35;
}
.e1-dd-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}
.e1-dd-list a {
  display: block;
  padding: 0.38rem 0.45rem;
  border-radius: 4px;
  color: var(--e1-sec);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
}
.e1-dd-list a:hover {
  background: rgba(0, 179, 55, 0.12);
  color: var(--e1-brand-strong);
}

.e1-upgrade {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.55rem;
  border: 1px solid rgba(255, 193, 7, 0.55);
  border-radius: 4px;
  color: var(--e1-gold);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.e1-upgrade:hover {
  border-color: var(--e1-gold);
  background: rgba(255, 193, 7, 0.1);
}

.e1-acct {
  font-size: 0.72rem;
  color: var(--e1-muted);
}
.e1-acct-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.e1-login-wrap {
  position: relative;
  flex-shrink: 0;
}
.e1-login {
  appearance: none;
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.55rem;
  border: 1px solid var(--e1-brand);
  border-radius: 4px;
  background: transparent;
  color: var(--e1-brand);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  width: auto;
  min-width: max-content;
  flex-shrink: 0;
}
.e1-login:hover,
.e1-login[aria-expanded="true"] {
  background: rgba(0, 179, 55, 0.12);
  color: var(--e1-brand-strong);
  border-color: var(--e1-brand-strong);
}
.e1-login-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 50;
  min-width: 11.5rem;
  padding: 0.55rem;
  background: var(--e1-panel);
  border: 1px solid var(--e1-border);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  display: grid;
  gap: 0.35rem;
}
.e1-login-menu[hidden] { display: none; }
.e1-login-note {
  margin: 0 0 0.15rem;
  font-size: 0.62rem;
  line-height: 1.35;
  color: var(--e1-muted);
}
.e1-login-provider {
  appearance: none;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--e1-border);
  border-radius: 4px;
  background: #151515;
  color: var(--e1-sec);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.e1-login-provider:hover {
  border-color: var(--e1-brand);
  color: var(--e1-brand);
}

/* Game context row */
.e1-game-nav {
  margin: 0.35rem 0 0.85rem;
  padding: 0.4rem 0.65rem;
  background: #141414;
  border: 1px solid var(--e1-border);
  border-radius: 8px;
  position: sticky;
  top: 3.1rem;
  z-index: 35;
}
.e1-game-nav[hidden] { display: none; }
.e1-game-nav.is-example {
  border-style: dashed;
  border-color: rgba(0, 224, 69, 0.35);
  background: rgba(0, 179, 55, 0.05);
}
.e1-game-nav-inner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.e1-game-name {
  flex-shrink: 0;
  color: var(--e1-brand-strong);
  font-weight: 700;
  font-size: 0.78rem;
  text-decoration: none;
  white-space: nowrap;
}
.e1-game-tabs {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  min-width: 0;
  flex: 1 1 auto;
  padding-bottom: 0.1rem;
}
.e1-game-tab {
  flex: 0 0 auto;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--e1-border);
  color: var(--e1-sec);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.e1-game-tab:hover {
  border-color: var(--e1-brand);
  color: var(--e1-brand);
}
.e1-game-nav-tag {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--e1-brand);
  white-space: nowrap;
}
.e1-game-clear {
  appearance: none;
  flex-shrink: 0;
  margin-left: auto;
  padding: 0.28rem 0.5rem;
  border: 1px solid var(--e1-border);
  border-radius: 4px;
  background: transparent;
  color: var(--e1-muted);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.e1-game-clear:hover {
  border-color: var(--e1-brand);
  color: var(--e1-brand);
}

@media (max-width: 820px) {
  .e1-burger { display: inline-flex; }
  .e1-global-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    padding-top: 0.35rem;
    border-top: 1px solid var(--e1-border);
  }
  .e1-chrome.is-nav-open .e1-global-nav { display: flex; }
  .e1-nav-dd { width: 100%; }
  .e1-dd-panel {
    position: static;
    max-width: none;
    margin-top: 0.25rem;
    box-shadow: none;
  }
  .e1-nav-dd[data-dd="tools"] .e1-dd-panel,
  .e1-nav-dd[data-dd="explore"] .e1-dd-panel {
    left: 0;
    right: 0;
  }
  .e1-upgrade,
  .e1-login-wrap {
    align-self: flex-start;
  }
  .e1-game-nav { top: 0; }
}

.e1-hero {
  text-align: center;
  padding: 1.35rem 0 0.85rem;
}
.e1-hero h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.45rem, 2.4vw, 2.1rem);
  color: var(--e1-brand);
}
.e1-hero p {
  margin: 0 auto;
  max-width: 42rem;
  color: var(--e1-muted);
  font-size: 0.95rem;
}
.e1-stage.is-390 .e1-hero h1 { font-size: 1.3rem; }
.e1-stage.is-390 .e1-hero p { font-size: 0.85rem; }

.e1-h2 {
  margin: 1.25rem 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--e1-sec);
}
.e1-h2 .e1-count {
  margin-left: 0.4rem;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--e1-muted);
}

/* Equal cells: odd N leaves empty last-row cell (no stretch) */
.e1-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}
@media (max-width: 1100px) {
  .e1-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.e1-tile {
  background: var(--e1-card);
  border: 1px solid var(--e1-border);
  border-radius: var(--e1-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.e1-banner {
  position: relative;
  aspect-ratio: 760 / 200;
  width: 100%;
  min-height: 110px;
  background: #151515 center / cover no-repeat;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0.85rem 1rem;
  overflow: hidden;
}
.e1-banner-grad {
  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;
}
.e1-banner-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  max-width: 100%;
  text-align: left;
}
.e1-banner-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  line-height: 1.2;
}
.e1-banner-count {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.85);
}

/* Desktop tiles: title center bottom; no tool-count. Mobile accordion: bottom-left + count. */
.e1-tile .e1-banner {
  justify-content: center;
}
.e1-tile .e1-banner-meta {
  align-items: center;
  text-align: center;
  width: 100%;
}
.e1-tile .e1-banner-count {
  display: none;
}
.e1-acc-tile .e1-banner-count {
  display: block;
}

.e1-tile-body {
  padding: 0.55rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/*
 * Even tool chip wall: equal chip size, max N cols (readability > square).
 * Flex-wrap + justify-content:center so incomplete last rows (1-2 chips)
 * sit centered in the tile; full rows of 3 stay even. Never stretch a
 * lone chip full width. Min chip width via --e1-chip-min.
 */
.e1-chips {
  --e1-chip-min: 5.5rem;
  --e1-chip-cols: 3;
  --e1-chip-gap: 0.3rem;
  --e1-chip-basis: calc(
    (100% - (var(--e1-chip-cols) - 1) * var(--e1-chip-gap))
    / var(--e1-chip-cols)
  );
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: start;
  gap: var(--e1-chip-gap);
}
.e1-chips[data-cols="2"] { --e1-chip-cols: 2; }
.e1-chips[data-cols="3"] { --e1-chip-cols: 3; }
.e1-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex: 0 0 var(--e1-chip-basis);
  width: var(--e1-chip-basis);
  max-width: var(--e1-chip-basis);
  min-width: min(100%, var(--e1-chip-min));
  padding: 0.42rem 0.48rem;
  background: var(--e1-panel);
  border: 1px solid rgba(0, 179, 55, 0.35);
  color: var(--e1-brand);
  font-size: 0.78rem;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  overflow: hidden;
}
.e1-chip-label {
  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%;
}
.e1-chip:hover {
  border-color: var(--e1-brand-strong);
  color: var(--e1-brand-strong);
}
.e1-stage.is-390 .e1-chips {
  --e1-chip-min: 5.75rem;
}
.e1-stage.is-390 .e1-chip {
  font-size: 0.8rem;
  padding: 0.45rem 0.5rem;
}

/* Mobile A accordion */
.e1-acc {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.e1-acc-tile {
  background: var(--e1-card);
  border: 1px solid var(--e1-border);
  border-radius: var(--e1-radius);
  overflow: hidden;
}
.e1-acc-tile.is-open {
  border-color: rgba(0, 179, 55, 0.45);
}
.e1-acc-head {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.e1-acc-head .e1-banner {
  min-height: 72px;
  aspect-ratio: 760 / 180;
  padding: 0.65rem 0.75rem;
  padding-right: 4.25rem;
}
.e1-acc-head .e1-banner-title { font-size: 0.95rem; }
.e1-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;
}
.e1-acc-body {
  display: none;
  padding: 0.55rem;
  border-top: 1px solid var(--e1-border);
}
.e1-acc-tile.is-open .e1-acc-body { display: block; }

.e1-ad {
  margin: 1.25rem 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--e1-border);
  border-radius: 8px;
  color: var(--e1-muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  position: relative;
}

.e1-yt {
  margin: 1.25rem 0;
  padding: 0.85rem;
  background: var(--e1-panel);
  border: 1px solid var(--e1-border);
  border-radius: 8px;
}
.e1-latest-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}
.e1-yt h2,
.e1-latest-head h2 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--e1-sec);
}
.e1-latest-seeall {
  font-size: 0.72rem;
  color: var(--e1-brand);
  text-decoration: none;
  white-space: nowrap;
}
.e1-latest-seeall:hover {
  color: var(--e1-brand-strong, #00e045);
  text-decoration: underline;
}
.e1-latest-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.55rem;
}
.e1-latest-filters[hidden] {
  display: none;
}
.e1-latest-chip {
  appearance: none;
  border: 1px solid var(--e1-border);
  background: #151515;
  color: var(--e1-muted);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.22rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
}
.e1-latest-chip.is-active,
.e1-latest-chip[aria-pressed='true'] {
  border-color: var(--e1-brand);
  color: var(--e1-brand);
  background: rgba(0, 179, 55, 0.1);
}
.e1-yt-band {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.e1-yt-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}
.e1-yt-row--secondary {
  opacity: 0.98;
}
.e1-stage.is-390 .e1-yt-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.e1-latest-card.is-rotating,
.e1-yt-card.is-rotating {
  opacity: 0.35;
  transition: opacity 0.18s ease;
}
.e1-yt-ph {
  min-height: 72px;
  background:
    repeating-linear-gradient(-45deg, #1c1c1c, #1c1c1c 8px, #222 8px, #222 16px);
  border: 1px dashed var(--e1-border);
  color: var(--e1-muted);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.e1-yt-card,
.e1-latest-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #151515;
  border: 1px solid var(--e1-border);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
/* 16:9 media well: videos show full static thumb; legends crop separately. */
.e1-yt-card img,
.e1-latest-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  object-position: center center;
  background: #111;
}

/* Video: full YouTube static frame visible (mqdefault 16:9; letterbox OK). */
.e1-yt-card img.is-video-thumb,
.e1-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). */
.e1-yt-card img.is-legend-crop,
.e1-latest-card img.is-legend-crop {
  object-fit: cover;
  object-position: top center;
}
.e1-yt-card > span:last-child,
.e1-latest-card > span:last-child {
  display: block;
  padding: 0.4rem 0.5rem;
  font-size: 0.72rem;
  color: var(--e1-sec);
  line-height: 1.3;
}
.e1-latest-badge {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  z-index: 1;
  padding: 0.12rem 0.35rem;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.e1-latest-badge[data-type='learn'] {
  border-color: rgba(255, 105, 180, 0.45);
  color: #ffb6d5;
}
.e1-latest-badge[data-type='decklist'],
.e1-latest-badge[data-type='report'] {
  border-color: rgba(255, 193, 7, 0.45);
  color: #ffd666;
}
.e1-latest-date {
  display: block;
  margin-top: 0.2rem;
  font-style: normal;
  font-size: 0.62rem;
  color: var(--e1-muted);
}
.e1-latest-empty {
  grid-column: 1 / -1;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--e1-border);
  border-radius: 6px;
  background: #151515;
  color: var(--e1-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}
.e1-latest-empty p { margin: 0; }

/* Shared V2 footer chrome: solid charcoal, understated, ~280-360px desktop */
.e1-footer {
  margin-top: 1.5rem;
  padding: 1.65rem 1.25rem 1rem;
  background: #161616;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  color: var(--e1-sec);
}
.e1-stage.is-390 ~ .e1-footer,
body.e1-home .e1-footer {
  width: 100%;
}
.e1-stage.is-390 ~ .e1-footer {
  max-width: 390px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}
.e1-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  gap: 1.15rem;
  min-width: 0;
}
.e1-footer-top {
  display: grid;
  grid-template-columns: minmax(14rem, 1.15fr) minmax(0, 2.2fr);
  gap: 1.75rem 2.5rem;
  align-items: start;
  min-width: 0;
}
.e1-footer-brand {
  display: grid;
  gap: 0.7rem;
  align-content: start;
}
.e1-footer-logo {
  color: var(--e1-brand);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  line-height: 1.2;
}
.e1-footer-logo:hover { color: var(--e1-brand-strong); }
.e1-footer-tagline {
  margin: 0;
  max-width: 22rem;
  color: var(--e1-muted);
  font-size: 0.78rem;
  line-height: 1.45;
  font-weight: 500;
}
.e1-footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.75rem;
  align-items: center;
  scroll-margin-top: 4.5rem;
}
.e1-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;
}
.e1-footer-social a:hover {
  opacity: 1;
  transform: translateY(-1px);
}
.e1-footer-social img,
.e1-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: var(--e1-text);
}
.e1-footer-social .fa-discord { color: #5865f2; }
.e1-footer-social .fa-youtube { color: #ff0000; }
.e1-footer-social .fa-twitch { color: #9146ff; }
.e1-footer-support-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.15rem;
  color: var(--e1-gold);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}
.e1-footer-support-cta:hover { color: #ffd54f; }
.e1-footer-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem 1.5rem;
  align-content: start;
  min-width: 0;
}
.e1-footer-col {
  display: grid;
  gap: 0.38rem;
  align-content: start;
  min-width: 0;
  position: relative;
}
.e1-footer-heading {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--e1-text);
  margin-bottom: 0.2rem;
}
.e1-footer-col a {
  color: var(--e1-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
}
.e1-footer-col a:hover { color: var(--e1-brand); }
.e1-footer-link-accent {
  color: var(--e1-gold) !important;
  font-weight: 700 !important;
}
.e1-footer-link-accent:hover { color: #ffd54f !important; }
.e1-footer-meta {
  display: grid;
  gap: 0.35rem;
  max-width: 52rem;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.e1-footer-attr,
.e1-footer-disc {
  margin: 0;
  color: #7a7a7a;
  font-size: 0.7rem;
  line-height: 1.45;
}
.e1-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);
}
.e1-footer-copy {
  margin: 0;
  color: var(--e1-muted);
  font-size: 0.72rem;
}
.e1-footer-built {
  margin: 0;
  color: var(--e1-brand);
  font-size: 0.72rem;
  font-weight: 600;
  max-width: 28rem;
  line-height: 1.4;
}

/* Mobile / mock-390: brand first, then 2-col link grid (viewport + constrained mock). */
@media (max-width: 900px) {
  .e1-footer-top {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .e1-footer-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.5rem;
    row-gap: 1.25rem;
    width: 100%;
  }
  .e1-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Mock mobile stage is 390px wide even when the browser viewport is desktop-wide. */
.e1-stage.is-390 ~ .e1-footer .e1-footer-top {
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
.e1-stage.is-390 ~ .e1-footer .e1-footer-links {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.5rem;
  row-gap: 1.25rem;
  width: 100%;
}
.e1-stage.is-390 ~ .e1-footer .e1-footer-bottom {
  flex-direction: column;
  align-items: flex-start;
}
.e1-stage.is-390 ~ .e1-footer {
  padding: 1.35rem 0.85rem 0.9rem;
}

/*
 * body.is-390: nested footers (MW proto / hubs) are not siblings of .e1-stage,
 * so the rules above miss them. Mirror Home mobile: brand stack + 2-col links.
 */
body.is-390 .e1-footer-top {
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
body.is-390 .e1-footer-links {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.5rem;
  row-gap: 1.25rem;
  width: 100%;
}
body.is-390 .e1-footer-bottom {
  flex-direction: column;
  align-items: flex-start;
}
body.is-390 .e1-footer {
  padding: 1.35rem 0.85rem 0.9rem;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .e1-footer {
    padding: 1.35rem 0.85rem 0.9rem;
  }
}

/* Annotations */
body.annotate [data-wire] {
  position: relative;
  outline: 1px dashed rgba(0, 224, 69, 0.45);
  outline-offset: -1px;
}
body.annotate [data-wire]::after {
  content: attr(data-wire);
  position: absolute;
  z-index: 40;
  top: 3px;
  left: 3px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(0, 179, 55, 0.92);
  color: #041208;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
}
body.annotate [data-ad-space] {
  border-color: var(--e1-gold) !important;
  background: rgba(255, 193, 7, 0.08) !important;
}
body.annotate [data-ad-space]::after {
  content: "Ad Space";
  bottom: 0.4rem;
  right: 0.5rem;
  left: auto;
  top: auto;
  background: var(--e1-gold);
  color: #1a1400;
}

.e1-note {
  margin-top: 1.5rem;
  padding: 1rem;
  border-left: 3px solid var(--e1-brand);
  background: var(--e1-panel);
  font-size: 0.85rem;
  color: var(--e1-sec);
}
.e1-note h3 {
  margin: 0 0 0.4rem;
  color: var(--e1-text);
  font-size: 0.95rem;
}
.e1-note ul {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}
.e1-note li { margin-bottom: 0.25rem; }

/* Proto responsive: desktop D / mobile A */
.e1-proto .e1-acc { display: none; }
.e1-proto .e1-grid { display: grid; }
@media (max-width: 720px) {
  .e1-proto .e1-grid { display: none; }
  .e1-proto .e1-acc { display: flex; }
  .e1-proto .e1-yt-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
