.palace-art-header {
  flex-wrap: wrap;
  gap: .5rem .75rem;
}

.palace-art-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.palace-art-actions .palace-enter {
  border-color: #73654a;
  background: #514634;
  color: #fffaf0;
}

.palace-art-actions .palace-enter:hover {
  background: #67593f;
}

.palace-enter:disabled {
  cursor: wait;
  opacity: .8;
}

[data-palace-portal][data-interactive] {
  cursor: zoom-in;
  user-select: none;
  touch-action: manipulation;
}

[data-palace-portal] img {
  -webkit-user-drag: none;
}

.palace-entry-status {
  margin: 0;
  padding: 0 clamp(1rem, 3vw, 1.5rem) 1rem;
  color: #715035;
}

.palace-experience {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  border: 0;
  background: transparent;
  color: #f9f0db;
  font-family: var(--sans);
}

.palace-experience::backdrop {
  background: transparent;
}

.palace-portal-shade,
.palace-experience-surface {
  position: absolute;
  inset: 0;
  background: #0d0b0b;
}

.palace-portal-shade {
  background: radial-gradient(ellipse at var(--palace-light-x, 50%) var(--palace-light-y, 50%),
    #8e62343b, #24180ee9 64%, #0d0b0b 92%);
}

.palace-portal-shade::after {
  position: absolute;
  inset: 0;
  background: #100e0d;
  opacity: var(--palace-matte, 0);
  content: '';
}

.palace-experience-surface {
  z-index: 1;
  cursor: grab;
  touch-action: none;
}

.palace-experience-surface:active {
  cursor: grabbing;
}

.palace-experience-surface:focus {
  outline: none;
}

.palace-experience-surface:focus-visible ~ .palace-walk-help {
  outline: 2px solid #e6c48d;
  outline-offset: 3px;
}

.palace-experience-surface canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.palace-portal-falloff {
  position: absolute;
  inset: 0;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse var(--palace-field-width, 58%) var(--palace-field-height, 54%)
    at var(--palace-light-x, 50%) var(--palace-light-y, 50%),
    transparent 23%, #180d0740 69%, #090608bf 112%
  );
}

.palace-return-view {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.palace-portal-snapshot {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 3;
  transform-origin: 0 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.palace-exit,
.palace-walk-help,
.palace-touch-controls {
  position: absolute;
  z-index: 2;
  visibility: hidden;
}

.palace-experience[data-phase="inside"] :is(.palace-exit, .palace-walk-help, .palace-touch-controls) {
  visibility: visible;
}

.palace-exit,
.palace-touch-controls button,
.palace-walk-help {
  border: 1px solid #ad986d8c;
  border-radius: 4px;
  background: #1d1811eb;
  color: #fff0d2;
  box-shadow: 0 2px 9px #0006;
}

.palace-exit,
.palace-touch-controls button {
  min-height: 2.75rem;
  font: inherit;
  cursor: pointer;
  touch-action: none;
}

.palace-exit {
  top: max(.9rem, env(safe-area-inset-top));
  right: max(.9rem, env(safe-area-inset-right));
  padding: .5rem .9rem;
}

.palace-exit:hover,
.palace-touch-controls button:active {
  background: #463823;
}

.palace-exit:focus-visible,
.palace-touch-controls button:focus-visible {
  outline: 2px solid #e6c48d;
  outline-offset: 3px;
}

.palace-walk-help {
  bottom: max(.9rem, env(safe-area-inset-bottom));
  left: max(.9rem, env(safe-area-inset-left));
  margin: 0;
  padding: .45rem .7rem;
  font-size: .875rem;
  line-height: 1.4;
  pointer-events: none;
}

.palace-touch-help,
.palace-touch-controls {
  display: none;
}

@media (any-pointer: coarse) {
  .palace-keyboard-help {
    display: none;
  }

  .palace-touch-help {
    display: inline;
  }

  .palace-walk-help {
    right: max(.9rem, env(safe-area-inset-right));
    left: auto;
  }

  .palace-touch-controls {
    bottom: max(.9rem, env(safe-area-inset-bottom));
    left: max(.9rem, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: repeat(3, 2.75rem);
    gap: .25rem;
  }

  .palace-touch-controls [data-move="forward"] {
    grid-column: 2;
  }

  .palace-touch-controls [data-move="left"] {
    grid-column: 1;
  }
}

@media (max-width: 430px) {
  .palace-art-actions .art-player-close {
    padding-inline: .55rem;
  }
}
