.roadmap {
  --dim: #b4cad5;
  --panel: #162536;
  --edge: #344b5d;
  color: #f5fbff;
  background: var(--night);
  border: 1px solid #334b59;
  border-top: 3px solid var(--cyan);
}
.roadmap-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 13px 22px;
  padding: 19px 21px;
}
.roadmap-head h2 { font-size: 27px; }
.roadmap-head p { margin-top: 5px; color: var(--dim); font-size: 13px; }
.roadmap .mk-fa { margin-right: 4px; }
.mk-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid var(--action);
  border-radius: 5px;
  background: var(--action);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.mk-button:hover { filter: brightness(1.09); }
.mk-button:disabled { opacity: .55; }
.mk-button.secondary { background: transparent; color: var(--action); }
.roadmap .mk-button { background: #74e7d6; border-color: #74e7d6; color: #112e32; }
.roadmap .mk-button.secondary { color: #def4f4; background: #152635; border-color: #587384; }
.roadmap .mk-button:focus-visible, .roadmap a:focus-visible, .roadmap button:focus-visible { outline-color: #fff; }
.roadmap-metrics { display: grid; grid-template-columns: 1.4fr .6fr .7fr; gap: 1px; background: var(--edge); border-block: 1px solid var(--edge); }
.roadmap-metric {
  min-width: 0;
  padding: 10px 16px;
  background: #1a2a3c;
  color: var(--dim);
  font-size: 12px;
}
.roadmap-metric strong { display: block; color: #f6fbff; font-size: 19px; line-height: 1.35; }
.roadmap-metric .mk-fa { color: var(--road); }
.roadmap progress {
  width: 100%;
  max-width: 240px;
  height: 5px;
  border: 0;
  display: block;
  margin-top: 5px;
  background: #395366;
}
.roadmap progress::-webkit-progress-bar { background: #395366; }
.roadmap progress::-webkit-progress-value { background: var(--road); }
.roadmap progress::-moz-progress-bar { background: var(--road); }

.world-map {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 355px;
  aspect-ratio: 2.12;
  overflow: hidden;
  background: #0b1c2e;
}
.world-map > img, .world-map > canvas, .world-map::after { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.world-map > img { object-fit: fill; z-index: -3; }
.world-map::after { content: ""; z-index: -2; background: linear-gradient(0deg, #0818274f, transparent 26%, transparent 74%, #08182757); }
.world-map > canvas { z-index: -1; }
.world-marker {
  --world-color: #7de3af;
  position: absolute;
  top: var(--y);
  left: var(--x);
  display: grid;
  justify-items: center;
  gap: 6px;
  transform: translate(-50%, -27px);
  min-width: 61px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  text-align: center;
}
.color-cyan { --world-color: #76e6f5; }
.color-orange { --world-color: #ffba71; }
.color-violet { --world-color: #dbb8ff; }
.color-amber { --world-color: #ffe190; }
.world-marker:hover { z-index: 2; }
.world-marker:hover .world-name { background: #203644; }
.world-token {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 2px solid var(--world-color);
  border-radius: 50%;
  background: #142535;
  color: var(--world-color);
  font: 700 20px/1 Georgia, serif;
  box-shadow: 0 3px 13px #04131eab;
}
.world-token .mk-fa { margin: 0; }
.world-marker.is-next .world-token { background: var(--world-color); color: #142535; box-shadow: 0 0 0 6px #fff4, 0 4px 20px #00171f; }
.world-marker.is-done .world-token { background: #d4fff3; color: #174738; }
.world-marker.is-side .world-token { border-style: dashed; }
.world-name {
  display: grid;
  gap: 2px;
  min-width: 104px;
  padding: 6px 9px;
  border: 1px solid #91aeb466;
  border-radius: 6px;
  background: #0d1e2ef2;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
}
.world-name small { color: var(--world-color); font-size: 10px; font-weight: 700; }
.map-legend {
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: auto;
  max-width: calc(100% - 24px);
  display: flex;
  gap: 12px;
  padding: 5px 8px;
  border-radius: 4px;
  background: #0b1d2eea;
  color: #e4f4f4;
  font-size: 11px;
}
.map-legend span::before {
  content: "";
  display: inline-block;
  vertical-align: middle;
  width: 17px;
  margin-right: 5px;
  border-top: 2px solid var(--road);
}
.roadmap-bottom { display: grid; grid-template-columns: 1.45fr 1fr; gap: 1px; background: var(--edge); border-top: 1px solid var(--edge); }
.roadmap-bottom > section { min-width: 0; padding: 15px 18px; background: var(--panel); }
.roadmap-bottom h3 { font-size: 17px; }
.roadmap-bottom p { margin: 4px 0 11px; color: var(--dim); font-size: 13px; }
.roadmap-bottom .mk-button { min-height: 36px; font-size: 13px; }
.daily-plan { margin-bottom: 11px; color: #dfedf5; font-size: 13px; }
.daily-plan summary { width: fit-content; cursor: pointer; }
.daily-plan ol { margin: 6px 0 8px; padding-left: 18px; }
.badge-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.badge-list span { padding: 4px 7px; border: 1px solid #566e7e; border-radius: 4px; font-size: 11px; color: #c3d7df; }
.badge-list .is-earned { border-color: #f3d28b; color: #ffdf96; }
.world-body { --world-color: #7de3af; }
.world-body.color-cyan { --world-color: #76e6f5; }
.world-body.color-orange { --world-color: #ffba71; }
.world-body.color-violet { --world-color: #dbb8ff; }
.world-body.color-amber { --world-color: #ffe190; }

.map-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.map-controls .mk-button { min-height: 38px; padding: 6px 9px; font-size: 13px; }
.roadmap .map-controls button:disabled { opacity: 1; background: #274253; color: #e0f2f3; border-color: #4d727f; }
.roadmap .world-marker.is-side .world-token { border-style: solid; border-color: #7a9da5; }
.roadmap .world-marker.is-side .world-name { border-color: #617f8a; }
.roadmap .station-marker.is-side .world-token { border-style: dashed; }
.sub-map {
  min-height: 332px;
  aspect-ratio: 1.87;
}
.sub-map .world-marker { transform: translate(-50%, -20px); }
.sub-map .world-token { width: 40px; height: 40px; font-size: 15px; }
.sub-map .world-name { min-width: 0; width: max-content; max-width: 134px; padding: 6px 7px; }
.sub-map .world-name small { white-space: normal; line-height: 1.2; }
.sub-map > img { object-fit: fill; }
.sub-map::after { background: linear-gradient(0deg,#0818274a,transparent 35%,transparent 80%,#08182748); }
.sub-map.terrain-forest > img { width: 300%; height: 235%; max-width: none; left: -7%; top: -70%; }
.sub-map.terrain-ridge > img { width: 325%; height: 240%; max-width: none; left: -209%; top: -15%; }
.roadmap-bottom .mk-topic-link { display: inline-block; margin-top: 8px; color: #97e9df; font-size: 12px; }
.plan-note { color: #ecc994 !important; }
.mk-dialog {
  width: min(580px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 22px;
  border: 1px solid #93a5aa;
  border-top: 4px solid var(--cyan);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  overflow-y: auto;
}
.mk-dialog::backdrop { background: #111e2bbf; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.dialog-head h2 { font-size: 24px; }
.dialog-head button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 5px; background: #f6f8f8; font: 22px/1 Arial, sans-serif; }
.mk-dialog small, .mk-dialog .tip { color: var(--muted); }
.mk-dialog p + p { margin-top: 8px; }
.mk-dialog form { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid > label { display: grid; gap: 4px; font-weight: 700; font-size: 14px; }
.mk-dialog input:not([type=radio]):not([type=checkbox]), .mk-dialog select {
  min-width: 0;
  padding: 7px;
  min-height: 41px;
  border: 1px solid #a8bec3;
  border-radius: 4px;
  width: 100%;
  background: #fff;
  color: var(--text);
}
.mk-dialog fieldset { display: grid; gap: 6px; padding: 0; margin: 0; border: 0; min-width: 0; }
.mk-dialog legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.mk-dialog fieldset label { padding: 7px 9px; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.mk-dialog label:has(input:checked) { background: #eaf7f6; border-color: #6faaa6; }
.mk-dialog input { accent-color: var(--action); }
.dialog-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 13px; }
.mk-dialog form .dialog-actions { margin-top: 0; }
.mk-feedback { padding: 10px 12px; background: #eaf8f4; border-left: 3px solid var(--action); }
.mk-feedback.warn { background: #fff3e6; border-left-color: #b15020; }
.mk-gain { color: #005f61; font: 700 29px/1.25 Arial,sans-serif; animation: rise .45s ease-out; }
@keyframes rise { from { transform: translateY(7px); opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .mk-gain { animation: none; } }
@media (max-width: 900px) {
  .world-name { min-width: 80px; font-size: 12px; padding-inline: 5px; }
}
@media (max-width: 550px) {
  .roadmap-head { padding: 13px; }
  .roadmap-head h2 { font-size: 23px; }
  .roadmap-metric { padding: 8px 7px; font-size: 10px; }
  .roadmap-metric strong { font-size: 15px; }
  .world-map { aspect-ratio: 1; min-height: 330px; }
  .world-marker { transform: translate(-50%, -17px); }
  .world-token { width: 34px; height: 34px; font-size: 15px; }
  .world-name { min-width: 61px; font-size: 10px; }
  .world-name small { font-size: 9px; }
  .roadmap-bottom { grid-template-columns: 1fr; }
  .mk-dialog { padding: 15px; }
}

@media(max-width: 550px) {
  .sub-map { min-height: 280px; }
  .sub-map .world-token { width: 33px; height: 33px; font-size: 13px; }
  .sub-map .world-marker { transform: translate(-50%,-16px); }
  .sub-map .world-name { width: auto; max-width: 84px; padding: 4px 5px; }
  .map-controls { gap: 5px; }
}
