/* The Store and how cosmetics look (js/looks.js, js/cosmetics.js, js/views/store.js). The pictures are the supplied store illustrations in static/art/store (see README.md there); titles, colours, fonts, the plain
   banners and the empty defaults are live components drawn here, not pictures. Frames are transparent overlays placed by their measured opening (look.f.inset): from FRAME_IMG_MIN px up the frame is its picture,
   below that (lists, chat) it is a plain ring in the frame's colour, so a frame never spills over a neighbour. */

/* ---------- a store picture, a framed picture, a badge and a title plate (everywhere an avatar() shows up) ---------- */
.avatar.av-art { background: #EFE6D2 !important; padding: 0; color: #191814; border-radius: 18%; }
.avatar.av-art img.av-img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 4%; box-sizing: border-box; object-fit: contain; border-radius: inherit; display: block; }
.avatar.av-fr-img { border: 0 !important; border-radius: 0 !important; background: transparent !important; overflow: visible; display: block; }
.avatar.av-fr-img .av-in { position: absolute; left: var(--in-l); top: var(--in-t); right: var(--in-r); bottom: var(--in-b); border-radius: var(--in-rad, 18%); overflow: hidden; display: grid; place-items: center; background: var(--av-bg, #EFE6D2); }
.avatar.av-fr-img.av-art .av-in, .avatar.av-fr-img.av-pic .av-in { background: #EFE6D2; }
.avatar.av-fr-img .av-in img.av-img { border-radius: 0; }
.av-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; z-index: 1; display: block; }
.av-badge-img { position: absolute; right: calc(var(--bs, 22px) * -.25); bottom: calc(var(--bs, 22px) * -.25); width: var(--bs, 22px); height: var(--bs, 22px); object-fit: contain; z-index: 2; pointer-events: none; }
.who-title.plated { text-transform: none; display: inline-block; align-self: flex-start; padding: 1px 7px; margin-top: 2px; border: 1.5px solid #191814; border-radius: 6px; background: var(--tb); color: var(--tf); letter-spacing: .05em; }
.pf-title.plated { padding: 5px 10px; background: var(--tb); color: var(--tf); border: 2px solid #191814; border-radius: 7px; box-shadow: 2px 2px 0 #191814; transform: none; letter-spacing: .05em; font-weight: 500; text-transform: none; }
.pf-namerow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-width: 0; }
.pf-badge { width: 30px; height: 30px; object-fit: contain; flex: none; }
.title-pill { display: inline-block; max-width: 100%; padding: 7px 10px; border: 2px solid #191814; border-radius: 7px; box-shadow: 2px 2px 0 #191814; background: var(--tb); color: var(--tf); font: 500 11px var(--f-mono); letter-spacing: .05em; overflow-wrap: anywhere; text-align: center; }

/* what a product looks like on its stage (the store's cards, the editor's options, the buy window) */
.pa-badge-img { display: block; width: 100px; height: 100px; object-fit: contain; }
.pa-banner-img { display: block; width: 100%; height: auto; max-height: 100%; object-fit: contain; }
.pa-empty { max-width: 190px; text-align: center; font-size: 12px; line-height: 1.4; color: var(--paper-mute, #6A5E49); }
.pa-accent { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pa-accent i { display: block; width: 82px; height: 82px; border: 3px solid #191814; border-radius: 20px; background: var(--c); box-shadow: 4px 4px 0 #191814; }
.pa-accent em { font: normal 12px var(--f-mono); color: inherit; }
.pa-font-specimen { display: block; width: 100%; text-align: center; } .pa-font-specimen strong { display: block; font-size: 32px; line-height: 1.1; overflow-wrap: anywhere; } .pa-font-specimen small { display: block; margin-top: 10px; font: 11px var(--f-mono); }

/* ---------- the store page ---------- */
.sp-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.sp-try { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 20px; margin: 18px 0 0; align-items: stretch; }
.sp-try > div { display: flex; flex-direction: column; min-width: 0; }
.sp-prev { flex: 1; display: flex; flex-direction: column; position: relative; overflow: hidden; border: var(--bw) solid #0E0C0A; border-radius: 12px; background: var(--pf-bg, #27241e); color: var(--pf-ink, #F2EADB); box-shadow: 5px 5px 0 var(--shadow-c); min-width: 0; }
.sp-prev-banner { flex: 1 1 auto; min-height: 120px; border-bottom: var(--bw) solid #0E0C0A; background-size: cover; background-position: center; }
.sp-prev-body { flex: none; display: flex; align-items: center; gap: 18px; padding: 16px 22px 18px; min-width: 0; }
.sp-prev-av { flex: none; line-height: 0; margin-top: -58px; position: relative; } .sp-prev-av .avatar { border-width: 3px; border-radius: 14px; }
.sp-prev-id { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.sp-prev-name { margin: 0; font-family: var(--pf-font, var(--f-display)); font-size: 25px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; color: var(--pf-accent, inherit); max-width: 100%; }
.sp-prev-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; min-width: 0; }
.sp-prev-tag { font: 500 10.5px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--pf-mute, #BDB19C); }
.sp-ctl { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border: var(--bw) solid var(--line); border-radius: 12px; background: var(--bg-2); min-width: 0; }
.sp-ctl .lbl { margin: 0; } .sp-ctl .input { width: 100%; }
.sp-ctl p { margin: 0; font-size: 13px; line-height: 1.45; }
.sp-bal { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1.5px dashed var(--line-soft); padding-top: 10px; margin-top: 2px; }
.sp-bal b { font-size: 22px; }
.sp-note { margin: 16px 2px 0; max-width: 70ch; }
.sp-hw-entry { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-top: 22px; padding: 16px 22px; border: var(--bw) solid #7C5BA6; border-radius: 12px; background: #281C36; color: #F2EADB; text-decoration: none; box-shadow: 4px 4px 0 #0E0C0A; }
.sp-hw-entry:hover { border-color: #F07832; }
.sp-hw-entry h2 { margin: 2px 0 2px; font-size: 26px; letter-spacing: -.03em; } .sp-hw-entry p { margin: 0; font-size: 14px; color: #CFC3D8; } .sp-hw-entry .kicker { color: #F07832; }
.sp-hw-entry img { width: 76px; height: 76px; object-fit: contain; flex: none; }
.sp-hw-entry .sp-go { flex: none; padding: 9px 16px; border-radius: 6px; background: #F07832; color: #191814; font-weight: 700; }
.sp-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-top: 20px; }
.sp-bar .tabs { margin: 0; flex: 1 1 auto; min-width: 0; }
.sp-search { flex: 0 1 220px; min-width: 0; }
.sp-count { margin: 18px 2px 10px; font: 12px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.sp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.sp-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 2px solid #191814; border-radius: 13px; background: var(--paper); color: var(--paper-ink); box-shadow: 4px 4px 0 #080807; }
.sp-card.on { outline: 3px solid var(--lime); outline-offset: 2px; } .sp-card.tried { outline: 3px dashed var(--lime); outline-offset: 2px; }
.sp-art { position: relative; display: flex; align-items: center; justify-content: center; height: 195px; padding: 20px; border-bottom: 2px solid #191814; background: #dfd7c5; min-width: 0; overflow: hidden; }
.sp-art.k-avatar { background: #dce7b9; } .sp-art.k-badge { background: #e6e0ce; } .sp-art.k-banner { padding: 0; }
.sp-art .avatar { border-width: 2px; }
.sp-hw .sp-art.k-avatar { background: #d8c7e4; }
.sp-body { display: flex; flex-direction: column; flex: 1; gap: 8px; padding: 16px 18px 18px; min-width: 0; }
.sp-type { font: 500 10px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; }
.sp-body h3 { margin: 0; font-size: 22px; line-height: 1.1; letter-spacing: -.03em; overflow-wrap: anywhere; }
.sp-desc { margin: 0; font-size: 14px; line-height: 1.4; min-height: 40px; overflow-wrap: anywhere; }
.sp-req { display: flex; gap: 6px; align-items: baseline; padding-top: 8px; border-top: 1px solid #b7ac94; font-size: 12px; line-height: 1.35; color: #8A2210; } .sp-req.ok { color: #5C5240; }
.sp-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px 10px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; }
.sp-price { font: 500 17px var(--f-mono); }
.sp-act { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sp-card .btn { min-height: 40px; } .sp-try-btn { background: #191814; color: var(--paper); border-color: #191814; } .sp-try-btn[aria-pressed="true"] { background: #1E3B2C; color: #C6F432; border-color: #1E3B2C; }
.sp-card.locked { opacity: .9; }
.sp-card .tag { color: #3C3326; border-color: #3C3326; background: transparent; }                    /* ("In use" on a cream card) */
.sp-card .btn[disabled] { opacity: 1; background: #C9BFA6; border-color: #A89C7F; color: #4A4234; }
.sp-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-top: 40px; padding: 22px 26px; border: var(--bw) solid #7C5BA6; border-radius: 12px; background: #281C36; color: #F2EADB; text-decoration: none; }
.sp-bottom h2 { margin: 0; font-size: 28px; letter-spacing: -.03em; } .sp-bottom img { width: 90px; height: 90px; object-fit: contain; flex: none; }

/* the Halloween shop: the same store in midnight purple, burnt orange and warm cream */
.sp-hw .sp-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; padding: 18px 0 8px; }
.sp-hw .sp-hero h1 { margin: 6px 0 12px; } .sp-hw .sp-hero p { max-width: 60ch; margin: 0; }
.sp-hw .sp-hero-art { display: flex; align-items: center; gap: 0; flex: none; } .sp-hw .sp-hero-art img { width: 130px; height: 130px; object-fit: contain; } .sp-hw .sp-hero-art img + img { width: 84px; height: 84px; margin-left: -18px; margin-top: 54px; }
.sp-hw .tabs button.active, .sp-hw .pill.active { background: #F07832; border-color: #F07832; color: #191814; }
.sp-hw .sp-card.on { outline-color: #F07832; } .sp-hw .sp-card.tried { outline-color: #F07832; }
.sp-hw .sp-try-btn[aria-pressed="true"] { background: #3B2934; color: #F07832; border-color: #3B2934; }
.sp-closed { margin: 18px 0 0; padding: 14px 18px; border: var(--bw) dashed #7C5BA6; border-radius: 10px; color: #CFC3D8; background: #281C36; line-height: 1.5; }

@media (max-width: 1180px) { .sp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sp-try { grid-template-columns: minmax(0, 1fr) minmax(0, 260px); } }
@media (max-width: 820px) {
  .sp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .sp-try { grid-template-columns: minmax(0, 1fr); }
  .sp-search { flex-basis: 100%; }
}
@media (max-width: 640px) {
  .sp-prev-banner { flex: none; min-height: 0; height: 84px; } .sp-ctl { padding: 14px 16px; } .sp-ctl > p:last-child { display: none; } .sp-prev-body { padding: 14px 16px 16px; gap: 12px; } .sp-prev-av { margin-top: -44px; } .sp-prev-name { font-size: 21px; }
  .sp-art { height: 155px; padding: 12px; } .sp-art .avatar { --s: 108px !important; } .sp-body { padding: 14px; } .sp-body h3 { font-size: 20px; } .sp-desc { font-size: 13px; }
  .sp-foot { align-items: flex-start; flex-direction: column; gap: 10px; } .sp-act { width: 100%; justify-content: stretch; } .sp-act .btn { flex: 1 1 auto; }
  .sp-hw-entry { padding: 14px 16px; } .sp-hw-entry h2 { font-size: 22px; } .sp-bottom { padding: 18px; } .sp-bottom h2 { font-size: 24px; }
}
@media (max-width: 480px) {
  .sp-grid { gap: 12px; } .sp-art { height: 140px; } .sp-art .avatar { --s: 92px !important; } .sp-price { font-size: 15px; } .pa-accent i { width: 62px; height: 62px; } .pa-badge-img { width: 80px; height: 80px; } .pa-font-specimen strong { font-size: 24px; }
  .sp-prev-av { margin-top: -36px; }
}
@media (prefers-reduced-motion: reduce) { .sp-hw-entry, .sp-card { transition: none; } }
