/* features.css — Doll Shelf, dressing view, Knitting Bag, Infinite Scarf and its "How long is it?" view. */

/* ---------- Doll Shelf */
.dolls-screen { display: flex; flex-direction: column; }
.doll-shelf { flex: 1; position: relative; min-height: 0; display: flex; flex-direction: column; justify-content: center; padding: 6px 0 4px; }
.shelf-row { display: grid; gap: 4px; padding: 0 46px; height: min(100%, 640px); align-items: stretch; }
.shelf-row.one { padding: 0 calc(10px + var(--sar)) 0 calc(10px + var(--sal)); }
.doll-cell { position: relative; border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; min-height: 0; min-width: 0; }
.doll-cell .doll-stage { flex: 1; width: 100%; min-height: 0; position: relative; }
.doll-cell .doll-stage canvas { position: absolute; left: 0; bottom: 0; pointer-events: none; }
.doll-cell .board { width: 112%; height: 30px; margin: -10px 0 0; flex: none; background: url('assets/items/gallery-shelf.png') center / 100% 100% no-repeat; filter: drop-shadow(0 6px 6px rgba(20, 8, 10, 0.45)); }
.doll-cell .tag { font-family: 'Caveat', cursive; font-size: 21px; background: #f3e6cc; color: var(--ink); padding: 0 12px; border-radius: 4px; margin-top: 4px; box-shadow: var(--shadow-sm); flex: none; }
.doll-cell .lock-note { text-wrap: pretty; overflow-wrap: break-word; position: absolute; left: 2%; right: 2%; top: 24%; z-index: 2; background: rgba(34, 22, 46, 0.82); color: var(--cream); border-radius: 12px; padding: 7px 8px; font-size: 13px; line-height: 1.25; display: block; text-align: left; box-shadow: var(--shadow-sm); }
.doll-cell .lock-note .icw { float: left; margin: 1px 4px 0 0; }
.doll-cell .lock-note .ic { width: 14px; height: 14px; color: var(--honey-lt); }
@media (max-width: 500px) { .doll-cell .lock-note { font-size: 12px; padding: 6px 7px; } }
.doll-cell:not(.locked):hover .doll-stage { filter: drop-shadow(0 0 10px rgba(242, 212, 138, 0.55)); }
.doll-shelf.with-toys .shelf-row { height: auto; flex: 1 1 0; min-height: 0; }
.toy-shelf { flex: none; position: relative; padding: 4px 46px calc(10px + var(--sab)); display: grid; grid-template-columns: minmax(0, max-content); justify-content: center; }
.toy-row { padding: 0 34px; min-width: min(100%, 300px); display: flex; gap: 14px; justify-content: center; align-items: flex-end; height: clamp(60px, 16vh, 140px); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; position: relative; z-index: 1; }
.toy-cell { flex: none; height: 100%; width: clamp(70px, 14vh, 128px); border: 0; background: none; padding: 0; display: flex; align-items: flex-end; justify-content: center; }
.toy-stage { width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.toy-stage canvas { filter: drop-shadow(1px 5px 4px rgba(20, 8, 10, 0.45)); transform-origin: 50% 100%; }
.toy-cell.arrive canvas { animation: plop 0.8s cubic-bezier(.2,1.4,.5,1) both; }
.toy-cell.hop canvas { animation: hop 0.45s ease-out; }
@keyframes plop { 0% { transform: translateY(-60px) scale(0.7, 1.2); opacity: 0; } 60% { transform: translateY(0) scale(1.12, 0.86); opacity: 1; } 100% { transform: none; } }
@keyframes hop { 0%, 100% { transform: none; } 30% { transform: translateY(-14px) scale(0.95, 1.06); } 60% { transform: scale(1.06, 0.94); } }
.toy-board { height: 32px; margin: -10px 0 0; background: url('assets/items/gallery-shelf.png') center / 100% 100% no-repeat; filter: drop-shadow(0 6px 6px rgba(20, 8, 10, 0.45)); }
.shelf-dots { display: flex; gap: 6px; justify-content: center; padding-top: 8px; }
.shelf-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(246, 236, 217, 0.35); }
.shelf-dots i.on { background: var(--honey-lt); }

/* ---------- dressing view */
.dress { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 4px 8px calc(8px + var(--sab)); gap: 8px; }
.dress-stage { flex: 1; min-height: 0; position: relative; border-radius: 18px; background: radial-gradient(ellipse at 50% 40%, rgba(255, 236, 196, 0.42), rgba(60, 30, 30, 0.12) 70%); }
.dress-stage canvas { position: absolute; left: 0; bottom: 0; }
.dress-name { position: absolute; left: 0; right: 0; top: 6px; text-align: center; color: var(--cream); font-size: 14px; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); pointer-events: none; }
.dress-name b { font-family: 'Caveat', cursive; font-size: 24px; color: var(--honey-lt); }
.slot-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; flex: none; }
.slot-btns.two { grid-template-columns: repeat(2, 1fr); }
.slot-btn { border: 0; border-radius: 14px; background: rgba(251, 244, 230, 0.92); display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px; min-height: 52px; text-align: left; box-shadow: var(--shadow-sm); min-width: 0; }
.slot-btn .th { width: 44px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: rgba(91, 58, 94, 0.12); }
.slot-btn .th .ic { width: 26px; height: 26px; color: var(--plum); }
.slot-btn .nm { font-weight: 600; color: var(--plum); font-size: 15px; min-width: 0; display: flex; flex-direction: column; }
.slot-btn .nm small { font-weight: 400; color: var(--ink-soft); font-size: 12px; line-height: 1.15; overflow-wrap: anywhere; text-wrap: balance; }
@media (max-width: 500px) { .slot-btn { gap: 4px; padding-right: 5px; } .slot-btn .th { width: 36px; } .slot-btn .nm { font-size: 14px; } .slot-btn .nm small { font-size: 11px; } }
.slot-btn.worn { box-shadow: var(--shadow-sm), inset 0 0 0 2px var(--sage); }
@media (min-width: 700px), (max-height: 500px) {
  .dressing .dress { flex-direction: row; }
  .dressing .slot-btns { grid-template-columns: 1fr; width: 250px; align-content: center; }
  .dressing .slot-btns.two { grid-template-columns: 1fr; }
}
/* big screens: the dressing panel grows with the room */
.dressing .slot-btns { zoom: var(--pz, 1); }
@media (max-height: 500px) { .dressing .slot-btns { grid-template-columns: 1fr 1fr; width: 330px; } .slot-btn { min-height: 46px; } }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.slot-piece { position: relative; border: 0; border-radius: 14px; background: var(--cream); padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 130px; }
.slot-piece .pv { height: 80px; display: flex; align-items: center; justify-content: center; }
.slot-piece .pv .ic.big, .slot-piece .icw.big .ic { width: 48px; height: 48px; color: var(--plum); }
.slot-piece .nm { font-family: 'Caveat', cursive; font-size: 20px; line-height: 1; }
.slot-piece small { color: var(--ink-soft); font-size: 12px; }
.slot-piece.on { box-shadow: 0 0 0 3px var(--sage-dk); }
.slot-piece .tick { position: absolute; top: 6px; right: 6px; background: var(--sage-dk); color: #fff; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.slot-piece .tick .ic { width: 16px; height: 16px; }
.slot-acts { display: flex; justify-content: center; margin-top: 12px; }
.empty-note.dark { background: var(--cream); color: var(--ink-soft); }

/* ---------- Knitting Bag */
.bag-screen { overflow-y: auto; touch-action: pan-y; }
.bag-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.bag-tabs .tab { position: relative; }
.bag-tabs .dot { position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--honey); box-shadow: 0 0 0 2px var(--paper); }
.bag-preview { position: relative; height: clamp(150px, 26vh, 240px); border-radius: 18px; overflow: hidden; margin: 8px 0 12px; background: radial-gradient(circle at 40% 30%, #8a6585, #4a2f4d); box-shadow: var(--shadow); }
.bag-preview canvas { width: 100%; height: 100%; display: block; }
.bag-preview .pv-label { position: absolute; right: 10px; bottom: 8px; background: rgba(34, 22, 46, 0.78); color: var(--cream); border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 600; max-width: calc(100% - 20px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.bag-card { position: relative; border: 0; border-radius: 14px; background: var(--paper); box-shadow: var(--shadow-sm); padding: 8px 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-height: 150px; }
.bag-card .thumb { width: 100%; height: 84px; display: block; }
.bag-grid.dolls .bag-card .thumb { height: 130px; }
.bag-card .nm { font-weight: 600; color: var(--ink); font-size: 15px; line-height: 1.15; }
.bag-card .sub { font-size: 12px; color: var(--ink-soft); }
.bag-card .lock { text-wrap: pretty; font-size: 12.5px; color: var(--plum); font-weight: 600; display: flex; gap: 4px; align-items: flex-start; line-height: 1.25; text-align: left; }
.bag-card .lock .ic { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.bag-card.locked { background: rgba(251, 244, 230, 0.6); }
.bag-card.locked .nm { color: var(--ink-soft); }
.bag-card.on { box-shadow: var(--shadow-sm), 0 0 0 3px var(--sage-dk); }
.bag-card .tick { position: absolute; top: 6px; left: 6px; background: var(--sage-dk); color: #fff; border-radius: 50%; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; }
.bag-card .tick .ic { width: 16px; height: 16px; }
.bag-card .badge { top: 4px; right: 4px; }
.bag-note { color: var(--ink-soft); font-size: 14px; margin-top: 12px; }

/* ---------- Infinite Scarf */
.scarf-screen.lay-port { grid-template-columns: 150px 1fr; grid-template-areas: "top top" "work work" "basket preview" "panel panel"; }
.scarf-screen.lay-port .basket-slot { width: 150px; }
.scarf-screen .preview-slot { justify-content: stretch; }
.scarf-len { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; padding: 2px 10px 2px 4px; color: var(--cream); text-align: right; gap: 2px; min-width: 0; }
.scarf-len .num { display: flex; align-items: baseline; gap: 4px; font-weight: 700; font-size: 38px; line-height: 1; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); color: var(--honey-lt); }
.scarf-len .digits { display: inline-flex; height: 1em; }
.scarf-len .dg { display: inline-block; height: 1em; overflow: hidden; width: 0.62em; text-align: center; }
.scarf-len .dg .col { display: flex; flex-direction: column; transition: transform 0.35s cubic-bezier(.3, 1.4, .5, 1); }
.scarf-len .dg .col span { height: 1em; line-height: 1em; }
.scarf-len .dg .col span::before { content: attr(data-d); }
.scarf-len .sep { display: inline-block; line-height: 1em; }
.scarf-len .unit { font-size: 0.5em; color: var(--cream); }
.scarf-len .next { font-size: 13px; line-height: 1.2; opacity: 0.95; max-width: 100%; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); }
.how-btn { border: 0; border-radius: 999px; background: var(--cream); color: var(--plum); font-weight: 600; font-size: 14px; min-height: 34px; padding: 0 12px; display: inline-flex; align-items: center; gap: 4px; box-shadow: var(--shadow-sm); }
.how-btn .ic { width: 18px; height: 18px; }
.scarf-screen.lay-land .scarf-len { align-items: center; text-align: center; padding: 2px 4px; }
.scarf-screen.lay-land .scarf-len .num { font-size: 26px; }
.scarf-screen.lay-land .scarf-len .next { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.scarf-screen.lay-land .how-btn { font-size: 12px; min-height: 30px; padding: 0 8px; }
.scarf-screen.lay-land { grid-template-rows: auto 150px 1fr 84px; }
.scarf-screen.lay-desk .scarf-len { align-items: center; text-align: center; padding: 10px; gap: 8px; }
.scarf-screen.lay-desk .scarf-len .num { font-size: 64px; }
.scarf-screen.lay-desk .scarf-len .next { font-size: 17px; }
.scarf-screen.lay-desk .how-btn { font-size: 17px; min-height: 46px; padding: 0 20px; }
.stitch-btn .sp { font-size: 10px; line-height: 1.05; }
.scarf-pop { position: absolute; left: 0; right: 0; top: 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; z-index: 3; }
.scarf-pop > * { pointer-events: auto; }
.fact-pop { border: 0; max-width: min(92%, 420px); background: rgba(251, 244, 230, 0.96); color: var(--ink); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); text-align: left; display: flex; flex-direction: column; gap: 2px; animation: toastin 0.3s ease; font: inherit; }
.fact-pop .hd { font-size: 12px; font-weight: 700; color: var(--cranberry); text-transform: uppercase; letter-spacing: 0.05em; }
.fact-pop .tx { font-size: 15px; line-height: 1.3; }
.fact-pop.out, .ribbon-pop.out { opacity: 0; transform: translateY(-10px); transition: 0.35s; }
.ribbon-pop { display: flex; align-items: center; gap: 10px; padding: 8px 18px 8px 10px; color: #fff6ea; background: linear-gradient(#c8404f, var(--cranberry-dk)); border-radius: 8px; box-shadow: var(--shadow); clip-path: polygon(0 0, 100% 0, 96% 50%, 100% 100%, 0 100%, 4% 50%); animation: unfurl 0.5s cubic-bezier(.2, 1.3, .5, 1); max-width: 92%; }
.ribbon-pop img { height: 56px; width: auto; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4)); margin-left: 8px; }
.ribbon-pop b { display: block; font-size: 18px; }
.ribbon-pop span { font-size: 13px; opacity: 0.9; }
@keyframes unfurl { from { transform: scaleX(0.1); opacity: 0; } }
.stitch-picker .sp-note { color: var(--ink-soft); font-size: 14px; }
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.sp-card { position: relative; border: 0; border-radius: 14px; background: var(--cream); padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.sp-card .pv { height: 110px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sp-card b { color: var(--plum); }
.sp-card small { color: var(--ink-soft); font-size: 12px; line-height: 1.2; }
.sp-card.on { box-shadow: 0 0 0 3px var(--sage-dk); }
.sp-card.locked { opacity: 0.75; }
.sp-card .tick { position: absolute; top: 6px; right: 6px; background: var(--sage-dk); color: #fff; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.sp-card .tick .ic { width: 16px; height: 16px; }

/* the scarf's rows are short: its card is two lines tall (the knitting screens' three) */
.scarf-screen.lay-port .strip { min-height: 56px; }
.scarf-screen.lay-desk .strip { min-height: 72px; }

/* "How long is it?" */
.scarf-screen > .howlong { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; background: #241933; touch-action: pan-y; }
.how-top { display: flex; align-items: center; gap: 10px; padding: calc(8px + var(--sat)) calc(10px + var(--sar)) 8px calc(10px + var(--sal)); background: rgba(34, 22, 46, 0.92); color: var(--cream); }
.how-top h2 { flex: 1; font-size: 20px; }
.how-top .btn.small { min-height: 40px; padding: 0 14px; font-size: 15px; gap: 4px; }
.how-top .how-len { font-weight: 700; color: var(--honey-lt); font-size: 20px; }
.how-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.how-stage { flex: 1.4; min-height: 0; position: relative; }
.how-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.how-cards { flex: 1; min-height: 0; overflow-y: auto; touch-action: pan-y; padding: 10px 12px calc(12px + var(--sab)); display: flex; flex-direction: column; gap: 8px; background: rgba(34, 22, 46, 0.6); }
@media (min-width: 700px), (max-height: 500px) { .how-body { flex-direction: row; } .how-cards { flex: none; width: min(40%, 380px); } }
.hcard { background: var(--paper); border-radius: 14px; padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; box-shadow: var(--shadow-sm); }
.hcard img, .hcard canvas.sil { width: 56px; height: 56px; object-fit: contain; flex: none; border-radius: 8px; }
.hcard h3 { font-size: 16px; color: var(--plum); line-height: 1.2; }
.hcard small { color: var(--cranberry); font-weight: 600; font-size: 13px; }
.hcard p { margin: 3px 0 0; font-size: 14px; line-height: 1.3; }
.hcard.next { box-shadow: var(--shadow-sm), inset 0 0 0 2px var(--honey); }
.hcard .at { flex: none; font-weight: 700; color: var(--sage-dk); font-size: 13px; min-width: 46px; }
.hcard.fact p, .hcard.stat p { margin: 0; }
.hcard.someday.passed { opacity: 0.7; }
.hsec { color: var(--honey-lt); font-size: 15px; margin: 6px 2px 0; }
.hnote { color: var(--cream); font-size: 14px; }
.bpiece .nm { display: inline-flex; align-items: center; gap: 4px; } .bpiece .nm .ic { width: 15px; height: 15px; color: var(--plum); }
.fact-pop { text-wrap: pretty; }
.hcard p { text-wrap: balance; }
.scarf-len .next, .hcard h3, .hcard small, .slot-piece .nm { text-wrap: balance; }
.bag-card .nm, .bag-card .lock, .doll-cell .lock-note { text-wrap: balance; }
