.deco-public-tree,
.deco-themed-flow {
  position: relative;
  isolation: isolate;
}

.name-input__clear[hidden] {
  display: none;
}

.deco-stage-art {
  position: relative;
  width: min(45vh, 88vw, 450px);
  aspect-ratio: 512 / 800;
  flex: none;
  perspective: 550px;
}

.deco-stage-art.tree-art--look {
  width: 100%;
}

.deco-stage-turn {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}

.deco-stage-art--space .deco-stage-turn {
  transform: rotateY(var(--deco-tree-yaw, 0deg)) rotateX(var(--deco-tree-pitch, 0deg));
  transition: transform 180ms ease;
}

.deco-stage-art .tree-picker__layers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.deco-stage-art .tree-picker__image--tree {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.deco-stage-art .tree-picker__image--topper {
  position: absolute;
  left: 38%;
  top: -2.6%;
  width: 24%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}

.deco-stage-art--space .tree-picker__image--tree {
  filter: drop-shadow(0 12px 20px #0b1716aa);
}

.deco-stage-art--space .tree-picker__image--topper {
  top: 0;
  width: 20%;
  left: 40%;
}

.deco-stage-art--compact {
  width: 78px;
}

.deco-wishlist-gift-pile {
  position: absolute;
  z-index: 3;
  inset-inline-start: 50%;
  bottom: 1%;
  transform: translateX(-50%);
  display: flex;
  align-items: end;
  gap: 2px;
  pointer-events: auto;
  text-decoration: none;
}

.deco-wishlist-gift-pile img {
  width: clamp(24px, 7vw, 48px);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 3px 4px #08161091);
}

.deco-wishlist-gift-pile img:nth-child(even) {
  width: clamp(21px, 6vw, 41px);
}

.deco-tree-wishlist {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 1.2rem;
}

.deco-tree-wishlist p {
  margin: 4px 0 14px;
  color: var(--muted);
}

.deco-tree-toast {
  position: fixed;
  z-index: 150;
  left: 50%;
  bottom: max(30px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: min(86vw, 30rem);
  padding: .8rem 1.05rem;
  border: 1px solid #ffffff38;
  border-radius: 14px;
  color: #fff;
  background: #20463d;
  text-align: center;
  box-shadow: 0 16px 30px #061c1aa0;
}

.deco-tree-dialog__panel {
  display: grid;
  gap: .7rem;
  justify-items: center;
  text-align: center;
}

.deco-tree-dialog__panel h2 {
  font-size: 1.4rem;
  margin: .1rem 0;
  line-height: 1.28;
}

.deco-tree-dialog__panel > p,
.deco-tree-auth p,
.deco-share-tree > p {
  margin: 0;
  color: #b9d1c8;
}

.deco-tree-dialog .modal__body [data-tree-status]:empty {
  display: none;
}

.deco-tree-dialog .modal__body [data-tree-status] {
  color: #f6e4a0;
  margin: .25rem 0 0;
}

.deco-tree-dialog__buttons,
.deco-tree-form {
  display: grid;
  gap: .65rem;
  width: 100%;
}

.deco-tree-form label:not(.deco-tree-toggle) {
  display: grid;
  text-align: left;
  gap: .25rem;
  font-size: .93rem;
}

.deco-tree-form :is(input:not([type="checkbox"]),select,textarea),
.deco-share-tree__link {
  width: 100%;
  min-height: 44px;
  padding: .55rem .7rem;
  background: #0f2c28;
  border: 1px solid #50726a;
  border-radius: 10px;
  color: inherit;
  font: inherit;
}

.deco-tree-toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: .15rem 0;
}

.deco-tree-toggle input {
  accent-color: #b43e45;
}

.deco-delete-tree {
  color: #f69d9e;
  justify-self: center;
}

.deco-tree-code {
  display: block;
  padding: .75rem;
  border-radius: 10px;
  border: 1px dashed #587c70;
  width: 100%;
  overflow-wrap: anywhere;
  background: #0f2c28;
  font-size: 1rem;
}

.deco-tree-library__inner {
  width: min(calc(100vw - 32px), 720px);
  margin: clamp(40px, 12vh, 100px) auto;
  display: grid;
  justify-items: center;
  text-align: center;
  row-gap: 16px;
}

.deco-tree-library__inner h1,
.deco-tree-library__inner p {
  margin: 0;
}

.deco-tree-library__inner p {
  color: var(--muted, #c3d5ca);
}

.deco-tree-library__inner .btn {
  max-width: 300px;
}

.deco-tree-library__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.deco-tree-library__card {
  display: grid;
  justify-items: center;
  gap: .55rem;
  text-decoration: none;
  padding: 1rem;
  color: inherit;
  background: #163a34;
  border: 1px solid #395954;
  border-radius: 16px;
}

.deco-tree-library__card span {
  font-size: 0.875rem;
  color: #bad3c8;
}

.deco-wish-success > img {
  width: 95px;
  height: 95px;
  object-fit: contain;
  margin: auto;
}

.deco-wish-success h1 {
  margin-top: 1rem;
}

.gift-place-stage__tree .deco-stage-art {
  width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .deco-stage-art--space .deco-stage-turn {
    transform: none;
  }
}

.deco-tree-space {
  opacity: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 56% 42%, #533025 0, #26201d 66%, #1a1d1e 100%);
}

.deco-tree-space__backdrop {
  --deco-room-height: calc(29.817vw + 43.293dvh + 4.47px);
  --deco-room-x: calc(25.673vw - 35.677dvh + 3.85px);
  --deco-room-y: calc(40.792dvh - 25.567vw - 3.84px);
  position: absolute;
  inset: 0;
  background-image: var(--deco-space-background);
  background-size: auto var(--deco-room-height);
  background-position: left var(--deco-room-x) top calc(var(--deco-room-y) + var(--deco-room-shift, 0px));
  background-repeat: no-repeat;
  mask-image: linear-gradient(to right, transparent max(0px, var(--deco-room-x)), black calc(max(0px, var(--deco-room-x)) + 3.5vw) 98%, transparent),
    linear-gradient(to bottom, black 78%, transparent 97%);
  mask-composite: intersect;
}

.flow--topper .deco-tree-space__backdrop {
  --deco-room-shift: 3.11dvh;
}

.tree-screen--space .deco-tree-space__backdrop {
  --deco-room-shift: 1.89dvh;
}

.deco-tree-space__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.deco-tree-space.is-ready .deco-tree-space__fallback {
  display: none;
}

.deco-tree-space__fallback :is(.deco-stage-art, .tree-art) {
  width: min(45vh, 88vw, 450px);
  margin-top: 4%;
  max-width: min(400px, 72vw);
}

.deco-tree-space__fallback .tree-art__ornament {
  pointer-events: auto;
}

.deco-tree-space canvas {
  opacity: 0;
}

.deco-tree-space.is-ready canvas {
  opacity: 1;
}

.deco-tree-space .tree-space__topper {
  width: calc(var(--space-size) * .24);
  transform: translate(-50%, -62%);
}

.deco-tree-space .tree-space__vignette {
  background: linear-gradient(#17202582, #16202730 13%, #0000 34% 75%, #1b1d20a8 98%),
    radial-gradient(ellipse at 54% 43%, #0000 54%, #13161795 100%);
}

.deco-tree-space__controls {
  z-index: 1;
  position: absolute;
  top: 18%;
  bottom: 18%;
  left: 50%;
  width: min(580px, 91vw);
  transform: translateX(-50%);
  pointer-events: auto;
  touch-action: pan-y;
  cursor: grab;
}

.deco-tree-space__controls.is-dragging {
  cursor: grabbing;
}

.deco-tree-space__controls:focus-visible {
  outline: 2px solid #f8dfa2;
  outline-offset: -3px;
  border-radius: 15px;
}

.deco-tree-space .tree-space__points {
  z-index: 2;
  pointer-events: none;
}

.deco-tree-space .tree-space__wish {
  max-width: 82px;
  pointer-events: auto;
  cursor: pointer;
}

.deco-tree-space .tree-space__wish img {
  width: 100%;
  height: auto;
}

.deco-tree-space .deco-space-gift {
  transform: translate(-50%, -18%);
}

.deco-tree-space .tree-art__name {
  --ornament-inset: 0px;
  --ornament-name-width: max-content;
}

.deco-public-tree.tree-screen--space > :is(header, .screen__title, .tree-screen__shortcuts, .screen__actions, .tree-scroll-hint, .tree-music) {
  z-index: 3;
}

.deco-public-tree.tree-screen--space .screen__stage {
  pointer-events: none;
}

.deco-public-tree.tree-screen--space .screen__stage .pager {
  pointer-events: auto;
}

.flow--space > :is(.page__bar, .look-choices) {
  position: relative;
  z-index: 3;
}

.flow--space .space-stage .cycle-btn--prev {
  left: max(14px, calc(50% - 302px));
}

.flow--space .space-stage .cycle-btn--next {
  right: max(14px, calc(50% - 302px));
}

.deco-owner-menu {
  width: auto;
  min-width: 60px;
  padding: 3px 10px 3px 5px;
  background: #1e2d29b3;
  border: 1px solid #ffffff2e;
  border-radius: 30px;
  gap: 3px;
}

.deco-owner-menu .icon:first-child {
  border-radius: 50%;
  padding: 5px;
  background: #173c32;
}

.tree-shortcuts button.tree-shortcuts__entry {
  background: transparent;
  border: 0;
}

.deco-owner-gifts {
  color: var(--text, #f2f6ee);
  background: #193c3459;
  border: 1px solid #bfdcd326;
  border-radius: 20px;
  padding: 1.4rem;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: .6rem;
  margin-bottom: 1.2rem;
}

.deco-owner-gifts h2,
.deco-owner-gifts p {
  margin: 0;
}

.deco-owner-gifts > img,
.deco-owner-gifts__boxes img {
  width: min(24vw, 100px);
  height: auto;
}

.deco-owner-gifts__boxes button {
  background: transparent;
  border: 0;
  color: inherit;
}

.deco-owner-gifts .btn {
  width: auto;
}

.deco-settings-modal .menu-list,
.deco-settings-modal .music-picker__list {
  text-align: start;
  width: 100%;
}

.deco-settings-modal .menu-row > .menu-row__value {
  color: #b2c9bd;
}

.deco-settings-modal .modal__back {
  position: absolute;
  top: 10px;
  left: 10px;
}

@media (max-width: 650px) {
  .deco-tree-space__backdrop {
    --deco-room-height: 76.07dvh;
    --deco-room-x: -48.19vw;
    --deco-room-y: 12.04dvh;
    mask-image: linear-gradient(to bottom, transparent 12%, black 20% 78%, transparent 96%);
  }

  .deco-tree-space__controls {
    top: 22%;
    bottom: 23%;
  }
}

.deco-access-card {
  display: grid;
  gap: .7rem;
  width: 100%;
  padding: .85rem;
  border-radius: 14px;
  background: #0f2c28;
  border: 1px solid #bac7a230;
}

.deco-access-card > div:last-child {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  color: #b4cfbf;
  font-size: .875rem;
}

.deco-access-card .deco-tree-code {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .07em;
}

.deco-access-dialog .deco-tree-dialog__buttons {
  grid-template-columns: .85fr 1.15fr;
}
