.mascotRow {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(110px,1fr);
  align-items: center;
  gap: 8px;
}
.mascotLegend { width: 100%; }
.mascotLane { position: relative; height: 62px; }
.orderForm > .labHome {
  height: 100px;
  background: linear-gradient(0deg, var(--tint, #fff1f6), transparent 25%);
  border-radius: 16px 16px 0 0;
}
.labHome + .steps { border-radius: 0; }
.labFurniture {
  --center: var(--review-center, 75%);
  position: absolute; bottom: 1px; left: var(--center); transform: translateX(-50%);
  width: min(clamp(120px, 27%, 177px), calc((100% - var(--center)) * 2 - 6px)); display: flex;
  align-items: flex-end; justify-content: space-between;
  pointer-events: none;
}
.labFurniture button, .craftMascot {
  border: 0; margin: 0; padding: 0; background: transparent; appearance: none;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.labFurniture button { position: relative; display: block; cursor: pointer; pointer-events: auto; }
.labFurniture button:hover { filter: brightness(1.06); }
.labBed { width: 62%; }
.labBed img { display: block; width: 100%; height: auto; pointer-events: none; }
.labBed .occupiedBed { position: absolute; bottom: 0; left: 0; visibility: hidden; }
.labHome[data-sleeping] .emptyBed { visibility: hidden; }
.labHome[data-sleeping] .occupiedBed { visibility: visible; }
.labHome[data-sleeping] .labBed::after {
  content: ""; position: absolute; inset: -50% 0 0; pointer-events: none;
  background: url("./mascot-bed-asleep.webp") center bottom / 100% auto no-repeat;
  clip-path: ellipse(27% 12% at 61% 64%); transform-origin: 62% 77%;
  animation: craftQuilt 3.5s ease-in-out infinite;
}
.labFlowers { width: 30%; aspect-ratio: .90; }
.plantBase, .plantCrown {
  position: absolute; inset: 0; background: url("./mascot-table.webp") center bottom / contain no-repeat; pointer-events: none;
}
.plantBase { clip-path: inset(40% 0 0); }
.plantCrown { clip-path: inset(0 0 60%); transform-origin: 74% 41%; }
.waterStream { display: none; position: absolute; width: 13px; height: 11px; left: 57%; top: 29%; pointer-events: none; }
.waterStream::before, .waterStream::after {
  content: ""; position: absolute; width: 3px; height: 5px; border-radius: 65% 65% 55% 55%;
  background: #50b3d6; box-shadow: 0 0 1px white; animation: craftDroplet .45s ease-in infinite;
}
.waterStream::after { left: 5px; animation-delay: -.23s; }
.labHome[data-watering] .waterStream { display: block; }
.labHome[data-watering] .plantCrown { animation: craftFlower .6s ease-in-out infinite alternate; }
.craftMascot {
  position: fixed; z-index: 5; top: 0; left: 0; display: block; border-radius: 25%;
  cursor: pointer; touch-action: none; will-change: transform;
}
.craftMascot[hidden], .mascotResume[hidden] { display: none; }
.craftMascot:hover:not(:disabled)::after, .craftMascot:focus-visible::after {
  content: "柚C"; position: absolute; bottom: calc(100% - 4px); left: 50%;
  transform: translateX(-50%); white-space: nowrap; padding: 0 6px;
  font-size: 12px; border-radius: 10px; color: var(--berry); background: var(--paper,#fff); pointer-events: none;
}
.craftMascot:disabled { opacity: 1; pointer-events: none; }
.mascotBubble, .mascotDizzy { display:none; pointer-events:none; position:absolute; }
.craftMascot[data-speaking] .mascotBubble {
  display:block; left:calc(100% - 4px); top:8%; padding:4px 8px; width:max-content; max-width:min(13em, 35vw); white-space:normal; overflow-wrap:anywhere; text-align:left;
  border:1px solid #d89bae; border-radius:12px 12px 12px 3px; background:#fff7fa;
  color:#77364e; font:600 12px/1.5 system-ui,sans-serif; box-shadow:0 2px 6px #77364e1a;
}
.craftMascot[data-bubble-side="left"] .mascotBubble {left:auto; right:calc(100% - 4px); border-radius:12px 12px 3px 12px;}
.craftMascot[data-state="hurt"] .mascotDizzy {
  display:block; width:45%; height:9%; left:28%; top:-6%; border:1px solid #e5ac68; border-radius:50%;
}
.mascotDizzy::before, .mascotDizzy::after {
  content:""; position:absolute; top:-2px; left:45%; width:4px; height:4px;
  border:1px solid #ce8640; background:#fff5ae; border-radius:50%;
  animation:craftDizzy .95s linear infinite;
}
.mascotDizzy::after { animation-delay:-.47s; }
@keyframes craftDizzy {
  0%,100% { transform:translate(-10px,1px) } 25% { transform:translate(0,-2px) }
  50% { transform:translate(10px,1px) } 75% { transform:translate(0,4px) }
}
.craftMascot[data-state="slip"] .mascotBody { animation: craftVanish .86s ease-in both; }
.craftMascot[data-state="revive"] .mascotBody { animation: craftAppear .8s ease-out both; }
.mascotRevival { display:none; position:absolute; bottom:2px; width:0; height:0; pointer-events:none; color:#e2a5c4; }
[data-reviving] > .mascotRevival { display:block; }
.mascotRevival::before {
  content:""; position:absolute; left:-24px; bottom:0; width:48px; height:10px;
  border:2px solid currentColor; border-radius:50%; box-shadow:0 0 9px #efd3c6;
  animation:craftRipple 1.3s ease-out both;
}
.mascotRevival i {
  position:absolute; bottom:20px; width:6px; height:9px; background:#e9afbd;
  clip-path:polygon(50% 0,65% 37%,100% 50%,65% 63%,50% 100%,35% 63%,0 50%,35% 37%);
  animation:craftSpark 1.22s ease-out both;
}
.mascotRevival i:nth-child(even) { background:#e3b469; }
@keyframes craftVanish { 0%,50% { opacity:1 } 100% { opacity:0 } }
@keyframes craftAppear { from { opacity:0; filter:drop-shadow(0 0 6px #ffd4e4) } to { opacity:1; filter:none } }
@keyframes craftRipple { from { opacity:0; transform:scale(.25) } 30% {opacity:.9} to { opacity:0; transform:scale(1.45) } }
@keyframes craftSpark { from { opacity:0; transform:rotate(var(--angle)) translateY(-6px) } 30% {opacity:1} to { opacity:0; transform:rotate(var(--angle)) translateY(-42px) } }
.craftMascot:focus-visible, .labFurniture button:focus-visible, .mascotResume:focus-visible { outline: 2px dashed var(--berry); outline-offset: 2px; }
.craftMascot[data-grabbable] { cursor: grab; }
.craftMascot[data-state="held"] { z-index: 15; cursor: grabbing; }
.craftMascot canvas, .mascotBody { display: block; width: 100%; height: 100%; pointer-events: none; }
.craftMascot canvas { transform-origin: 50% 95%; }
.craftMascot[data-state="sleep"] canvas { visibility: hidden; }
.craftMascot[data-pose="startle"] canvas { animation: craftFlinch .45s ease-out; }
.craftMascot[data-pose="giggle"] canvas { animation: craftBounce .26s ease-in-out 3 alternate; }
.craftMascot[data-pose="pout"] canvas, .craftMascot[data-pose="turn"] canvas { animation: craftHuff .5s ease-out; }
.craftMascot[data-pose="shy"] canvas, .craftMascot[data-pose="wake"] canvas { animation: craftNod .75s ease-in-out; }
.craftMascot[data-state="water"] canvas { animation: craftPour .65s ease-in-out infinite alternate; }
.craftMascot[data-state="ledgeRest"] canvas { animation: craftCatchBreath 1.15s ease-in-out infinite; }
@keyframes craftCatchBreath { 50% { transform: scale(1.015,.97); } }
.mascotResume {
  position: fixed; z-index: 6; border: 1px solid var(--rule);
  border-radius: 99px; background: var(--paper,#fff); color: var(--berry);
  font: inherit; font-weight: 550; font-size: 12px; line-height: 1.5; padding: 3px 7px; cursor: pointer;
}
@keyframes craftFlinch { 35% { transform: translateY(-7%) rotate(4deg); } }
@keyframes craftBounce { to { transform: translateY(-3%) rotate(-2deg); } }
@keyframes craftHuff { 35% { transform: rotate(-5deg); } 70% { transform: rotate(2deg); } }
@keyframes craftNod { 45% { transform: rotate(4deg) scaleY(.97); } }
@keyframes craftQuilt { 50% { transform: scaleY(1.035); } }
@keyframes craftPour { to { transform: rotate(2deg); } }
@keyframes craftFlower { to { transform: rotate(3deg); } }
@keyframes craftDroplet { from { opacity: 0; transform: translate(-4px,-5px); } 15% { opacity: 1; } to { opacity: 0; transform: translate(3px,7px); } }
@media (prefers-reduced-motion: reduce) {
  .mascotDizzy::before,.mascotDizzy::after {animation:none;}
  .craftMascot canvas, .craftMascot .mascotBody, .mascotRevival::before, .mascotRevival i, .labHome .plantCrown, .labHome .waterStream::before, .labHome .waterStream::after, .labHome .labBed::after { animation: none !important; }
}
@media print { .craftMascot, .mascotLane { display: none !important; } }
