/* Table orders: binder browsing (shelf, binder pages, card inspector).
   Colours are brand tokens only (pw.css). No foil or holo effects on the cards: the card images show as they are. */
:root {
  --sleeve: linear-gradient(135deg, rgb(255 255 255 / .28) 0%, rgb(255 255 255 / 0) 38%, rgb(255 255 255 / 0) 70%, rgb(255 255 255 / .12) 100%);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

/* ---------------------------------------------------------------- view switch */
.views { display: flex; gap: 4px; padding: 4px; margin-top: 10px; background: var(--pw-paper); border: 1.5px solid var(--pw-line); border-radius: 12px; }
.views button { flex: 1; height: 38px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; font-size: 15px; color: var(--pw-slate); }
.views button[aria-pressed="true"] { background: #fff; color: var(--pw-ink); box-shadow: var(--shadow-sm); }

/* ---------------------------------------------------------------- shelf */
.shelf { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; padding-top: 4px; }
.shelf h3 { margin: 0 0 10px; font-size: 18px; font-weight: 800; letter-spacing: -.01em; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.shelf h3 small { font-size: 13px; font-weight: 500; color: var(--pw-slate); }
.shelf h3 button { border: 0; background: none; color: var(--pw-teal-700); font-weight: 600; font-size: 14px; padding: 0; }

.rail { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; margin: 0 -16px; padding: 4px 16px 10px; scrollbar-width: none; overscroll-behavior-x: contain; }
.rail::-webkit-scrollbar { display: none; }
.rcard { flex: none; width: 128px; scroll-snap-align: start; border: 0; background: none; padding: 0; text-align: left; color: inherit; }
.rail.big .rcard { width: 156px; }
.rcard .ph { position: relative; aspect-ratio: 63/88; border-radius: 9px; overflow: hidden; background: var(--pw-paper); box-shadow: var(--shadow-md); transition: transform .2s var(--ease-out); }
.rcard:active .ph { transform: scale(.97); }
.rcard .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rcard .nm { font-weight: 700; font-size: 13px; line-height: 1.25; margin-top: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcard .pr { font-family: var(--font-mono); font-weight: 500; font-size: 15px; }
.rcard .new { position: absolute; top: 8px; left: -24px; transform: rotate(-45deg); background: var(--pw-teal-700); color: #fff; font-size: 10px; font-weight: 700;
              letter-spacing: .1em; padding: 2px 26px; }

.mons { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 2px 0; max-height: 140px; overflow: hidden; }   /* three rows; "Show all" opens the rest */

.showall { margin-top: 8px; height: 38px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--pw-teal-100); color: var(--pw-teal-900); font-weight: 700; font-size: 14px; }
.mons button { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 4px; border-radius: 999px; border: 1.5px solid var(--pw-line); background: #fff;
               font-weight: 600; font-size: 14px; color: var(--pw-ink); }
.mons button img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; background: var(--pw-paper); }
.artist { border: 0; padding: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.mons button { min-width: 0; }
.mons button .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.mons.artists { max-height: 176px; }   /* names can take two lines: three rows of 52px */
.mons.artists button { height: 52px; border-radius: 18px; }
.mons.artists button .nm { white-space: normal; font-size: 14px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mons.open, .mons.artists.open { max-height: none; }
.mons button small { font-family: var(--font-mono); color: var(--pw-slate); font-weight: 500; }

.covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 14px; }
@media (max-width: 520px) { .covers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.cover { position: relative; aspect-ratio: 3 / 4; width: 100%; min-width: 0; border: 0; padding: 0; border-radius: 6px 14px 14px 6px; background: var(--pw-ink); color: #fff; text-align: left; overflow: hidden;
         box-shadow: inset 12px 0 0 rgb(0 0 0 / .28), inset 13px 0 0 rgb(255 255 255 / .06), var(--shadow-md); transition: transform .25s var(--ease-out), box-shadow .25s; }
.cover:hover { transform: translateY(-2px); box-shadow: inset 12px 0 0 rgb(0 0 0 / .28), inset 13px 0 0 rgb(255 255 255 / .06), var(--shadow-lift); }
.cover:active { transform: scale(.98); }
.cover.teal { background: var(--pw-teal-900); } .cover.mid { background: var(--pw-teal-700); }
.cover .fan { position: absolute; left: 31%; bottom: -10%; width: 42%; height: 56%; }
.cover .fan img { position: absolute; inset: 0; width: 100%; aspect-ratio: 63/88; height: auto; object-fit: cover; border-radius: 6px; box-shadow: 0 4px 14px rgb(0 0 0 / .4);
                  transform-origin: 50% 120%; transition: transform .35s var(--ease-out); background: var(--pw-paper); }
.cover .fan img:nth-child(1) { transform: translateX(-38%) rotate(-14deg); }
.cover .fan img:nth-child(2) { transform: translateX(38%) rotate(14deg); }
.cover .fan img:nth-child(3) { transform: translateY(-6%); }
.cover:hover .fan img:nth-child(1) { transform: translateX(-52%) rotate(-20deg); }
.cover:hover .fan img:nth-child(2) { transform: translateX(52%) rotate(20deg); }
.cover:hover .fan img:nth-child(3) { transform: translateY(-14%); }
.cover .lbl { position: absolute; left: 22px; right: 12px; top: 12px; }
.cover .code { display: block; font-family: var(--font-mono); font-weight: 500; font-size: 11px; color: var(--pw-teal-300); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cover .ttl { display: block; font-weight: 800; font-size: 16px; line-height: 1.15; letter-spacing: -.01em; margin-top: 2px; }
.cover .cnt { display: block; font-size: 12px; opacity: .7; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cover .cnt .mono { font-weight: 500; }
.cover .ring { position: absolute; left: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--pw-steel); opacity: .6; }
.era { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--pw-slate); margin: 6px 0 10px; }

/* ---------------------------------------------------------------- binder */
.binder { position: fixed; inset: 0; z-index: 40; background: var(--pw-ink); color: #fff; display: flex; flex-direction: column; overscroll-behavior: contain;
          padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); animation: bopen .32s var(--ease-out); touch-action: pan-y; }
@keyframes bopen { from { opacity: 0; transform: scale(.96); } }
.bhd { display: flex; align-items: center; gap: 8px; padding: 8px 10px 6px; }
.bhd .ttl { flex: 1; min-width: 0; }
.bhd .ttl b { display: block; font-size: 17px; font-weight: 800; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bhd .ttl small { font-size: 12px; opacity: .7; }
.ibtn { flex: none; width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgb(255 255 255 / .08); color: #fff; display: grid; place-items: center; }
.ibtn:disabled { opacity: .25; }
.bsort { height: 36px; border-radius: 999px; border: 1px solid rgb(255 255 255 / .2); background: transparent; color: #fff; padding: 0 10px; font: inherit; font-size: 13px; font-weight: 600; }
.bsort option { color: var(--pw-ink); }

.stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 4px 10px; position: relative; }
.spread { position: relative; display: flex; gap: 0; perspective: 1800px; --pw: min(calc(100vw - 20px), calc((100dvh - 168px) * .735)); }
.spread.two { --pw: min(calc((100vw - 40px) / 2), calc((100dvh - 150px) * .735)); }
.slot { position: relative; width: var(--pw); aspect-ratio: .735; }
.pg { position: absolute; inset: 0; border-radius: 10px; padding: 3.2% 3.2%; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); gap: 2.4%;
      background: linear-gradient(180deg, #24343a, #1c2a2f); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .07), 0 10px 30px rgb(0 0 0 / .35); }
.spread.two .slot:first-child .pg { border-radius: 10px 3px 3px 10px; }
.spread.two .slot:last-child .pg { border-radius: 3px 10px 10px 3px; }
.spread.two .slot:first-child::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 18px; background: linear-gradient(90deg, transparent, rgb(0 0 0 / .35)); z-index: 3; pointer-events: none; }
.pocket { position: relative; border: 0; padding: 0; border-radius: 5px; background: rgb(255 255 255 / .05); overflow: visible; display: block; min-width: 0; min-height: 0;
          box-shadow: inset 0 0 0 1px rgb(255 255 255 / .09); color: inherit; }
.pocket img { position: absolute; inset: 4%; width: 92%; height: 92%; object-fit: contain; display: block; border-radius: 4px; transition: transform .18s var(--ease-out); }
.pocket::before { content: ""; position: absolute; inset: 0; border-radius: 5px; background: var(--sleeve); z-index: 1; pointer-events: none; }
.pocket:active img { transform: scale(.96); }
.pocket .stk { position: absolute; right: 4%; bottom: 3%; z-index: 2; background: #fff; color: var(--pw-ink); font-family: var(--font-mono); font-weight: 500; font-size: clamp(9px, 2.6vw, 13px);
               padding: 1px 5px; border-radius: 3px; box-shadow: 0 1px 3px rgb(0 0 0 / .35); transform: rotate(-3deg); }
.spread.two .pocket .stk { font-size: clamp(9px, 1.3vw, 14px); }
.pocket .stk.last { box-shadow: 0 1px 3px rgb(0 0 0 / .35), inset 0 -2px 0 var(--pw-ember); }
.pocket .got { position: absolute; top: -5px; right: -5px; z-index: 3; width: 22px; height: 22px; border-radius: 50%; background: var(--pw-leaf); color: #fff; display: grid; place-items: center;
               font-size: 12px; font-weight: 800; box-shadow: 0 0 0 2px var(--pw-ink); font-family: var(--font-mono); }
.pocket.in { box-shadow: inset 0 0 0 2px var(--pw-teal-300); }
.pocket.empty { pointer-events: none; }
.pocket .noimg { position: absolute; inset: 8%; display: grid; place-items: center; text-align: center; font-size: 11px; line-height: 1.25; color: rgb(255 255 255 / .7); }

/* page turning */
.turner { position: absolute; top: 0; width: var(--pw); aspect-ratio: .735; transform-style: preserve-3d; z-index: 5; will-change: transform; }
.turner .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.turner .face.back { transform: rotateY(180deg); }
.turner .shade { position: absolute; inset: 0; border-radius: 10px; pointer-events: none; background: linear-gradient(90deg, rgb(0 0 0 / .45), transparent 60%); opacity: 0; }
.pg.blank { background: linear-gradient(180deg, #2a3b41, #213035); }
.pg.blank::after { content: ""; position: absolute; inset: 3.2%; border-radius: 6px; background-image: repeating-linear-gradient(90deg, rgb(255 255 255 / .05) 0 1px, transparent 1px 33.33%),
                   repeating-linear-gradient(0deg, rgb(255 255 255 / .05) 0 1px, transparent 1px 33.33%); }

.bft { display: flex; align-items: center; gap: 10px; padding: 6px 12px 10px; }
.scrub { flex: 1; display: grid; gap: 2px; }
.scrub input { width: 100%; accent-color: var(--pw-teal-300); height: 28px; }
.scrub .lbl { font-size: 12px; opacity: .75; display: flex; justify-content: space-between; gap: 8px; }
.scrub .lbl span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgb(255 255 255 / .12); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
        padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; pointer-events: none; animation: hint 3.6s ease forwards; z-index: 6; }
@keyframes hint { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* ---------------------------------------------------------------- inspector */
.insp { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; color: #fff; overflow: hidden; background: var(--pw-ink);
        padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); animation: fade .2s ease-out; touch-action: none; }
@keyframes fade { from { opacity: 0; } }
.insp .bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(40px) saturate(1.3); opacity: .45; transform: scale(1.1); transition: background-image .3s; }
.insp .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(31 42 46 / .3), rgb(31 42 46 / .85) 70%); }
.insp > * { position: relative; }
.ihd { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; }
.ihd .pos { font-family: var(--font-mono); font-size: 13px; opacity: .75; }
.istage { flex: 1; min-height: 0; display: grid; place-items: center; perspective: 1100px; padding: 6px 20px; }
.tilt { position: relative; height: min(100%, calc((100vw - 56px) / .716)); max-height: 640px; aspect-ratio: 63/88; transform-style: preserve-3d; transition: transform .5s var(--ease-out);
        will-change: transform; }
.tilt.live { transition: transform .08s linear; }
.tilt.swipe { transition: transform .28s var(--ease-out), opacity .28s; }
.tilt .cimg { position: absolute; inset: 0; border-radius: 4.5%/3.2%; overflow: hidden; background: var(--pw-paper); box-shadow: 0 30px 60px rgb(0 0 0 / .45); }
.tilt .cimg img { width: 100%; height: 100%; object-fit: contain; display: block; transform-origin: var(--zx, 50%) var(--zy, 50%); transition: transform .25s var(--ease-out); }
.tilt.zoomed .cimg img { transform: scale(2.2); transition: none; }
.ibody { padding: 10px 18px 14px; display: grid; gap: 10px; max-width: 620px; width: 100%; margin: 0 auto; }
.ibody .nm { font-size: 22px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; }
.ibody .st { font-size: 14px; opacity: .8; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgb(255 255 255 / .1); }
.chips .r3 { background: var(--pw-spark); color: var(--pw-ink); } .chips .r2 { background: var(--pw-teal-300); color: var(--pw-ink); }
.chips .low { background: var(--pw-ember); }
.ibuy { display: flex; align-items: center; gap: 12px; }
.ibuy .pr { font-family: var(--font-mono); font-weight: 500; font-size: 30px; line-height: 1; flex: none; }
.ibuy .btn { flex: 1; }
.ibuy .stepper { flex: 1; margin: 0; background: rgb(255 255 255 / .12); height: 56px; }
.ibuy .stepper button, .ibuy .stepper span { color: #fff; }
.iarrows { display: none; }
@media (min-width: 900px) {
  .iarrows { display: block; }
  .iarrows button { position: absolute; top: 45%; z-index: 2; }
  .iarrows .l { left: 16px; } .iarrows .r { right: 16px; }
}

/* basket pill on the binder and card screens; sheets (review, done) sit above them */
.bpill { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--pw-teal-700); color: #fff; font-weight: 600; }
.bpill b { font-weight: 500; font-size: 15px; } .bpill span { font-size: 12px; background: rgb(255 255 255 / .2); border-radius: 999px; padding: 0 7px; }
#layer .scrim { z-index: 60; } #layer .sheet { z-index: 61; } #layer .done { z-index: 62; }

/* card flying into the basket */
.fly { position: fixed; z-index: 80; pointer-events: none; border-radius: 6px; object-fit: cover; box-shadow: 0 10px 30px rgb(0 0 0 / .35);
       transition: transform .6s cubic-bezier(.5, -0.3, .7, 1), opacity .6s; }
.bar.bump .sum b { animation: bump .4s var(--ease-out); display: inline-block; }
@keyframes bump { 40% { transform: scale(1.25); } }

@media (prefers-reduced-motion: reduce) {
  .binder, .insp { animation: none; }
}
