/* Profile Spaces physics playground */
.profile-playground {
  margin: 0.5rem 0 1rem;
}
.playground-stage {
  position: relative;
  width: 100%;
  min-height: 280px;
  border-radius: 12px;
  border: 1px solid rgba(29, 39, 77, 0.18);
  background: var(--brand-chinese-white, #e0e1dd);
  overflow: hidden;
  /* Allow vertical page pan in view mode so tall tanks don't trap scroll. */
  touch-action: pan-y;
}
.profile-playground.is-editing .playground-stage {
  outline: 2px solid rgba(255, 131, 46, 0.55);
  outline-offset: 2px;
  overflow: visible;
  touch-action: none;
}
.playground-layer,
.playground-vectors {
  position: absolute;
  inset: 0;
}
.playground-vectors {
  pointer-events: none;
  z-index: 7;
}
.playground-vector {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.playground-vector line {
  stroke: #ff832e;
  stroke-width: 3;
  stroke-linecap: round;
  pointer-events: none;
}
.playground-vector-hit {
  fill: transparent;
  pointer-events: auto;
  cursor: grab;
}
.playground-vector-hub,
.playground-vector-tip {
  fill: #ff832e;
  stroke: #fff;
  stroke-width: 2;
  pointer-events: auto;
  cursor: grab;
}
.playground-vector.is-ghost line {
  stroke-dasharray: 5 4;
  opacity: 0.55;
}
.playground-vector.is-selected line {
  stroke: #1d274d;
}
.playground-vector.is-selected .playground-vector-hub,
.playground-vector.is-selected .playground-vector-tip {
  fill: #1d274d;
}

.pin-card.playground-tile {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(29, 39, 77, 0.18);
  border-radius: 12px;
  overflow: visible;
  background: #fff;
  box-shadow: 0 6px 18px rgba(29, 39, 77, 0.12);
  cursor: grab;
  display: flex;
  flex-direction: column;
  font: inherit;
  color: inherit;
  will-change: transform;
  touch-action: pan-y;
  user-select: none;
  z-index: 2;
}
.profile-playground.is-editing .pin-card.playground-tile,
.pin-card.playground-tile.is-dragging {
  touch-action: none;
}
.playground-tile:active {
  cursor: grabbing;
}
.playground-tile.is-selected {
  z-index: 5;
  box-shadow: 0 0 0 2px #ff832e, 0 8px 22px rgba(29, 39, 77, 0.18);
}
.playground-tile.is-fixed:not(.is-selected) {
  box-shadow: 0 0 0 2px #1d274d, 0 6px 18px rgba(29, 39, 77, 0.12);
}
.playground-tile.is-hide-heart .pin-heart {
  display: none;
}
.playground-tile.is-hide-more .pin-more {
  display: none;
}
.playground-tile.is-hide-heart .playground-tile-tools {
  grid-template-columns: minmax(0, 1fr) auto auto;
}
.playground-tile.is-hide-more .playground-tile-tools {
  grid-template-columns: minmax(0, 1fr) auto auto;
}
.playground-tile.is-hide-heart.is-hide-more .playground-tile-tools {
  grid-template-columns: minmax(0, 1fr) auto;
}
.playground-tile-tools.has-info {
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
}
.playground-tile.is-hide-heart .playground-tile-tools.has-info {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}
.playground-tile.is-hide-more .playground-tile-tools.has-info {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}
.playground-tile.is-hide-heart.is-hide-more .playground-tile-tools.has-info {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.playground-tile-clip {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: inherit;
  background: #fff;
}
.playground-tile-clip .playground-tile-face,
.playground-tile-clip .playground-tile-meta {
  border-radius: 0;
}
.playground-tile.is-hide-meta .playground-tile-meta {
  display: none;
}
.playground-tile.is-hide-meta .playground-tile-face {
  border-radius: 0;
}
.playground-tile-face {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  border-radius: 0;
  background: #1d274d;
  pointer-events: none;
}
.playground-tile-face img,
.playground-tile-ph {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.playground-tile-meta {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 18px 18px;
  flex: 0 0 44px;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 4px 8px;
  gap: 0;
  background: #fff;
  border-radius: 0;
  overflow: visible;
  align-content: center;
}
.playground-tile-title-row,
.playground-tile-meta .pin-title {
  font-size: 0.7rem;
  line-height: 18px;
  pointer-events: auto;
  min-width: 0;
}
.playground-tile-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 2px 4px;
  min-width: 0;
  height: 18px;
  position: relative;
}
.playground-tile-date {
  font-size: 0.58rem;
  line-height: 18px;
  opacity: 0.7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.playground-tile-meta .pin-views {
  font-size: 0.52rem;
  opacity: 0.7;
  white-space: nowrap;
}
.playground-tile-meta .pin-heart {
  flex-direction: row;
  gap: 1px;
  padding: 0;
  min-width: 1.25rem;
  font-size: 0.8rem;
  pointer-events: auto;
  touch-action: manipulation;
}
.playground-tile-meta .pin-heart .heart-n {
  font-size: 0.52rem;
}
.playground-tile-meta .pin-more {
  font-size: 1rem;
  padding: 0 0.12rem;
  pointer-events: auto;
  touch-action: manipulation;
}
.playground-tile-meta .pin-info {
  width: 1.1rem;
  height: 1.1rem;
  font-size: 0.58rem;
  pointer-events: auto;
  touch-action: manipulation;
}
.playground-tile-meta .pin-menu {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 30;
}

.playground-handle {
  display: none;
  position: absolute;
  width: 25px;
  height: 25px;
  right: -12px;
  bottom: -12px;
  border-radius: 25px;
  background: #ff832e;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  padding: 0;
  cursor: nwse-resize;
  z-index: 6;
}
.profile-playground.is-editing .playground-tile.is-selected .playground-handle {
  display: block;
}
.playground-tile.is-rotate-mode .playground-handle {
  background: #10b981;
  cursor: grab;
}

.playground-canvas-grip {
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  width: 72px;
  height: 14px;
  border: 0;
  border-radius: 8px;
  background: #ff832e;
  box-shadow: 0 1px 4px rgba(29, 39, 77, 0.25);
  cursor: ns-resize;
  z-index: 8;
}

.playground-empty {
  margin: 0.5rem 0;
}
#playground-toolbar {
  margin: 0 0 0.75rem;
}
.playground-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.playground-btn {
  width: auto;
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: #2a5b84;
  color: #fff;
}
.playground-btn.ghost {
  background: #fff;
  color: #1d274d;
  border: 1px solid rgba(29, 39, 77, 0.2);
}
.playground-btn.save {
  background: #ff832e;
  color: #1d274d;
}
.playground-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.playground-sliders {
  display: grid;
  gap: 8px;
  margin: 8px 0;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid rgba(29, 39, 77, 0.12);
  border-radius: 8px;
}
.playground-sliders label {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 10px;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
}
.playground-sliders label.playground-gravity {
  grid-template-columns: 8.5rem 1fr auto;
}
.playground-g-val {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  opacity: 0.7;
}
.playground-g-zero {
  padding: 6px 10px;
}
.playground-item-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
}
.playground-check {
  display: flex !important;
  grid-template-columns: auto 1fr !important;
  gap: 8px !important;
  align-items: center;
  font-weight: 600;
}
.playground-check input {
  width: 18px;
  height: 18px;
}
.playground-item-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.playground-item-row .playground-check {
  flex: 0 1 auto;
}
.playground-btn-compact {
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  white-space: nowrap;
}
.playground-hint {
  font-size: 0.82rem;
  margin: 0.35rem 0 0;
}
.visually-hidden-list {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.playground-chrome {
  position: relative;
}
.playground-stage-tools {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 12;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  pointer-events: none;
}
.playground-icon-btn {
  pointer-events: auto;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(29, 39, 77, 0.18);
  background: rgba(255, 255, 255, 0.94);
  color: #1d274d;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(29, 39, 77, 0.12);
}
.playground-icon-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}
.playground-icon-btn:hover {
  border-color: #ff832e;
}
.playground-icon-btn.is-on {
  background: #ff832e;
  color: #1d274d;
  border-color: #ff832e;
}
.playground-icon-btn.is-danger {
  color: #c44536;
  border-color: rgba(196, 69, 54, 0.45);
}
.playground-icon-btn.is-danger:hover {
  border-color: #c44536;
  background: #fdecea;
  color: #9b2c20;
}
.playground-icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.playground-overflow {
  margin-top: 1rem;
}
.playground-overflow-title {
  margin: 0 0 0.4rem;
  font-family: Quicksand, system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1d274d;
}
.playground-overflow-meta {
  margin: 0 0 0.55rem;
}
.playground-overflow-rail {
  margin-top: 0.35rem;
}
.playground-off-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.playground-off-add {
  align-self: flex-start;
  margin: 0;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(29, 39, 77, 0.18);
  background: #fff;
  color: #1d274d;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.playground-off-add:hover {
  border-color: #ff832e;
}
.playground-off-full {
  font-size: 0.8rem;
  color: #6b7280;
}
.playground-list {
  margin-top: 0.25rem;
}
.profile-playground.is-list .playground-list {
  padding-top: 44px;
}
.profile-playground.is-list .playground-stage-tools {
  top: 0;
  right: 0;
}

.playground-tile-face.pin-link {
  pointer-events: auto;
  cursor: inherit;
  text-decoration: none;
  color: inherit;
}
.playground-tile .pin-canvas-pop {
  z-index: 20;
}
.playground-tile.has-canvas-pop {
  z-index: 18;
}

.playground-handle-radius {
  right: -12px;
  top: -12px;
  bottom: auto;
  background: #2a5b84;
  cursor: nesw-resize;
}
.profile-playground.is-editing .playground-tile.is-selected .playground-handle-radius {
  display: block;
}

.profile-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 4px 0 12px;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--brand-space-cadet, #1d274d);
  background: transparent;
  border: none;
  box-shadow: none;
}
.profile-toc[hidden] {
  display: none !important;
}
.profile-toc a {
  color: var(--brand-metallic-blue, #2a5b84);
  font-weight: 600;
  text-decoration: none;
}
.profile-toc a:hover {
  text-decoration: underline;
}
