#market-root{width:min(520px,calc(100% - 24px));margin:10px auto 20px}
#market-root h1{font-size:27px;margin:8px 0;line-height:1.2}
#market-status{min-height:2.5em;font-size:16px;font-weight:700;margin:8px auto;max-width:470px}
#market-root.is-playing h1{display:table;max-width:100%;margin:12px auto 8px;padding:6px 14px;border:2px solid #83b8ba;border-radius:24px;background:#f9fcf0;font-size:15px;line-height:1.4;color:#38616a}
#market-root.is-playing #market-status{font-size:21px;line-height:1.35;min-height:2.7em;margin:10px auto 8px}
.market-board{position:relative;display:grid;gap:10px;padding:12px;background:#e3f5ed;border-radius:20px}
.market-order{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:8px 14px;min-height:84px;padding:8px;background:#fffdf2;border:2px solid #a2cfce;border-radius:14px}
.order-line{display:flex;align-items:center;gap:8px}
.order-line img{width:56px;height:56px;object-fit:contain}
.order-number{font-size:30px;font-weight:800;color:#234653;min-width:1ch}
.order-dots{display:flex;flex-wrap:wrap;gap:4px;max-width:70px}
.order-dots i{width:12px;height:12px;border-radius:50%;background:#cc7a43;display:block}
.order-guests{display:flex;gap:4px;align-items:center}
.order-guests img{width:48px;height:48px;object-fit:contain}
.order-arrow{font-size:22px;color:#317e89}
.market-basket.is-over{border:3px solid #b87923;background-color:#f6d76930}
.market-basket.is-solved{border-style:solid;border-color:#51996a}
.market-tray{display:flex;justify-content:center;flex-wrap:wrap;gap:10px;margin:10px auto;max-width:420px}
.tray-item{position:relative;width:96px;height:96px;min-width:44px;min-height:44px;margin:0;padding:8px;background:#fffdf4;border:3px solid #a2cfce;box-shadow:0 4px 0 #add9df;border-radius:12px;touch-action:none;user-select:none;-webkit-user-select:none}
.tray-item:hover:not(:disabled){background:#fff0bb}
.tray-item img{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}
.tray-item.is-dragging{opacity:.4}
.tray-item:disabled{opacity:.45}
.tray-left{position:absolute;right:4px;bottom:4px;min-width:24px;height:24px;display:grid;place-items:center;padding:0 5px;border-radius:12px;background:#234653;color:#fff;font-size:14px;font-weight:800}
.market-ghost{position:fixed;z-index:50;width:70px;height:70px;transform:translate(-50%,-50%);pointer-events:none;object-fit:contain;filter:drop-shadow(0 4px 4px #23465340)}
.market-actions{display:flex;justify-content:center;gap:10px;margin:6px auto}
#market-done,#market-next,#market-retry{background:#cc573d;box-shadow:0 4px 0 #a43f26}
#market-done{min-height:48px;padding:8px 26px;font-size:18px}
#market-done.is-retry,.market-basket.is-retry{border-color:#c46560;animation:market-nudge .32s ease-in-out}
.market-basket.is-retry{background-color:#fff0ed}
.market-retry-icon{display:none;position:absolute;top:6px;right:6px;width:28px;height:28px;place-items:center;border-radius:50%;background:#bd4a47;color:#fff;font-size:25px;line-height:1;pointer-events:none}
.market-basket.is-retry .market-retry-icon{display:grid}
#market-restart{background:#ffe06c;color:#624b19;box-shadow:0 2px 0 #c4a348}
#market-success{padding:12px;margin:10px auto;max-width:330px}
#market-success h2{font-size:24px}
#market-progress{font-size:14px;min-height:1.5em;margin:8px auto}
@keyframes market-nudge{0%,100%{transform:translateX(0)}25%{transform:translateX(-4px)}60%{transform:translateX(4px)}80%{transform:translateX(-2px)}}
@media(prefers-reduced-motion:reduce){#market-done.is-retry,.market-basket.is-retry{animation:none}}
@media(max-width:420px){#market-root h1{font-size:24px}#market-status{font-size:15px}#market-root.is-playing h1{font-size:13px;padding:5px 12px}#market-root.is-playing #market-status{font-size:19px}.tray-item{width:84px;height:84px}.order-line img{width:48px;height:48px}}
.market-sample-order{display:flex;align-items:center;justify-content:center;gap:4px;width:100%;height:100%}
.market-sample-order img{width:48px;height:48px;object-fit:contain}.market-sample-order b{font-size:26px;color:#234653}
.market-sample-basket{position:relative;display:block;width:100%;height:100%}
.market-sample-basket-art{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.market-sample-items{position:absolute;left:0;right:0;top:4px;display:flex;justify-content:center;gap:2px}
.market-sample-items img{width:32px;height:32px;object-fit:contain}
.order-guests img.is-friend,.order-line img.is-friend{width:60px;height:60px}
.order-group{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:4px;max-width:260px}
.order-group img{width:38px;height:38px;object-fit:contain}
.order-group .group-empty{width:64px;height:64px;opacity:.5}
.order-group.is-focus{outline:3px dashed #b87923;outline-offset:4px;border-radius:10px}
.order-plus{font-size:24px;color:#317e89}
.order-unknown{font-size:34px;font-weight:800;color:#b87923}
.order-share{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:12px}
.order-friends{display:flex;gap:4px}.order-friends img{width:54px;height:54px;object-fit:contain}
.order-sequence{display:flex;gap:6px;justify-content:center}
.sequence-cell{display:grid;place-items:center;min-width:44px;height:52px;padding:0 6px;border:2px solid #a2cfce;border-radius:10px;background:#fffdf4;font-size:30px;font-weight:800;color:#234653}
.sequence-cell.is-missing{border:3px dashed #b87923;color:#b87923}
.market-answer{display:grid;place-items:center;min-height:88px;border:2px dashed #247787;border-radius:14px;background:#fffdf2;pointer-events:none}
.market-answer>span{font-size:34px;font-weight:800;color:#b87923}
.market-answer.is-over{border:3px solid #b87923;background-color:#f6d76930}
.market-answer.is-solved{border-style:solid;border-color:#51996a}
.market-answer.is-retry{border-color:#c46560;background:#fff0ed;animation:market-nudge .32s ease-in-out}
.market-answer.is-solved>span{color:#234653}
.market-answer .answer-group{display:flex;flex-wrap:wrap;justify-content:center;gap:3px;max-width:200px}.market-answer .answer-group img{width:32px;height:32px;object-fit:contain}
.market-choices{display:flex;justify-content:center;flex-wrap:wrap;gap:12px;margin:10px auto;max-width:420px}
.choice-card{min-width:84px;min-height:84px;margin:0;padding:8px 12px;background:#fffdf4;border:3px solid #a2cfce;box-shadow:0 4px 0 #add9df;border-radius:12px;font-size:40px;font-weight:800;color:#234653;touch-action:none;user-select:none;-webkit-user-select:none}
.choice-card:hover:not(:disabled){background:#fff0bb}
.choice-card.is-dragging{opacity:.4}
.choice-card .choice-group{display:flex;flex-wrap:wrap;justify-content:center;gap:2px;max-width:150px;pointer-events:none}.choice-card .choice-group img{width:30px;height:30px;object-fit:contain}
.choice-card.is-retry{border-color:#c46560;background:#fff0ed;box-shadow:0 4px 0 #d8a5a0;animation:market-nudge .32s ease-in-out}
.market-ghost-card{position:fixed;z-index:50;transform:translate(-50%,-50%);pointer-events:none;padding:6px 14px;border:3px solid #a2cfce;border-radius:12px;background:#fffdf4;font-size:36px;font-weight:800;color:#234653;filter:drop-shadow(0 4px 4px #23465340)}
.market-cheer{position:relative;margin:0 auto 6px;width:150px;aspect-ratio:1;background-repeat:no-repeat}
.market-board,.market-tray,.market-choices,.market-actions,.market-answer{user-select:none;-webkit-user-select:none}
@media(prefers-reduced-motion:reduce){.market-answer.is-retry,.choice-card.is-retry{animation:none}}
.order-dots{max-width:76px}

.market-basket{position:relative;padding:10px 8px 0;border:2px dashed #247787;border-radius:14px;overflow:visible}
.basket-stage{display:block;position:relative;width:min(100%,360px);margin:0 auto;aspect-ratio:1100/902;transform-origin:50% 100%}
.basket-back,.basket-front{position:absolute;left:0;bottom:0;width:100%;height:auto;pointer-events:none;user-select:none;-webkit-user-select:none}
.basket-front{z-index:3;clip-path:inset(59.5% 0 0 0)}
.basket-pile{display:block;position:absolute;inset:0;z-index:2}
.pile-item{position:absolute;width:15%;aspect-ratio:1;margin:0 0 0 -7.5%;padding:0;min-height:0;border:0;border-radius:0;background:none;box-shadow:none;cursor:pointer;transform:rotate(var(--tilt,0deg));filter:drop-shadow(0 3px 2px #5b3a1a55);-webkit-tap-highlight-color:transparent}
.pile-item:hover:not(:disabled){background:none;filter:drop-shadow(0 3px 2px #5b3a1a55) brightness(1.06)}
.pile-item:focus-visible{outline:3px solid #08798e;outline-offset:2px;border-radius:12px}
.pile-item img{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}
.pile-item.is-new{animation:pile-drop .62s cubic-bezier(.3,.7,.4,1) both;animation-delay:calc(var(--i,0)*120ms)}
.pile-item.is-leaving{animation:pile-out .26s ease-in forwards;pointer-events:none}
.basket-stage.is-bump{animation:basket-bump .38s ease-out}
.basket-stage.is-full{animation:basket-tada 1s ease-in-out}
.basket-stage.is-full .pile-item{animation:pile-cheer .7s ease-in-out calc(var(--i,0)*70ms) 2}
.basket-hint{display:block;position:absolute;left:0;right:0;top:22%;z-index:2;text-align:center;font-size:15px;color:#317e89;pointer-events:none}
.market-drop{position:absolute;left:50%;top:30%;width:15%;aspect-ratio:1;margin-left:-7.5%;border-radius:12px;pointer-events:none;z-index:2}
.market-basket .market-retry-icon{z-index:5}
.market-pop{animation:market-pop .5s cubic-bezier(.3,1.5,.5,1) both;animation-delay:calc(var(--i,0)*70ms)}
.market-rise{animation:market-rise .5s cubic-bezier(.2,.9,.3,1.2) both;animation-delay:calc(var(--i,0)*90ms)}
.market-stamp{display:inline-block;animation:market-stamp .55s cubic-bezier(.3,1.6,.5,1) both}
.market-answer.is-solved{animation:basket-tada .9s ease-in-out}
@keyframes pile-drop{0%{opacity:0;transform:translateY(-330%) rotate(calc(var(--tilt,0deg) - 25deg)) scale(1.15)}55%{opacity:1;transform:translateY(6%) rotate(var(--tilt,0deg)) scale(1.1,.86)}75%{transform:translateY(-9%) rotate(var(--tilt,0deg)) scale(.96,1.06)}100%{opacity:1;transform:translateY(0) rotate(var(--tilt,0deg)) scale(1)}}
@keyframes pile-out{to{opacity:0;transform:translateY(-130%) rotate(calc(var(--tilt,0deg) + 18deg)) scale(.8)}}
@keyframes basket-bump{0%,100%{transform:scale(1)}40%{transform:scale(1.035,.965)}70%{transform:scale(.99,1.012)}}
@keyframes basket-tada{0%,100%{transform:none}15%{transform:scale(1.05,.95)}30%{transform:scale(.97,1.04) rotate(-2.5deg)}45%{transform:scale(1.04) rotate(2.5deg)}60%{transform:rotate(-1.5deg)}80%{transform:rotate(1deg)}}
@keyframes pile-cheer{0%,100%{transform:translateY(0) rotate(var(--tilt,0deg))}40%{transform:translateY(-16%) rotate(calc(var(--tilt,0deg) + 6deg))}}
@keyframes market-pop{0%{opacity:0;transform:scale(.3) rotate(-12deg)}100%{opacity:1;transform:none}}
@keyframes market-rise{0%{opacity:0;transform:translateY(24px) scale(.9)}100%{opacity:1;transform:none}}
@keyframes market-stamp{0%{opacity:0;transform:scale(2.4) rotate(-14deg)}100%{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.pile-item.is-new,.pile-item.is-leaving,.basket-stage.is-bump,.basket-stage.is-full,.basket-stage.is-full .pile-item,.market-pop,.market-rise,.market-stamp,.market-answer.is-solved{animation:none!important}.pile-item.is-leaving{opacity:0}}
#market-missions .mission-art img{width:104px;height:104px}
#market-missions .mission-button{min-height:176px}
@media(max-width:420px){#market-missions .mission-art img{width:88px;height:88px}#market-missions .mission-button{min-height:160px}}
