html {
  scroll-behavior: smooth;
  scroll-padding-top: 145px;
}

.mtg-app {
  --mtg-dark: #2e2e2e;
  --mtg-footer: #2c3d47;
  --mtg-panel: #6e7a80;
  --mtg-accent: #f7be39;
  --mtg-bg: #f4f4f4;
  --mtg-text: #555;
  --mtg-link: #174ea6;
  background: var(--mtg-bg);
  color: var(--mtg-text);
  font-family: Arial, sans-serif;
  line-height: 1.7;
}

.mtg-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--mtg-dark);
  padding: 10px 16px;
  height: 80px;
}

/* LEFT (menu button) */
.mtg-header-left {
  z-index: 2;
}

/* RIGHT (if anything exists later) */
.mtg-header-right {
  z-index: 2;
}

/* CENTER LOGO (true centre, not flex-based) */
.mtg-header-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
}

/* Logo image */
.mtg-header-logo img.head-img {
  height: 36px;
  width: auto;
  display: block;
}

.mtg-brand {
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .04em;
  text-align: center;
}

.mtg-icon-button,
.mtg-header a,
.mtg-mobile-footer button,
.mtg-mobile-footer a {
  color: inherit;
  background: transparent;
  border: 0;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  color: white;
}

.mtg-icon-button {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 24px;
  transition: background .18s ease;
}

.mtg-icon-button:hover {
  background: rgba(255,255,255,.12);
}

.mtg-intro {
  text-align: center;
  padding: 28px 18px;
}

.mtg-intro a {
  color: var(--mtg-link);
}

.mtg-updated {
  display: inline-block;
  margin-top: 4px;
  font-size: 13px;
}

.mtg-desktop-search {
  position: sticky;
  top: 80px;
  z-index: 30;
  background: var(--mtg-panel);
  padding: 14px;
  box-shadow: 0 0 10px rgba(0,0,0,.12);
}

.mtg-search {
  display: grid;
  grid-template-columns: 48px 1fr 70px 48px;
  max-width: 1100px;
  margin: auto;
}

.mtg-search input,
.mtg-search button,
.mtg-search output {
  height: 44px;
  border: 0;
  background: #fff;
  color: #555;
}

.mtg-search input {
  width: 100%;
  padding: 0 14px;
  outline: 0;
}

.mtg-search button {
  font-size: 28px;
  cursor: pointer;
}

.mtg-search button:first-child {
  border-radius: 6px 0 0 6px;
}

.mtg-search button:last-child {
  border-radius: 0 6px 6px 0;
}

.mtg-search output {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #777;
  font-size: 13px;
}

.mtg-content {
  max-width: 1100px;
  margin: 24px auto 100px;
  background: #fff;
  padding: 18px 5%;
  box-shadow: 0 0 10px rgba(0,0,0,.12);
}

.mtg-section {
  margin-bottom: 48px;
}

.mtg-sticky-title {
  position: sticky;
  top: 145px;
  z-index: 5;
  min-height: 70px;
  margin: 36px -5% 24px;
  padding: 8px 5%;
  background: var(--mtg-bg);
  color: #555;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 800;
}

.mtg-sticky-title span {
  font-size: 13px;
  font-weight: 400;
}

.mtg-lead {
  font-size: 1.12rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.mtg-subsection {
  padding-top: 12px;
}

.mtg-note,
.mtg-callout {
  border-left: 5px solid var(--mtg-accent);
  background: #fff9e8;
  padding: 12px 16px;
  margin: 18px 0;
}

.mtg-contact {
  background: #f4f4f4;
  padding: 12px 16px;
  border-radius: 8px;
}

.mtg-content img {
  max-width: 100%;
  height: auto;
}

.mtg-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: .95rem;
}

.mtg-content th,
.mtg-content td {
  border: 1px solid #ddd;
  padding: 10px;
  vertical-align: top;
}

.mtg-content th {
  background: #f4f4f4;
  text-align: left;
}

.mtg-content a {
  color: var(--mtg-link);
}

.mtg-highlight {
  background: #ffe46b;
  padding: 0 .08em;
}

.mtg-highlight.current {
  background: orange;
}

.mtg-menu[hidden] {
  display: none;
}

.mtg-menu {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.mtg-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  border: 0;
  cursor: pointer;
  backdrop-filter: blur(3px);
}

.mtg-menu-panel {
  position: relative;
  width: min(410px, 92vw);
  height: 100%;
  overflow-y: auto;
  background: #ffffff;
  color: #333;
  box-shadow: 0 0 28px rgba(0,0,0,.45);
  padding: 0;
  display: flex;
  flex-direction: column;
}

.mtg-menu-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--mtg-dark);
  color: #fff;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mtg-menu-header strong,
.mtg-menu-header span {
  display: block;
}

.mtg-menu-header span {
  font-size: 13px;
  opacity: .85;
}

.mtg-menu-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.mtg-menu-filter {
  padding: 14px;
  background: #f7f7f7;
  border-bottom: 1px solid #e6e6e6;
}

.mtg-menu-filter input {
  width: 100%;
  border: 1px solid #d5d5d5;
  border-radius: 10px;
  padding: 12px 14px;
  outline: 0;
  font-size: 15px;
}

.mtg-menu-filter input:focus {
  border-color: var(--mtg-accent);
  box-shadow: 0 0 0 3px rgba(247,190,57,.25);
}

.mtg-menu-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid #e6e6e6;
}

.mtg-menu-actions a,
.mtg-menu-actions button {
  display: block;
  text-align: center;
  padding: 9px 10px;
  border: 1px solid #ddd;
  border-radius: 9px;
  background: #fff;
  color: #333;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.mtg-menu-actions a:hover,
.mtg-menu-actions button:hover {
  border-color: var(--mtg-accent);
}

.mtg-menu-list {
  padding: 8px 0 28px;
}

.mtg-menu-item {
  border-bottom: 1px solid #eee;
}

.mtg-menu-item[hidden] {
  display: none;
}

.mtg-menu-link {
  position: relative;
  display: block;
  padding: 14px 18px;
  color: #333;
  text-decoration: none;
  transition: background .18s ease, color .18s ease;
}

.mtg-menu-link:hover {
  background: #fff8e1;
}

.mtg-menu-link strong,
.mtg-menu-link span {
  display: block;
}

.mtg-menu-link span {
  margin-top: 2px;
  font-size: 13px;
  color: #666;
}

.mtg-menu-subheadings {
  padding: 0 18px 12px 32px;
}

.mtg-menu-subheadings a {
  display: block;
  color: #555;
  text-decoration: none;
  font-size: 13px;
  padding: 5px 0;
  border-left: 2px solid #eee;
  padding-left: 10px;
}

.mtg-menu-subheadings a:hover {
  color: #111;
  border-left-color: var(--mtg-accent);
}

.mtg-mobile-footer {
  display: none;
}

@media (max-width: 768px) {
  html {
    scroll-padding-top: 75px;
  }

  .mtg-header {
    padding: 10px 14px;
  }

  .mtg-brand {
    font-size: 14px;
  }

  .mtg-desktop-search {
    display: none;
  }

  .mtg-content {
    margin-top: 0;
    padding-bottom: 120px;
  }

  .mtg-sticky-title {
    top: 64px;
  }

  .mtg-content table {
    display: block;
    overflow-x: auto;
    font-size: 13px;
  }

  .mtg-floating-top {
    display: none;
  }

  .mtg-mobile-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: var(--mtg-footer);
    color: #fff;
    box-shadow: 0 -4px 18px rgba(0,0,0,.18);
  }

  .mtg-mobile-footer > button,
  .mtg-mobile-footer > a {
    padding: 16px 6px;
    text-align: center;
    border: 0;
    border-top: 2px solid transparent;
    font-size: 12px;
  }

  .mtg-mobile-search {
    grid-column: 1 / -1;
    padding: 14px;
    background: var(--mtg-panel);
  }

  .mtg-search {
    grid-template-columns: 44px 1fr 58px 44px;
  }
}

@media print {
  .mtg-header,
  .mtg-desktop-search,
  .mtg-mobile-footer,
  .mtg-menu,
  .mtg-floating-top {
    display: none !important;
  }

  .mtg-content {
    box-shadow: none;
    margin: 0;
    max-width: none;
  }

  .mtg-sticky-title {
    position: static;
  }
}

.mtg-anchor-alias {
  position: relative;
  top: -145px;
  visibility: hidden;
}