.mc-lv-popup {
  --mc-lv-max: calc(100dvh - 12dvh);
  position: fixed;
  inset: 6dvh 0 auto 0;
  width: min(640px, 100vw - 32px);
  max-width: none;
  height: auto;
  max-height: var(--mc-lv-max);
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mc-ink);
  overflow: visible;
}
.mc-lv-popup::backdrop {
  background: color-mix(in srgb, var(--mc-heading) 55%, transparent);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.mc-lv-popup[open] {
  animation: mc-lv-in 260ms cubic-bezier(0.23, 1, 0.32, 1);
}
.mc-lv-popup[open]::backdrop {
  animation: mc-lv-fade 260ms cubic-bezier(0.23, 1, 0.32, 1);
}

html:has(.mc-lv-popup[open]) {
  overflow: hidden;
}

@keyframes mc-lv-in {
  from {
    transform: translateY(12px) scale(0.98);
    opacity: 0;
  }
}
@keyframes mc-lv-fade {
  from {
    opacity: 0;
  }
}
.mc-lv-panel {
  display: flex;
  flex-direction: column;
  max-height: var(--mc-lv-max);
  overflow: hidden;
  border-radius: 8px;
  background: var(--mc-white);
  box-shadow: 0 30px 80px -30px color-mix(in srgb, var(--mc-heading) 55%, transparent);
}

.mc-lv-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 32px 8px;
}

.mc-lv-title {
  margin: 0;
  font-family: var(--mc-font-display);
  font-weight: 600;
  font-size: 24px;
  line-height: 30px;
  color: var(--mc-heading);
}

.mc-lv-close {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid #e3e5e9;
  border-radius: 50%;
  background: var(--mc-white);
  color: var(--mc-heading);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.mc-lv-close svg {
  width: 16px;
  height: 16px;
}
.mc-lv-close:focus-visible {
  outline: 2px solid var(--mc-red);
  outline-offset: 2px;
}

@media (hover: hover) {
  .mc-lv-close:hover {
    background: var(--mc-heading);
    border-color: var(--mc-heading);
    color: var(--mc-white);
  }
}
.mc-lv-scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 32px 40px;
}

.mc-lv-lede {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--mc-ink);
}

.mc-lv-kind {
  display: inline-flex;
  justify-self: start;
  padding: 4px;
  border: 1px solid #e3e5e9;
  border-radius: 999px;
  background: var(--mc-section-alt-bg);
}
.mc-lv-kind button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--mc-muted);
  font-family: var(--mc-font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.15s ease, box-shadow 0.2s ease;
}
.mc-lv-kind button svg {
  width: 15px;
  height: 15px;
}
.mc-lv-kind button[aria-pressed=true] {
  background: var(--mc-white);
  color: var(--mc-heading);
  box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--mc-heading) 25%, transparent);
}
.mc-lv-kind button:focus-visible {
  outline: 2px solid var(--mc-red);
  outline-offset: 2px;
}

@media (hover: hover) {
  .mc-lv-kind button[aria-pressed=false]:hover {
    color: var(--mc-heading);
  }
}
.mc-lv-stair {
  display: grid;
  gap: 4px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mc-lv-stair[hidden] {
  display: none;
}

.mc-lv-lvl {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding-right: 12px;
  color: var(--mc-heading);
  text-decoration: none;
  cursor: pointer;
}

.mc-lv-lvl-bar {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  width: calc(36px + (100% - 36px) * (var(--mc-lv-n) + 2) / 10);
  border-radius: 2px;
  background: color-mix(in srgb, var(--mc-blue) calc(6% + var(--mc-lv-n) * 4%), var(--mc-white));
  transition: background-color 0.2s ease, width 0.3s ease;
}

.mc-lv-lvl-n {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-family: var(--mc-font-display);
  font-weight: 700;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.mc-lv-lvl-txt {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  min-width: 0;
}

.mc-lv-lvl-name {
  font-family: var(--mc-font-body);
  font-weight: 600;
  font-size: 14px;
}

.mc-lv-lvl-stage {
  font-size: 12px;
  color: var(--mc-muted);
}

.mc-lv-lvl[aria-expanded=true] {
  color: var(--mc-white);
}
.mc-lv-lvl[aria-expanded=true] .mc-lv-lvl-bar {
  width: 100%;
  background: var(--mc-heading);
}
.mc-lv-lvl[aria-expanded=true] .mc-lv-lvl-stage {
  color: color-mix(in srgb, var(--mc-white) 70%, transparent);
}

@media (hover: hover) {
  .mc-lv-lvl:not([aria-expanded=true]):hover .mc-lv-lvl-bar {
    background: color-mix(in srgb, var(--mc-blue) 30%, var(--mc-white));
  }
}
.mc-lv-more {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows 0.3s ease, visibility 0s linear 0.3s;
}
.mc-lv-more.is-open {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows 0.3s ease;
}
.mc-lv-more > div {
  min-height: 0;
  overflow: hidden;
}

.mc-lv-card {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 16px 16px 16px 48px;
  border: 1px solid #e3e5e9;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--mc-white);
}

.mc-lv-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  color: var(--mc-muted);
}

.mc-lv-terrain {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--mc-heading);
}

.mc-lv-diff {
  display: inline-block;
  width: 11px;
  height: 11px;
  flex: none;
}
.mc-lv-diff--green {
  border-radius: 50%;
  background: #2e9e4f;
}
.mc-lv-diff--blue {
  background: #1b62c4;
}

.mc-lv-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--mc-ink);
}

.mc-lv-unlock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--mc-red) 10%, var(--mc-white));
  color: var(--mc-red);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.mc-lv-unlock svg {
  width: 14px;
  height: 14px;
}

@media (hover: hover) {
  .mc-lv-unlock:hover {
    text-decoration: underline;
  }
}
@media (max-width: 640px) {
  .mc-lv-popup {
    --mc-lv-max: calc(100dvh - 32px);
    inset: 16px 0 auto 0;
  }
  .mc-lv-head {
    padding: 20px 20px 8px;
  }
  .mc-lv-title {
    font-size: 20px;
    line-height: 26px;
  }
  .mc-lv-scroll {
    padding-inline: 20px;
  }
  .mc-lv-kind {
    display: flex;
    justify-self: stretch;
  }
  .mc-lv-kind button {
    flex: 1;
    padding: 0 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mc-lv-popup[open],
  .mc-lv-popup[open]::backdrop {
    animation: none;
  }
  .mc-lv-lvl-bar,
  .mc-lv-more,
  .mc-lv-more.is-open {
    transition: none;
  }
}
