/* Escenario, canvas, decoración, ayuda y notificaciones. */
.playground {
  position: relative;
  container-type: inline-size;
  min-height: 160px;
  overflow: hidden;
  border: 1px solid #d9e9f6;
  border-radius: 23px;
  background: var(--stage-sky, #edf6ff);
  touch-action: none;
  cursor: grab;
}
.playground:active {
  cursor: grabbing;
}
canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#effects {
  pointer-events: none;
}
.scene-background {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.play-world-active .scene-background {
  display: none;
}
html[data-appearance="dark"] .scene-background {
  filter: brightness(0.58) saturate(0.8);
}
.hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: calc(11px * var(--text-scale, 1));
  white-space: nowrap;
  background: #ffffffd9;
  padding: 7px 12px;
  border-radius: 20px;
  color: var(--ad-ink-on-light);
  pointer-events: none;
}
.hint-compact {
  display: none;
}
@container (max-width: 650px) {
  .hint-full {
    display: none;
  }
  .hint-compact {
    display: inline;
  }
}
#toast {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-surface);
  padding: 10px 16px;
  border-radius: 23px;
  font-size: calc(12px * var(--text-scale, 1));
  color: var(--ad-ink-muted);
  opacity: 0;
  pointer-events: none;
}
.swipe-hint {
  display: none;
}
#scene-placeholder {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(160px, 36%);
  max-height: 74%;
  height: auto;
  pointer-events: none;
}
#scene-placeholder[hidden] {
  display: none !important;
}
html[data-appearance="dark"] .playground {
  background: color-mix(in srgb, var(--stage-sky, var(--color-surface)) 58%, black);
  border-color: #3b5870;
}
@media (max-width: 850px), (pointer: coarse) and (max-width: 1100px) {
  .swipe-hint {
    display: none;
  }

  .playground {
    grid-row: 1;
    grid-column: 1;
    min-height: 190px;
    height: auto;
    border-radius: 22px;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 38%, #fffdf3, #eef8ff 64%, #e0f0ff);
  }

  .hint,
  #toast {
    display: none;
  }
}
@media (max-width: 850px) and (orientation: landscape) and (max-height: 500px),
  (pointer: coarse) and (max-width: 1100px) and (orientation: landscape) and (max-height: 500px) {
  .playground {
    grid-column: 1;
    grid-row: 1/3;
    min-height: 190px;
  }
}
@media (pointer: coarse) and (orientation: landscape) and (min-width: 900px) and (max-width: 1100px) and (min-height: 501px) {
  .playground {
    grid-column: 1;
    grid-row: 1/3;
  }
}
/* Reserve the right-hand controller's footprint instead of drawing help below it. */
@media (min-width: 851px) and (pointer: fine), (min-width: 1101px) {
  .playground > .hint {
    left: 16px;
    right: 240px;
    bottom: 12px;
    transform: none;
    width: fit-content;
    max-width: calc(100% - 256px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    box-sizing: border-box;
  }
}
.playground {
  border-color: var(--ad-line);
  box-shadow:
    inset 0 1px 0 #fff9,
    0 2px 0 #d8e5f2;
}
/* Wide touch tablets share the controller row, with help for the gesture they use. */
@media (pointer: coarse) and (orientation: landscape) and (min-width: 1101px) {
  .playground > .hint {
    display: flex;
    align-items: center;
    min-height: 42px;
    left: 16px;
    right: auto;
    bottom: 16px;
    max-width: calc(100% - 280px);
    padding: 8px 14px;
    font-size: calc(14px * var(--text-scale, 1));
    line-height: 1.3;
    color: var(--color-ink-control);
    background: var(--color-surface);
  }

  .playground > .hint .desktop-hint {
    display: none;
  }
}
/* Keep the scene and its controller in the viewport while long desktop lists scroll. */
@media (min-width: 851px) and (pointer: fine), (min-width: 1101px) {
  .playground {
    position: sticky;
    top: 12px;
    align-self: stretch;
    height: auto;
    /* 48px header + 44px navigation + 26px margins + 8px page padding. */
    max-height: calc(100svh - 126px);
    min-height: 280px;
  }
}

/* Wide touch tablets have a 68px header instead of the desktop 48px header. */
@media (pointer: coarse) and (orientation: landscape) and (min-width: 1101px) {
  .playground {
    max-height: calc(100svh - 146px);
  }
}
