:root {
  --ddp-route-acid: #d9f45b;
  --ddp-route-paper: #eef2e9;
  --ddp-route-ink: #080a08;
}

html.ddp-route-morph-pending,
html.ddp-route-morph-exiting,
html.ddp-route-morph-arriving {
  overflow: hidden !important;
}

html.ddp-route-morph-pending::before {
  content: "";
  position: fixed;
  z-index: 2147483645;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.018) 3px 4px),
    var(--ddp-route-ink);
}

html.ddp-route-morph-pending.ddp-route-morph-arriving::before {
  visibility: hidden;
}

.ddp-route-morph {
  position: fixed;
  z-index: 2147483646;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  isolation: isolate;
  contain: strict;
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  color: var(--ddp-route-paper);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.ddp-route-morph__backdrop,
.ddp-route-morph__svg,
.ddp-route-morph__grain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ddp-route-morph__backdrop {
  z-index: 0;
  overflow: hidden;
  background: var(--ddp-route-ink);
  opacity: 0;
  visibility: hidden;
}

.ddp-route-morph__backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 10, 8, 0.86), rgba(8, 10, 8, 0.24) 48%, rgba(8, 10, 8, 0.76)),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(238, 242, 233, 0.035) 3px 4px),
    repeating-linear-gradient(90deg, transparent 0 95px, rgba(217, 244, 91, 0.04) 95px 96px);
}

.ddp-route-morph__backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.86) contrast(1.22) brightness(0.52) saturate(0.64);
  transform: scale(1.035);
}

.ddp-route-morph__svg {
  z-index: 2;
  overflow: visible;
  shape-rendering: geometricPrecision;
}

.ddp-route-morph__layer {
  stroke-linecap: square;
  stroke-linejoin: bevel;
  will-change: opacity;
}

.ddp-route-morph__layer.is-acid {
  fill: none;
  stroke: var(--ddp-route-acid);
  stroke-width: 2;
  stroke-dasharray: 12 7;
  stroke-opacity: 0.96;
}

.ddp-route-morph__layer.is-paper {
  fill: var(--ddp-route-paper);
  opacity: 0;
}

.ddp-route-morph__layer.is-ink {
  fill: var(--ddp-route-ink);
}

.ddp-route-morph[data-origin-shape="surface"] .ddp-route-morph__disc,
.ddp-route-morph[data-origin-shape="surface"] .ddp-route-morph__scanner,
.ddp-route-morph[data-origin-shape="surface"] .ddp-route-morph__label {
  display: none;
}

.ddp-route-morph[data-origin-shape="surface"] .ddp-route-morph__layer.is-acid {
  stroke-width: 1.5;
  stroke-dasharray: none;
}

.ddp-route-morph__disc {
  position: fixed;
  z-index: 4;
  display: block;
  overflow: hidden;
  box-sizing: border-box;
  border: 2px solid rgba(238, 242, 233, 0.9);
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 8%, rgba(238, 242, 233, 0.94) 8.5% 12%, transparent 12.5%),
    repeating-radial-gradient(circle, transparent 0 8px, rgba(217, 244, 91, 0.14) 8px 9px),
    #172013;
  box-shadow:
    inset 0 0 0 4px rgba(8, 10, 8, 0.34),
    inset 0 0 34px rgba(238, 242, 233, 0.24),
    0 0 0 1px rgba(217, 244, 91, 0.62),
    0 22px 52px rgba(0, 0, 0, 0.48);
  transform-origin: 50% 50%;
  opacity: 0;
  visibility: hidden;
}

.ddp-route-morph__disc::before,
.ddp-route-morph__disc::after {
  content: "";
  position: absolute;
  z-index: 2;
  pointer-events: none;
  border-radius: 50%;
}

.ddp-route-morph__disc::before {
  inset: 7%;
  border: 1px solid rgba(217, 244, 91, 0.5);
  background:
    linear-gradient(112deg, transparent 0 46%, rgba(238, 242, 233, 0.2) 47% 50%, transparent 51%),
    repeating-conic-gradient(from 18deg, transparent 0 12deg, rgba(217, 244, 91, 0.09) 12deg 13deg);
}

.ddp-route-morph__disc::after {
  top: 50%;
  left: 50%;
  width: 13%;
  aspect-ratio: 1;
  border: 2px solid var(--ddp-route-paper);
  background: var(--ddp-route-ink);
  box-shadow: 0 0 0 3px rgba(217, 244, 91, 0.72);
  transform: translate(-50%, -50%);
}

.ddp-route-morph__disc img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: grayscale(0.62) sepia(0.25) contrast(1.28) brightness(0.72) saturate(0.7);
  mix-blend-mode: luminosity;
}

.ddp-route-morph.has-artwork .ddp-route-morph__disc img {
  opacity: 0.92;
}

.ddp-route-morph__disc > i {
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(145deg, rgba(217, 244, 91, 0.34), transparent 38% 66%, rgba(238, 242, 233, 0.22)),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(8, 10, 8, 0.13) 3px 4px);
  mix-blend-mode: color;
}

.ddp-route-morph__scanner {
  position: fixed;
  z-index: 5;
  display: block;
  box-sizing: border-box;
  border: 1px solid rgba(217, 244, 91, 0.96);
  border-radius: 50%;
  pointer-events: none;
  box-shadow:
    0 0 0 1px rgba(8, 10, 8, 0.92),
    0 0 0 5px rgba(217, 244, 91, 0.08),
    inset 0 0 0 4px rgba(8, 10, 8, 0.42);
  opacity: 0;
  visibility: hidden;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}

.ddp-route-morph__scanner::before,
.ddp-route-morph__scanner::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
}

.ddp-route-morph__scanner::before {
  inset: -11%;
  border: 1px solid rgba(217, 244, 91, 0.72);
  border-right-color: transparent;
  border-bottom-color: transparent;
}

.ddp-route-morph__scanner::after {
  inset: 13%;
  border: 1px dashed rgba(217, 244, 91, 0.42);
}

.ddp-route-morph__scanner > i {
  position: absolute;
  inset: -18%;
  background:
    linear-gradient(var(--ddp-route-acid), var(--ddp-route-acid)) center top / 1px 16% no-repeat,
    linear-gradient(var(--ddp-route-acid), var(--ddp-route-acid)) center bottom / 1px 16% no-repeat,
    linear-gradient(90deg, var(--ddp-route-acid), var(--ddp-route-acid)) left center / 16% 1px no-repeat,
    linear-gradient(90deg, var(--ddp-route-acid), var(--ddp-route-acid)) right center / 16% 1px no-repeat;
  opacity: 0.82;
}

.ddp-route-morph__label {
  position: fixed;
  z-index: 5;
  display: grid;
  width: min(268px, calc(100vw - 36px));
  gap: 4px;
  padding: 9px 12px 10px;
  border-top: 1px solid rgba(217, 244, 91, 0.78);
  border-bottom: 1px solid rgba(238, 242, 233, 0.18);
  background: rgba(8, 10, 8, 0.84);
  box-shadow: 8px 8px 0 rgba(217, 244, 91, 0.08);
  opacity: 0;
  visibility: hidden;
}

.ddp-route-morph__label small,
.ddp-route-morph__label em {
  overflow: hidden;
  color: var(--ddp-route-acid);
  font-size: 7px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.16em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.ddp-route-morph__label b {
  overflow: hidden;
  color: var(--ddp-route-paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(12px, 1.1vw, 16px);
  font-weight: 800;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ddp-route-morph__label em {
  color: rgba(238, 242, 233, 0.55);
  letter-spacing: 0.11em;
}

.ddp-route-morph__shutter {
  position: fixed;
  z-index: 3;
  display: block;
  overflow: hidden;
  box-sizing: border-box;
  border-top: 1px solid rgba(238, 242, 233, 0.22);
  border-bottom: 1px solid rgba(217, 244, 91, 0.3);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(238, 242, 233, 0.035) 3px 4px),
    linear-gradient(90deg, #050705, var(--ddp-route-ink) 64%, #11150f);
  box-shadow:
    inset 0 0 0 1px rgba(238, 242, 233, 0.08),
    inset 0 0 42px rgba(0, 0, 0, 0.42);
  opacity: 0;
  visibility: hidden;
  transform-origin: right center;
  will-change: transform, opacity;
}

.ddp-route-morph__shutter::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(217, 244, 91, 0.06), transparent 18%),
    repeating-linear-gradient(90deg, transparent 0 63px, rgba(238, 242, 233, 0.025) 63px 64px);
}

.ddp-route-morph__shutter-trace {
  position: fixed;
  z-index: 4;
  display: block;
  pointer-events: none;
  background: var(--ddp-route-acid);
  box-shadow:
    -4px 0 0 rgba(8, 10, 8, 0.78),
    4px 0 0 rgba(238, 242, 233, 0.12);
  opacity: 0;
  visibility: hidden;
  will-change: transform, opacity;
}

.ddp-route-morph__grain {
  z-index: 6;
  pointer-events: none;
  opacity: 0.18;
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.07) 3px 4px),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(217, 244, 91, 0.025) 79px 80px);
  mix-blend-mode: soft-light;
}

.ddp-route-morph__grain::before,
.ddp-route-morph__grain::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(217, 244, 91, 0.16);
  clip-path: polygon(0 0, 11% 0, 11% 1px, 89% 1px, 89% 0, 100% 0, 100% 100%, 89% 100%, 89% calc(100% - 1px), 11% calc(100% - 1px), 11% 100%, 0 100%);
}

.ddp-route-morph__grain::after {
  inset: 0;
  border: 0;
  background:
    linear-gradient(90deg, var(--ddp-route-acid) 0 42px, transparent 42px) 18px 18px / 160px 2px no-repeat,
    linear-gradient(90deg, transparent calc(100% - 44px), var(--ddp-route-acid) calc(100% - 44px)) right 18px bottom 18px / 160px 2px no-repeat;
  opacity: 0.82;
}

.ddp-route-morph__loading {
  position: absolute;
  z-index: 7;
  inset: 0;
  display: none;
  align-content: center;
  justify-items: center;
  gap: 28px;
  padding: 36px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.ddp-route-morph.is-loading .ddp-route-morph__loading {
  display: grid;
}

.ddp-route-morph__loading-scene {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  align-items: center;
  gap: 44px;
  width: min(620px, 100%);
  padding: 40px 12px;
  border-block: 1px solid rgba(238, 242, 233, 0.16);
}

.ddp-route-morph__loading-machine {
  position: relative;
  display: grid;
  align-content: center;
  gap: 7px;
  height: 142px;
  padding: 20px;
  border: 1px solid rgba(238, 242, 233, 0.2);
  background: linear-gradient(145deg, #20271c, #0c100d 62%);
  box-shadow: inset 0 0 0 5px #10160f, 0 12px 28px rgba(0, 0, 0, 0.3);
}

.ddp-route-morph__loading-machine::before,
.ddp-route-morph__loading-machine::after {
  content: "";
  position: absolute;
  inset: -5px;
  pointer-events: none;
  border: 2px solid var(--ddp-route-acid);
  clip-path: polygon(0 0, 14% 0, 14% 2%, 2% 2%, 2% 16%, 0 16%);
}

.ddp-route-morph__loading-machine::after {
  transform: rotate(180deg);
}

.ddp-route-morph__loading-blade {
  display: block;
  height: 12px;
  background: linear-gradient(90deg, #7c9060, #d9f45b 48%, #697750);
  border-top: 1px solid rgba(238, 242, 233, 0.4);
  opacity: 0.58;
}

.ddp-route-morph__loading-copy {
  min-width: 0;
}

.ddp-route-morph__loading-kicker {
  display: block;
  margin-bottom: 14px;
  color: var(--ddp-route-acid);
  font: 10px/1.5 ui-monospace, Consolas, monospace;
  letter-spacing: 0.12em;
}

.ddp-route-morph__loading-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: clamp(22px, 2.1vw, 32px);
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ddp-route-morph__loading [role="status"] {
  display: block;
  margin-top: 14px;
  color: #b8bfb1;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.ddp-route-morph__loading-signal {
  display: block;
  overflow: hidden;
  margin-top: 20px;
  width: 100%;
  height: 2px;
  background: rgba(238, 242, 233, 0.12);
}

.ddp-route-morph__loading-signal i {
  display: block;
  width: 28%;
  height: 100%;
  background: var(--ddp-route-acid);
}

.ddp-route-morph__loading button {
  padding: 8px 15px;
  border: 1px solid rgba(238, 242, 233, 0.28);
  border-radius: 3px;
  background: transparent;
  color: var(--ddp-route-paper);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.ddp-route-morph__loading button:hover {
  border-color: var(--ddp-route-acid);
  background: rgba(217, 244, 91, 0.08);
}

.ddp-route-morph__loading button:focus-visible {
  outline: 2px solid var(--ddp-route-acid);
  outline-offset: 4px;
}

.ddp-route-morph__loading button:active {
  background: rgba(217, 244, 91, 0.2);
}

.ddp-route-morph__loading button:disabled {
  opacity: 0.4;
  cursor: default;
}

@media (max-width: 600px) {
  .ddp-route-morph__label {
    width: min(218px, calc(100vw - 28px));
    padding: 7px 9px 8px;
  }

  .ddp-route-morph__label small,
  .ddp-route-morph__label em {
    font-size: 6px;
  }

  .ddp-route-morph__grain::before {
    inset: 10px;
  }

  .ddp-route-morph__shutter {
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  }
}

@media (prefers-reduced-motion: reduce) {
  html.ddp-route-morph-pending::before,
  .ddp-route-morph:not(.is-loading) {
    display: none !important;
  }

  html.ddp-route-morph-arriving {
    overflow: auto !important;
  }

  .ddp-route-morph__loading-signal i {
    transform: none !important;
  }
}
