/* decorator.css — Block Decorator: prize grid, placed decorations, edit mode */
.prizes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.prize {
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 12px 6px 10px;
  position: relative;
  transition: transform 0.2s ease;
}

.prize .p-view {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prize .p-view .tilt {
  transform: rotateX(-20deg) rotateY(-28deg);
  transform-style: preserve-3d;
}

.prize .p-q { font-size: 36px; font-weight: 900; color: rgba(255, 255, 255, 0.22); }
.prize .p-shop { font-size: 36px; }

.prize .p-count {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  background: var(--brick-blue);
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-radius: 999px;
  padding: 2px 8px;
}
.prize .p-name { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-top: 6px; color: rgba(255,255,255,0.55); }
.prize .p-die { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.4); margin-top: 2px; }

.prize.won { border-color: var(--brick-yellow); background: rgba(245, 205, 48, 0.12); cursor: pointer; }
.prize.won:hover { transform: scale(1.05); }
.prize.won .p-name { color: #fff; }
.prize.won.off .p-view { opacity: 0.3; }

.p-toggle {
  display: inline-block;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, 0.3);
}

.p-toggle.on  { background: var(--brick-green); color: #fff; box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2); }
.p-toggle.off { background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.5); }
.prize.just-won { animation: prizePop 0.6s cubic-bezier(0.2, 1.8, 0.4, 1); border-color: #fff; }

@keyframes prizePop {
  0%  { transform: scale(1); }
  40% { transform: scale(1.18) rotate(4deg); }
  100%{ transform: scale(1); }
}

/* ---------- Won decorations: voxel models, parked in place ---------- */
.decor {
  position: fixed;
  z-index: 1;
  pointer-events: none;
  transform: scale(var(--ds, 1));
}

/* fixed isometric pose — decorations sit still, no floating */
.decor-spin {
  transform-style: preserve-3d;
  transform: rotateX(-18deg) rotateY(-30deg);
}

/* ---------- Edit mode: move & resize decorations ---------- */
body.editing .decor {
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  z-index: 5;
  outline: 2px dashed rgba(255, 255, 255, 0.65);
  outline-offset: 8px;
  border-radius: 8px;
}

body.editing .decor:active { cursor: grabbing; }

/* park the links & dice while editing so drags can't misfire */
body.editing .content, body.editing footer { pointer-events: none; opacity: 0.3; }
body.editing .cube-wrap { pointer-events: none; opacity: 0.3; }

.decor-handle {
  display: none;
  position: absolute;
  right: -16px;
  bottom: -16px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brick-yellow);
  border: 3px solid rgba(0, 0, 0, 0.45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: nwse-resize;
  touch-action: none;
}

body.editing .decor-handle { display: block; }

.edit-toolbar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: none;
  align-items: center;
  gap: 14px;
  background: rgba(10, 16, 48, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  padding: 10px 16px;
  backdrop-filter: blur(8px);
  font-size: 13px;
  font-weight: 700;
  max-width: 94vw;
}

body.editing .edit-toolbar { display: flex; }

.done-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
  background: linear-gradient(180deg, #2fbb4f, #1c8a37);
  border: 3px solid rgba(0,0,0,0.35);
  border-radius: 10px;
  padding: 8px 18px;
  cursor: pointer;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,0.25);
  white-space: nowrap;
}

.done-btn:hover { transform: scale(1.05); }

.edit-btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
  background: linear-gradient(180deg, #4a90d9, #2b5f9e);
  border: 3px solid rgba(0,0,0,0.35);
  border-radius: 12px;
  padding: 12px 24px;
  cursor: pointer;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,0.25);
  margin-top: 20px;
}

.edit-btn:hover { transform: scale(1.04); }


.decor.arrive { animation: decorArrive 0.8s cubic-bezier(0.2, 1.6, 0.4, 1); }

@keyframes decorArrive {
  from { transform: scale(0) rotate(-180deg); opacity: 0; }
  to   { transform: scale(var(--ds, 1)) rotate(0deg); opacity: 1; }
}

