/* 玩具盒（js/toybox.js）：斜着看的一只木盒，卡片插在顶上的槽里。2026-11-19 从 desktop.css 拆出来。 */

/* ── 玩具盒（js/toybox.js）：斜着看的一只木盒摊在屏幕正中，卡片一张张插在顶上的槽里 ── */
.toybox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgb(0 0 0 / 0.35);
  opacity: 0;
  transition: opacity 0.2s;
  font-family: var(--px);
  font-size: 12px;
}

.toybox-overlay.shown {
  opacity: 1;
}

.toybox {
  position: relative;
  flex: none;
  translate: 0 20px;
  transition: translate 0.25s steps(4);
  filter: drop-shadow(0 calc(var(--s) * 4px) 0 rgb(0 0 0 / 0.3));
}

.toybox-overlay.shown .toybox {
  translate: 0 0;
}

.toybox canvas {
  display: block;
  image-rendering: pixelated;
}

/* 每道槽前面的那部分盒子，盖在这道槽的卡片上 */
.toy-lip {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}

/* 一张卡片：外面这层不动（指针认的是它，免得卡片一探头就从指针底下溜走），动的是里面那张图 */
.toy {
  position: absolute;
  cursor: grab;
  touch-action: none;
  transition: left 0.2s steps(4), top 0.2s steps(4);
}

.toy canvas {
  pointer-events: none;
  transform-origin: 30% 80%;
  rotate: var(--lean, 0deg);
  /* 回弹带一点过头，像卡片被拨开又弹回来 */
  transition: translate 0.22s cubic-bezier(0.3, 1.8, 0.5, 1), rotate 0.22s cubic-bezier(0.3, 1.8, 0.5, 1);
}

.toy.peek canvas {
  translate: 0 calc(var(--s) * -10px);
}

/* 整张抽出来：先升到所有东西上面 */
.toy.out {
  z-index: 900 !important;
}

.toy.out canvas {
  translate: 0 calc(-1 * var(--h) - var(--s) * 12px);
  rotate: 0deg;
  transition: translate 0.26s steps(6);
}

.toy.lifted {
  opacity: 0.3;
}

/* 拖的时候：要落进哪一格，槽口亮一道 */
.toy-mark {
  position: absolute;
  z-index: 800;
  width: calc(var(--s) * 56px);
  height: calc(var(--s) * 5px);
  background: rgb(240 215 138 / 0.9);
  transform: skewY(26.565deg);
  transform-origin: 0 0;
  pointer-events: none;
}

.toy-caption {
  margin: 0;
  max-width: calc(100vw / var(--uiz, 1) - 24px);
  zoom: var(--uiz, 1); /* 大屏上跟着桌面放大（desktop.js 的 applyZoom 挂在根上） */
  min-height: 1.6em;
  text-align: center;
  color: #fff;
  text-shadow: 1px 0 #1a1612, -1px 0 #1a1612, 0 1px #1a1612, 0 -1px #1a1612, 1px 1px #1a1612, -1px -1px #1a1612, 1px -1px #1a1612, -1px 1px #1a1612;
  pointer-events: none;
}
