/* The doll, second version, in plain shapes: her clothes lie all round her and are dragged onto her. One explicit colour theme. */
* { box-sizing: border-box; }
body { margin: 0; background: #2a0a14; color: #f2e2c4; font: 16px/1.35 Georgia, serif; overflow-x: hidden; }
main { max-width: 1040px; margin: 0 auto; padding: 56px 10px 150px; }
.quiet { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.room { display: grid; grid-template-columns: 1fr minmax(210px, 300px) 1fr; gap: 10px; align-items: start; background: #6d4a63; border: 4px solid #c9a24b; border-radius: 10px; padding: 10px; }
.pile { display: flex; flex-wrap: wrap; gap: 7px; align-content: flex-start; justify-content: center; }
.stage { position: sticky; top: 8px; display: grid; justify-items: center; padding: 8px 0 0; background: #5a3b52; border-radius: 8px; overflow: hidden; min-height: 320px; }
.stage.over { box-shadow: inset 0 0 0 4px #ffe9a8; }
.doll { width: 70%; max-width: 210px; height: auto; display: block; transform-origin: 50% 100%; touch-action: manipulation; }
.skin { fill: #f2c9a3; stroke: #2a0a14; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.eye { fill: #2a0a14; } .mouth { fill: none; stroke: #2a0a14; stroke-width: 2.5; stroke-linecap: round; }
.slip { fill: #fffdf6; stroke: #2a0a14; stroke-width: 3; stroke-linejoin: round; }
.piece { stroke: #2a0a14; stroke-width: 3; stroke-linejoin: round; cursor: pointer; }
.road { width: 100%; height: 16px; background: #8a6a4a; border-top: 3px solid #2a0a14; }

/* a piece of clothing lying on the floor: a small shape that says which part of her it goes on, and its name */
.chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 9px 5px 6px; border: 2px solid #2a0a14; border-radius: 14px 4px 14px 4px; color: #2a0a14; font: 14px/1.15 Georgia, serif; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; text-align: left; transform: rotate(var(--lean, 0deg)); }
.chip svg { width: 22px; height: 22px; flex: none; }
.chip svg * { fill: #fffdf6aa; stroke: #2a0a14; stroke-width: 2; stroke-linejoin: round; }
.chip:hover, .chip:focus-visible { outline: 3px solid #ffe9a8; outline-offset: 1px; }
.chip.worn { display: none; }
.chip.ghost { position: fixed; z-index: 80; pointer-events: none; transform: translate(-50%, -50%) rotate(-4deg) scale(1.08); box-shadow: 0 10px 18px #000a; cursor: grabbing; }
.on { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; min-height: 38px; margin: 10px 0 0; }
.on .chip { cursor: pointer; border-style: dashed; }
.happens { min-height: 1.5em; margin: 8px 0; text-align: center; font-style: italic; color: #ffe9a8; }

/* the little car: nowhere, then waiting down the road, then pulled up beside her */
.car { position: absolute; right: 4%; bottom: 14px; width: 34%; max-width: 110px; aspect-ratio: 2 / 1; display: block; transform: translateX(160%) scale(.3); transform-origin: 100% 100%; opacity: 0; transition: transform .8s cubic-bezier(.2,.8,.3,1), opacity .5s ease; }
.car i { position: absolute; display: block; }
.car .body { left: 0; right: 0; bottom: 16%; height: 46%; background: #d8508f; border: 3px solid #2a0a14; border-radius: 10px 16px 6px 6px; }
.car .roof { left: 22%; right: 26%; bottom: 58%; height: 36%; background: #bfe3ea; border: 3px solid #2a0a14; border-radius: 12px 12px 0 0; }
.car .wheel { bottom: 0; width: 24%; aspect-ratio: 1; border-radius: 50%; background: #2a1c2e; border: 3px solid #c9c9d1; }
.car .wheel.a { left: 10%; } .car .wheel.b { right: 10%; }
.car.near { opacity: .55; transform: translateX(34%) scale(.34); }
.car.here { opacity: 1; transform: none; cursor: pointer; }
.car.here:hover, .car.here:focus-visible { outline: 3px solid #ffe9a8; outline-offset: 4px; }
.car.off { transition: transform .9s ease-in; transform: translateX(-420%); }

.tiny { position: fixed; left: 8px; bottom: 8px; width: 18px; padding: 4px 3px; display: grid; gap: 2px; opacity: .35; }
.tiny i { height: 2px; background: #f2e2c4; display: block; }
.tiny:hover, .tiny:focus-visible { opacity: 1; outline: none; }

@media (max-width: 720px) {
  .room { grid-template-columns: 1fr; }
  .stage { order: -1; position: static; }
}

/* things that happen */
@media (prefers-reduced-motion: no-preference) {
  .doll.dance { animation: dance 1.8s ease-in-out; } @keyframes dance { 0%,100% { transform: none; } 15% { transform: rotate(-9deg) translateX(-8px); } 30% { transform: rotate(9deg) translateX(8px); } 45% { transform: rotate(-9deg) translateY(-10px); } 60% { transform: rotate(9deg); } 80% { transform: rotate(-5deg); } }
  .doll.roll { animation: roll 2.4s ease-in-out; } @keyframes roll { 0% { transform: none; } 45% { transform: translateX(220%); } 46% { transform: translateX(-320%); } 100% { transform: none; } }
  .doll.spin { animation: spin 1.3s ease-in-out; } @keyframes spin { to { transform: rotateY(720deg); } }
  .doll.float { animation: float 3s ease-in-out; } @keyframes float { 0%,100% { transform: none; } 50% { transform: translateY(-30px); } }
  .doll.curtsy { animation: curtsy 1.2s ease-in-out; } @keyframes curtsy { 50% { transform: scaleY(.86); } }
  .doll.fall { animation: fall 2.2s ease-in; } @keyframes fall { 0% { transform: none; } 30%,80% { transform: rotate(88deg); } 100% { transform: none; } }
  .doll.drive { animation: drive 1.6s ease-in forwards; } @keyframes drive { to { transform: translateX(-420%); } }
  .doll.circle { animation: circle 3s linear; } @keyframes circle { 25% { transform: translate(40px,-20px); } 50% { transform: translate(0,-40px) scaleX(-1); } 75% { transform: translate(-40px,-20px) scaleX(-1); } }
  .doll.honk #headgroup { animation: honk .4s ease 2; transform-origin: 100px 52px; transform-box: view-box; } @keyframes honk { 50% { transform: scale(1.18); } }
  .doll.lookaway #headgroup { animation: away 2.4s ease; transform-origin: 100px 52px; transform-box: view-box; } @keyframes away { 20%,80% { transform: scaleX(-1) rotate(-12deg); } }
  .stage.flicker { animation: flick 1.4s steps(2, jump-none) 1; } @keyframes flick { 0%,30%,60% { filter: brightness(.35); } 15%,45%,100% { filter: none; } }
  .bit { position: absolute; top: -12px; width: 8px; height: 12px; animation: drop 2.2s linear forwards; pointer-events: none; } @keyframes drop { to { transform: translateY(420px) rotate(540deg); opacity: .2; } }
  .bit.rain { width: 2px; height: 16px; background: #bfe3ea; animation-duration: .9s; }
  .doll.shiver { animation: shiver .9s linear 2; } @keyframes shiver { 0%,100% { transform: none; } 25% { transform: translateX(-3px) rotate(-1deg); } 75% { transform: translateX(3px) rotate(1deg); } }
  .doll.wave { animation: wave 1.6s ease-in-out; } @keyframes wave { 0%,100% { transform: none; } 20%,60% { transform: rotate(6deg) translateY(-4px); } 40%,80% { transform: rotate(-4deg); } }
  .doll.hide { animation: hide 2.8s ease-in-out; } @keyframes hide { 0%,100% { transform: none; } 30%,55% { transform: translateY(78%); } 70% { transform: translateY(58%); } 82% { transform: translateY(78%); } }
  .doll.yawn { animation: yawn 2s ease-in-out; } @keyframes yawn { 40% { transform: scaleY(1.08) translateY(-8px); } 70% { transform: scaleY(.96); } }
  .doll.hop { animation: hop .6s ease-out; } @keyframes hop { 40% { transform: translateY(-30px); } }
  .doll.sneeze #headgroup { animation: sneeze 1.1s ease-in-out; transform-origin: 100px 52px; transform-box: view-box; } @keyframes sneeze { 30% { transform: translateY(-6px) scale(1.06); } 45% { transform: translateY(10px) rotate(14deg); } }
  .doll.sing { animation: sing 2.6s ease-in-out; } @keyframes sing { 0%,100% { transform: none; } 25% { transform: rotate(-6deg) translateY(-6px); } 50% { transform: rotate(5deg) translateY(-10px); } 75% { transform: rotate(-3deg) translateY(-4px); } }
  .doll.nod #headgroup { animation: nod 1.8s ease-in-out; transform-origin: 100px 52px; transform-box: view-box; } @keyframes nod { 20%,60% { transform: translateY(5px) rotate(4deg); } 40%,80% { transform: translateY(-2px) rotate(-3deg); } }
  .doll.sit { animation: sit 2.4s ease-in-out forwards; } @keyframes sit { 30%,100% { transform: translateY(14%) scaleY(.82); } }
}
.back { position: absolute; left: 4%; bottom: 14px; width: 15%; max-width: 54px; aspect-ratio: 1 / 2; background: #7a5230; border: 3px solid #2a0a14; border-bottom: 0; border-radius: 26px 26px 0 0; display: block; }
.back .knob { position: absolute; right: 16%; top: 54%; width: 16%; aspect-ratio: 1; border-radius: 50%; background: #c9a24b; }
.back:hover, .back:focus-visible { background: #8a6240; outline: 3px solid #ffe9a8; outline-offset: 3px; }
