/* ---------- the studio wall ---------- */
.scene { position: fixed; inset: 0; overflow: hidden; background: var(--wall); }
.wall { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }

/* printed on the wall */
.type { position: absolute; margin: 0; pointer-events: none; color: #26221D; mix-blend-mode: multiply; transition: opacity .6s, transform .8s var(--out); }
.big { margin: 0; font: 800 1em/.86 var(--f-sans); font-stretch: 125%; letter-spacing: -.012em; text-transform: uppercase; }
.big span { display: block; }
.big span + span { margin-top: .04em; }
.sub { margin: .9em 0 0; font: 500 max(13px, .085em)/1.5 var(--f-sans); letter-spacing: .01em; color: #5E584F; }
.sub b { font-weight: 700; color: #26221D; }
.type.away { opacity: 0; transform: translateY(12px); }
.score { position: absolute; left: 50%; transform: translateX(-50%); margin: 0; display: grid; justify-items: center; pointer-events: none; color: #26221D; mix-blend-mode: multiply; }
.score b { font: 800 1em/.82 var(--f-sans); font-stretch: 125%; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.score small { font: 700 13px var(--f-sans); letter-spacing: .3em; text-transform: uppercase; color: #5E584F; margin-top: 10px; }
.score.bump b { animation: bump .5s var(--out); }
.score { transition: opacity .4s; }
.score.dim { opacity: .12; }
@keyframes bump { 30% { transform: scale(1.08); } }

/* ---------- the garment bag ---------- */
.hang { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; will-change: transform; }
.hang > * { position: absolute; }
.hang-shadow { border-radius: 16px; background: rgba(80, 58, 36, .2); filter: blur(20px); pointer-events: none; }
.coat { pointer-events: none; }
.bag {
  cursor: grab; touch-action: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 10%, rgba(255, 255, 255, 0) 90%, rgba(255, 255, 255, .26)),
    linear-gradient(180deg, rgba(250, 248, 245, .42), rgba(250, 248, 245, .2) 22%, rgba(250, 248, 245, .16) 72%, rgba(250, 248, 245, .26));
  -webkit-backdrop-filter: blur(5px) saturate(.92) brightness(1.1) contrast(.9); backdrop-filter: blur(5px) saturate(.92) brightness(1.1) contrast(.9);
}
.bag:active { cursor: grabbing; }
.bag-tex { position: absolute; inset: 0; background: url(../img/wraps/plastic.webp) center / 100% 100% no-repeat; opacity: .95; pointer-events: none; }
.bag-print { position: absolute; left: 0; right: 0; top: 0; bottom: 0; pointer-events: none; color: rgba(29, 27, 24, .82); mix-blend-mode: multiply; text-align: center; }
.bag-print b { position: absolute; left: 0; right: 0; top: 30%; font: 800 calc(var(--bw) * .19)/1 var(--f-sans); font-stretch: 125%; letter-spacing: .08em; padding-left: .08em; }
.bag-print span { position: absolute; left: 0; right: 0; top: calc(30% + var(--bw) * .23); font: 700 calc(var(--bw) * .043)/1 var(--f-sans); letter-spacing: .32em; text-transform: uppercase; }
.bag-print i { position: absolute; left: 0; right: 0; bottom: 7%; font: 600 calc(var(--bw) * .04)/1 var(--f-sans); font-style: normal; letter-spacing: .4em; text-transform: uppercase; opacity: .75; }
.bag-lines { overflow: visible; pointer-events: none; }
.bag-lines .bind { fill: none; stroke: rgba(255, 255, 255, .9); stroke-width: 2.6; stroke-linejoin: round; }
.bag-lines .bind-sh { fill: none; stroke: rgba(70, 55, 40, .14); stroke-width: 4.5; stroke-linejoin: round; transform: translate(.6px, 1px); }
.bag-lines .tape { stroke: rgba(236, 233, 228, .75); stroke-width: 9; stroke-linecap: round; }
.bag-lines .teeth { stroke: #B7BAC0; stroke-width: 4; stroke-dasharray: 1.3 1.5; }
.bag-lines .teeth-open { stroke: #BFC2C7; stroke-width: 3; stroke-dasharray: 1.3 1.6; }
.label {
  padding: 3px 7px; background: #1D1B18; color: #EFE8DE; border-radius: 1px; pointer-events: none;
  font: 800 calc(var(--bw) * .036)/1.2 var(--f-sans); font-stretch: 125%; letter-spacing: .22em; box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.zip { width: 34px; height: 64px; margin-left: -17px; cursor: ns-resize; touch-action: none; }
.zip-slider {
  position: absolute; left: 50%; top: 0; width: 13px; height: 17px; margin-left: -6.5px; border-radius: 3px 3px 5px 5px;
  background: linear-gradient(90deg, #8D9096, #F2F3F5 45%, #C9CCD1 60%, #7E8186); box-shadow: 0 2px 3px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .7);
}
.zip-pull {
  position: absolute; left: 50%; top: 12px; width: 10px; height: 30px; margin-left: -5px; border-radius: 3px 3px 5px 5px; transform-origin: 50% 2px;
  background: linear-gradient(90deg, #7E8186, #E9EAEC 45%, #C2C5CA 60%, #74777C); box-shadow: 0 3px 4px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.zip-pull::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: rgba(60, 60, 60, .55); }
.zip:hover .zip-pull { filter: brightness(1.08); }
.string { overflow: visible; pointer-events: none; }
.string path { fill: none; stroke: #CFC6B6; stroke-width: 1.4; }

/* the hang tag */
.tag { padding: 0; border: 0; background: none; perspective: 700px; transform-origin: 50% 9%; touch-action: manipulation; }
.tag-in { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .8s var(--out); }
.tag.flipped .tag-in { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 22% 8% 10%; border-radius: 4px;
  -webkit-backface-visibility: hidden; backface-visibility: hidden; color: var(--ink); text-align: center;
  background: linear-gradient(180deg, #FBF8F2, #F1EBDF); box-shadow: 0 10px 22px rgba(70, 50, 30, .22), 0 2px 4px rgba(70, 50, 30, .12), inset 0 0 0 1px rgba(255, 255, 255, .7);
  clip-path: polygon(14% 0, 86% 0, 100% 7%, 100% 100%, 0 100%, 0 7%);
}
.face.back { transform: rotateY(180deg); align-items: stretch; gap: 0; padding-top: 22%; }
.hole { position: absolute; left: 50%; top: 5.5%; width: 12%; aspect-ratio: 1; margin-left: -6%; border-radius: 50%; background: #E3DCCD; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25), 0 0 0 2.5px #C9A65A, 0 0 0 3.5px rgba(120, 90, 30, .3); }
.t-brand { font: 800 calc(var(--tw) * .17)/1 var(--f-sans); font-stretch: 125%; letter-spacing: .14em; padding-left: .14em; margin-bottom: 8%; }
.face small { font: 700 calc(var(--tw) * .07)/1.2 var(--f-sans); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); }
.face strong { font: 800 calc(var(--tw) * .46)/1 var(--f-sans); font-stretch: 125%; letter-spacing: -.02em; margin: 3% 0 2%; }
.t-clock { margin-top: 8%; font: 700 calc(var(--tw) * .075)/1.2 var(--f-sans); letter-spacing: .06em; }
.face em { margin-top: auto; font: 700 calc(var(--tw) * .065)/1 var(--f-sans); font-style: normal; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); }
.t-row { display: flex; flex-direction: column; align-items: flex-start; padding: 6% 4%; border-top: 1px solid rgba(29, 27, 24, .12); font: 700 calc(var(--tw) * .085)/1.25 var(--f-sans); text-align: left; }
.t-row small { font-size: calc(var(--tw) * .055); margin-bottom: 2px; }
.face.back .t-brand { align-self: center; }
.face.back em { align-self: center; }

.bubble {
  margin: 0; padding: 9px 13px; border-radius: 14px; white-space: nowrap; pointer-events: none;
  background: rgba(29, 27, 24, .88); color: #F4EFE6; font: 600 12.5px/1.3 var(--f-sans); box-shadow: 0 10px 24px rgba(0, 0, 0, .2);
  opacity: 0; transform: translate(-100%, 6px) scale(.96); transform-origin: 100% 0; transition: opacity .25s, transform .4s var(--out);
}
.bubble.on { opacity: 1; transform: translate(-100%, 0); }
.bubble b { color: var(--ginkgo); }

/* ---------- interface ---------- */
.top { position: fixed; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(18px + var(--safe-t)) 24px 0; pointer-events: none; z-index: 5; }
.top > * { pointer-events: auto; }
.brand { margin: 0; font: 800 15px/1 var(--f-sans); font-stretch: 125%; letter-spacing: .3em; color: var(--ink); pointer-events: none !important; }
.top-r { display: flex; gap: 10px; }
.foot { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 24px calc(22px + var(--safe-b)); pointer-events: none; z-index: 5; transition: opacity .5s, transform .6s var(--out); }
.foot > * { pointer-events: auto; }
.foot.away { opacity: 0; transform: translateY(16px); pointer-events: none; }
.foot.away > * { pointer-events: none; }
.copy { margin: 0 0 6px; font: 600 10.5px var(--f-sans); letter-spacing: .2em; text-transform: uppercase; color: #8A8377; }
.play { display: flex; align-items: center; gap: 12px; padding: 10px 20px 10px 12px; border-radius: 30px; text-align: left; }
.play svg { width: 40px; height: 28px; padding: 6px; border-radius: 50%; box-sizing: content-box; background: var(--ink); color: #F4EFE6; }
.play b { display: block; font: 700 14px/1.2 var(--f-sans); letter-spacing: .01em; }
.play small { display: block; font: 500 12px/1.3 var(--f-sans); color: var(--ink-2); }

.game { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; touch-action: none; }
body.gaming .game { pointer-events: auto; cursor: grab; }
body.gaming .bag, body.gaming .zip, body.gaming .tag { pointer-events: none; }

.hud { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 24px calc(22px + var(--safe-b)); pointer-events: none; z-index: 6; }
.hud > * { pointer-events: auto; }
.hud-l { display: grid; gap: 6px; padding-bottom: 4px; }
.lives { display: flex; gap: 8px; --hanger: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 32'%3E%3Cpath d='M24 11V9.5a3.5 3.5 0 1 1 3.5 3.5M24 11L5 23.5c-1.6 1-.9 3.5 1 3.5h36c1.9 0 2.6-2.5 1-3.5z' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.lives i { width: 30px; height: 20px; background: currentColor; color: var(--ink); -webkit-mask: var(--hanger) center / contain no-repeat; mask: var(--hanger) center / contain no-repeat; transition: opacity .3s, transform .4s var(--out); }
.lives i.lost { opacity: .18; transform: translateY(4px); }
.hud-l small { font: 600 12px var(--f-sans); letter-spacing: .04em; color: var(--ink-2); }
.wind { position: fixed; left: 50%; transform: translateX(-50%); margin: 0; padding: 7px 14px; border-radius: 20px; background: rgba(29, 27, 24, .82); color: #F4EFE6; font: 700 12px var(--f-sans); letter-spacing: .08em; text-transform: uppercase; pointer-events: none; transition: opacity .4s; }
.wind:empty { opacity: 0; }
.pill { height: 40px; padding: 0 18px; border-radius: 20px; font: 700 13px var(--f-sans); letter-spacing: .04em; }
.hint {
  position: fixed; left: 50%; transform: translateX(-50%); margin: 0; padding: 9px 14px; border-radius: 16px; z-index: 6; pointer-events: none;
  background: rgba(29, 27, 24, .86); color: #F4EFE6; font: 600 13px var(--f-sans); white-space: nowrap; animation: hintIn .6s var(--out) both;
}
.hint::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: rgba(29, 27, 24, .86); }
@keyframes hintIn { from { opacity: 0; transform: translate(-50%, 8px); } }
.pop { position: fixed; left: 0; top: 0; margin: 0; pointer-events: none; z-index: 6; font: 800 15px var(--f-sans); font-stretch: 125%; letter-spacing: .06em; color: var(--accent); opacity: 0; white-space: nowrap; }
.pop.on { animation: popUp 1.1s var(--out) forwards; }
@keyframes popUp { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.9); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.05); } 100% { opacity: 0; transform: translate(-50%, -34px) scale(1); } }

.over { position: fixed; inset: 0; z-index: 8; display: grid; place-items: center; padding: 20px; background: rgba(238, 231, 221, .35); animation: fade .4s both; }
@keyframes fade { from { opacity: 0; } }
.over-card { width: min(420px, 100%); display: grid; justify-items: center; gap: 6px; padding: 28px 24px 22px; border-radius: 28px; text-align: center; animation: rise .6s var(--out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.over-card small { font: 700 11px var(--f-sans); letter-spacing: .3em; text-transform: uppercase; color: var(--ink-2); }
.over-card small.new { color: var(--accent); }
.over-card > b { font: 800 84px/.95 var(--f-sans); font-stretch: 125%; font-variant-numeric: tabular-nums; }
.over-card p { margin: 0 0 14px; font: 500 14px/1.45 var(--f-sans); color: var(--ink-2); max-width: 30ch; }
.over-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.btn { height: 42px; padding: 0 16px; border-radius: 21px; border: 1px solid rgba(29, 27, 24, .2); background: rgba(255, 255, 255, .6); font: 700 13px var(--f-sans); transition: background .2s, transform .2s; }
.btn:hover { background: #fff; }
.btn:active { transform: scale(.96); }
.btn.dark { background: var(--ink); color: #F4EFE6; border-color: var(--ink); }

.veil { position: fixed; inset: 0; z-index: 20; background: var(--wall); transition: opacity 1s .1s; pointer-events: none; }
.veil.gone { opacity: 0; }

@media (max-width: 640px) {
  .top { padding: calc(14px + var(--safe-t)) 16px 0; }
  .brand { font-size: 13px; }
  .round { width: 40px; height: 40px; }
  .foot { padding: 0 16px calc(16px + var(--safe-b)); flex-direction: column-reverse; align-items: stretch; gap: 10px; }
  .copy { text-align: center; margin: 0; }
  .play { justify-content: center; }
  .hud { padding: 0 16px calc(16px + var(--safe-b)); }
}
