/* ============================================================
   Advanced Duels wiki theme layer
   - Only overrides the Material theme, keeps everything fast
   - Change the brand here: --ad-green and friends
   ============================================================ */

:root {
  --ad-green: #43a047;
  --ad-green-bright: #66bb6a;
  --ad-green-dark: #1b5e20;
  --ad-radius: 12px;
  --ad-content-max: 1180px;
  --ad-card-border: rgba(102, 187, 106, 0.22);
  --ad-code-bg: rgba(102, 187, 106, 0.07);
}

[data-md-color-scheme="slate"] {
  --ad-code-bg: rgba(102, 187, 106, 0.09);
  --ad-img-border: rgba(255, 255, 255, 0.12);
  --ad-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

[data-md-color-scheme="default"] {
  --ad-img-border: rgba(0, 0, 0, 0.12);
  --ad-shadow: 0 8px 28px rgba(27, 94, 32, 0.12);
}

/* ---------- Comfortable reading width ---------- */
.md-grid {
  max-width: var(--ad-content-max);
}

/* ---------- Headings & rhythm ---------- */
.md-typeset h1 {
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 0.6em;
}

.md-typeset h2 {
  font-weight: 700;
  margin-top: 1.8em;
  padding-bottom: 0.3em;
  border-bottom: 2px solid var(--ad-card-border);
}

.md-typeset h3 {
  font-weight: 650;
  margin-top: 1.4em;
}

.md-typeset p,
.md-typeset li {
  line-height: 1.7;
}

/* ---------- Links ---------- */
.md-typeset a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.md-typeset a:hover {
  text-decoration-thickness: 2px;
}

/* ---------- Hero ---------- */
.ad-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--ad-card-border);
  border-radius: calc(var(--ad-radius) + 4px);
  padding: 2.4rem 2rem;
  margin: 0.4rem 0 1.8rem;
  background:
    radial-gradient(600px 220px at 85% -40px, rgba(102, 187, 106, 0.16), transparent 70%),
    radial-gradient(500px 200px at 8% 120%, rgba(102, 187, 106, 0.1), transparent 70%);
}

.ad-hero__inner {
  display: flex;
  gap: 1.4rem;
  align-items: center;
}

.ad-hero__logo {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ad-green-dark), var(--ad-green));
  box-shadow: var(--ad-shadow);
}

.ad-hero__logo svg {
  width: 44px;
  height: 44px;
}

.ad-hero h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.15;
}

.ad-hero__tagline {
  margin: 0.4rem 0 0;
  font-size: 1.02rem;
  opacity: 0.85;
  max-width: 44rem;
}

.ad-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.ad-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--ad-card-border);
  background: var(--ad-code-bg);
  white-space: nowrap;
}

.ad-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

/* ---------- Buttons ---------- */
.md-typeset .md-button {
  border-radius: 9px;
  font-weight: 650;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.md-typeset .md-button:hover {
  transform: translateY(-1px);
}

.md-typeset .md-button--primary {
  background: linear-gradient(135deg, var(--ad-green-dark), var(--ad-green));
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(67, 160, 71, 0.35);
}

/* ---------- Feature cards ---------- */
.md-typeset .grid.cards > ul > li {
  border: 1px solid var(--ad-card-border);
  border-radius: var(--ad-radius);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.md-typeset .grid.cards > ul > li:hover {
  transform: translateY(-3px);
  border-color: var(--ad-green);
  box-shadow: var(--ad-shadow);
}

.md-typeset .grid.cards .card-icon {
  font-size: 1.7rem;
  line-height: 1;
}

.md-typeset .grid.cards strong {
  font-size: 1.02rem;
}

/* ---------- Tables ---------- */
.md-typeset__table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
}

.md-typeset table:not([class]) {
  border-radius: var(--ad-radius);
  overflow: hidden;
  font-size: 0.86rem;
}

.md-typeset table:not([class]) th {
  background: var(--ad-code-bg);
  font-weight: 700;
  white-space: nowrap;
}

.md-typeset table:not([class]) td,
.md-typeset table:not([class]) th {
  padding: 0.55em 0.9em;
}

.md-typeset table:not([class]) tr:hover td {
  background: var(--ad-code-bg);
}

/* ---------- Code ---------- */
.md-typeset code {
  border-radius: 6px;
  padding: 0.1em 0.4em;
}

.md-typeset pre > code {
  border: 1px solid var(--ad-card-border);
  border-radius: 10px;
  padding: 0.9em 1em;
  line-height: 1.65;
}

/* ---------- Images, GIFs & videos ---------- */
.md-typeset img,
.md-typeset video {
  border-radius: var(--ad-radius);
  border: 1px solid var(--ad-img-border);
  box-shadow: var(--ad-shadow);
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
}

/* ---------- Footer extra strip ---------- */
.ad-footer-extra {
  border-top: 1px solid var(--ad-card-border);
  padding: 1rem 0 0.4rem;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  align-items: center;
  justify-content: space-between;
}

.ad-footer-extra nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
}

.ad-footer-extra a {
  font-weight: 600;
}

/* ---------- Active nav indicator ---------- */
.md-nav__link--active {
  font-weight: 650;
}

/* ---------- Motion discipline ---------- */
@media (prefers-reduced-motion: reduce) {
  .md-typeset .md-button,
  .md-typeset .grid.cards > ul > li {
    transition: none;
  }

  .md-typeset .md-button:hover,
  .md-typeset .grid.cards > ul > li:hover {
    transform: none;
  }
}

/* ---------- Mobile ---------- */
@media screen and (max-width: 600px) {
  .ad-hero {
    padding: 1.6rem 1.2rem;
  }

  .ad-hero__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .ad-hero h1 {
    font-size: 1.6rem;
  }

  .md-typeset table:not([class]) {
    font-size: 0.8rem;
  }
}
