/* The public opening continues the fitting mirror into My space. */
.journey-companion:has(.my-world[data-mode="home"]) :is(.my-header, main) {
  width: min(1280px, calc(100% - 112px));
}

.journey-companion:has(.my-world[data-mode="home"]) .home-heading {
  padding-block: clamp(.9rem, 3dvh, 1.8rem) clamp(.6rem, 2dvh, 1.1rem);
  align-items: flex-end;
  gap: .75rem 1.25rem;
}

.journey-companion:has(.my-world[data-mode="home"]) .home-heading h1 {
  color: var(--journey-ink, var(--ink));
  font-size: var(--journey-heading, clamp(2.15rem, min(5.45vw, 9.5dvh), 4.35rem));
}

.my-world[data-mode="home"] {
  gap: clamp(1rem, 5vw, 4.25rem);
}

.my-world[data-mode="home"] .friend-heading {
  padding: 0;
  margin: 0 0 .35rem;
}

.my-world[data-mode="home"] .companion-stage {
  width: min(100%, 28rem, max(10rem, 57dvh));
  max-width: none;
  margin: 0 auto;
  overflow: visible;
}

.my-world[data-mode="home"] .companion-stage[data-space="quiet-corner"]::before {
  inset: 6% 1% 3%;
  border: 1px solid var(--journey-rule, var(--line));
  border-radius: 48% 48% 44% 44%;
  background: radial-gradient(
    ellipse at 48% 40%,
    var(--journey-paper, var(--paper)) 10%,
    var(--journey-canvas, var(--canvas)) 57%,
    color-mix(in srgb, var(--journey-canvas, var(--canvas)) 68%, var(--journey-clay, var(--clay)))
  );
}

.my-world[data-mode="home"] .friend-slogan {
  margin: .3rem 0 .35rem;
}

.my-world[data-mode="home"] .friend-message {
  min-height: 0;
  margin-block: .25rem;
}

.my-world[data-mode="home"] .world-panel {
  padding-block-start: clamp(.55rem, 2dvh, 1.5rem);
}

#panel-home h2 {
  color: var(--journey-ink, var(--ink));
  font-size: clamp(1.65rem, min(4vw, 6.1dvh), 2.85rem);
  line-height: 1.08;
  letter-spacing: -.035em;
  margin-bottom: .45rem;
}

#panel-home .panel-intro {
  margin-block-end: .7rem;
}

#panel-home .world-door {
  border-radius: 0;
  border-bottom: 1px solid var(--journey-rule, var(--line));
  margin: 0;
  min-height: 3.6rem;
  padding: .55rem .15rem;
  background: transparent;
  transform: none;
  transition: none;
}

#panel-home .wardrobe-door {
  border-top: 1px solid var(--journey-rule, var(--line));
}

#panel-home .world-door > img,
#panel-home .door-miniatures {
  width: clamp(2.1rem, 7vw, 4rem);
  height: clamp(2.1rem, 7vw, 3.25rem);
}

#panel-home .world-door > img {
  object-fit: contain;
  border-radius: .45rem;
}

#panel-home .door-miniatures img {
  width: 58%;
  height: auto;
}

#panel-home .door-miniatures img + img {
  margin-left: -.35rem;
}

#panel-home .world-door strong {
  margin: 0;
}

#panel-home .world-door:is(:hover, :focus-visible) strong {
  text-decoration: underline;
  text-underline-offset: .24em;
}

@media (max-width: 1050px) {
  .journey-companion:has(.my-world[data-mode="home"]) :is(.my-header, main) {
    width: calc(100% - 48px);
  }
}

@media (max-width: 760px) {
  .journey-companion:has(.my-world[data-mode="home"]) :is(.my-header, main) {
    width: calc(100% - 40px);
  }

  .journey-companion:has(.my-world[data-mode="home"]) .my-header {
    gap: .15rem .65rem;
    padding-block-start: .2rem;
  }

  .journey-companion:has(.my-world[data-mode="home"]) :is(.my-brand, .journey) {
    padding-block: 0;
  }

  .journey-companion:has(.my-world[data-mode="home"]) .my-brand {
    min-height: 44px;
  }

  .journey-companion:has(.my-world[data-mode="home"]) .journey {
    flex-wrap: wrap;
  }

  .journey-companion:has(.my-world[data-mode="home"]) .journey button {
    padding-inline: .45rem;
  }

  .my-world[data-mode="home"] .companion-stage {
    width: min(100%, 20rem, max(9.5rem, 47dvh));
  }
}

@media (max-width: 620px) {
  .journey-companion:has(.my-world[data-mode="home"]) .home-heading {
    display: block;
    padding-block: .75rem .5rem;
  }

  .journey-companion:has(.my-world[data-mode="home"]) .home-heading h1 {
    font-size: clamp(1.85rem, 8.2vw, 2.5rem);
  }

  .journey-companion:has(.my-world[data-mode="home"]) .save-state {
    max-width: none;
    margin-block-start: .2rem;
    text-align: start;
  }
}

@media (max-width: 620px) and (max-height: 570px), (min-width: 621px) and (max-height: 450px) {
  .my-world[data-mode="home"] .friend-column {
    display: grid;
    align-items: center;
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
    grid-template-areas:
      "hello portrait"
      "slogan portrait"
      "message message"
      "status status"
      "space space";
    gap: 0 .5rem;
  }

  .my-world[data-mode="home"] .friend-heading {
    grid-area: hello;
    align-self: end;
    flex-wrap: wrap;
    gap: .25rem .5rem;
  }

  .my-world[data-mode="home"] .friend-heading .small-button {
    padding-inline: .65rem;
  }

  .my-world[data-mode="home"] .companion-stage {
    grid-area: portrait;
    width: min(100%, max(9.5rem, 40dvh));
  }

  .my-world[data-mode="home"] .friend-slogan {
    grid-area: slogan;
    align-self: start;
    text-align: start;
  }

  .my-world[data-mode="home"] .friend-message { grid-area: message; }
  .my-world[data-mode="home"] .render-note { grid-area: status; }
  .my-world[data-mode="home"] .space-row { grid-area: space; }
}

@media (min-width: 621px) and (max-width: 760px) and (max-height: 550px) {
  .my-world[data-mode="home"] {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .journey-companion:has(.my-world[data-mode="home"]) .my-header {
    flex-wrap: nowrap;
    min-height: 4.7rem;
  }

  .journey-companion:has(.my-world[data-mode="home"]) .journey {
    order: 0;
    flex: 1 1 auto;
    justify-content: center;
  }

  .journey-companion:has(.my-world[data-mode="home"]) .journey button {
    flex: 0 0 auto;
  }
}

@media (min-width: 621px) and (max-height: 550px) {
  .my-world[data-mode="home"] .friend-column {
    position: static;
  }

  .my-world[data-mode="home"] .companion-stage {
    width: min(100%, max(8rem, 51dvh));
  }
}
