/* =========================================================
   育てるキャラの 3D（app/javascript/controllers/buddy3d_controller.js）
   3D が出せたら .is-3d がつき、もとの絵（2D）をかくして キャンバスを重ねる
   ========================================================= */
.buddy3d { position: relative; display: grid; justify-items: center; }
.buddy3d-stage { position: absolute; inset: 0 0 auto 0; margin: 0 auto; width: 260px; height: 260px; pointer-events: none; }
.buddy3d-stage canvas { width: 100%; height: 100%; display: block; cursor: grab; outline: none; }
.buddy3d-stage canvas:active { cursor: grabbing; }
.buddy3d.is-3d .buddy3d-stage { pointer-events: auto; }
.buddy3d.is-3d .buddy-body, .buddy3d.is-3d .buddy-egg, .buddy3d.is-3d .buddy-deco { visibility: hidden; }
.buddy3d.is-3d .buddy-aura { opacity: .55; }
.buddy3d-hint { margin: 2px 0 0; font-size: .82rem; text-align: center; }
@media (min-width: 768px) { .buddy3d-stage { width: 320px; height: 320px; } }

/* ---------- きせかえ ---------- */
.dress-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.dress-form { display: contents; }
.dress-item {
  display: grid; justify-items: center; gap: 2px; padding: 12px 6px; min-height: 112px; width: 100%;
  border: 3px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text);
  font: inherit; cursor: pointer; text-align: center; transition: transform .12s ease, border-color .12s ease;
}
button.dress-item:hover { transform: translateY(-2px); border-color: #c7d2fe; }
.dress-item .ico { font-size: 2.2rem; line-height: 1.1; }
.dress-item .nm { font-weight: 800; font-size: .9rem; }
.dress-item small { color: var(--muted); font-size: .72rem; }
.dress-item.is-on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 4px var(--primary-soft); }
.dress-item.is-on small { color: var(--primary-dark); font-weight: 700; }
.dress-item.is-locked { opacity: .5; cursor: default; background: var(--surface-2); border-style: dashed; }

/* ---------- アバター選び（100種類）---------- */
.avatar-group { margin: 16px 0 8px; font-size: 1rem; }
.avatar-pick label { position: relative; }
.avatar-pick .av-name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 2px 3px; font-size: .62rem; font-weight: 700; line-height: 1.2;
  background: rgba(255, 255, 255, .88); color: var(--text); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
