/* 도감 페이지: 배너 · 툴바 · 카테고리 · 박스 목록 */
body[data-catalog] { color: var(--ink); }

/* ---------- intro banner ---------- */
.ph-catalog-intro { margin: 24px 0 32px; text-align: center; }
.ph-catalog-visual {
  position: relative;
  height: clamp(180px, 24vw, 320px);
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--paper-2);
  box-shadow: var(--shadow);
}
.ph-catalog-visual::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, transparent 50%, rgb(18 17 22 / .3));
  box-shadow: inset 0 0 0 1px rgb(22 20 27 / .06);
  pointer-events: none;
}
.ph-catalog-art { display: block; width: 100%; height: 100%; object-fit: cover; }
.ph-character-pair {
  position: absolute; inset: 0;
  display: flex; justify-content: center; align-items: end;
  gap: clamp(12px, 3vw, 48px);
  pointer-events: none;
}
.ph-character-pair img { width: auto; height: 96%; max-width: 47%; object-fit: contain; object-position: center bottom; }
.ph-catalog-heading { position: relative; z-index: 1; margin-top: -44px; padding: 0 12px; }
.ph-catalog-intro h1 {
  width: min(340px, 78%);
  margin: 0 auto;
  padding: 16px 28px 14px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), var(--shadow);
  line-height: 0;
}
.ph-catalog-title-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ph-catalog-logo { display: block; width: 100%; height: clamp(56px, 6vw, 84px); object-fit: contain; }
.ph-catalog-intro p { margin: 16px 0 0; color: var(--muted); font-size: 14px; letter-spacing: .02em; }
body:is([data-catalog="nikke"], [data-catalog="solo"]) .ph-catalog-logo { filter: brightness(.12); }
body[data-catalog="dragonball"] .ph-catalog-logo { filter: drop-shadow(0 0 1px #172c3a) drop-shadow(0 1px 1px #172c3a); }
/* 로카나·니벨아레나 로고는 밝은 색이라 어두운 받침 사용 */
body:is([data-catalog="disney"], [data-catalog="nivel"], [data-catalog="titan"]) .ph-catalog-intro h1 { box-shadow: 0 0 0 1px rgb(255 255 255 / .08), var(--shadow); }
body[data-catalog="disney"] .ph-catalog-intro h1 { background: #34234b; }
body[data-catalog="nivel"] .ph-catalog-intro h1 { background: #21282f; }
body[data-catalog="titan"] .ph-catalog-intro h1 { background: #1c1714; }

/* ---------- news ---------- */
.catalog-news {
  margin: 0 0 24px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--ink-2);
  font-size: 14px;
}
.catalog-news summary {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 0 20px;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.catalog-news summary::-webkit-details-marker { display: none; }
.catalog-news summary::before {
  content: 'NEW';
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--gold-soft);
  color: var(--gold-ink);
  font: 700 10px/1 var(--sans);
  letter-spacing: .14em;
}
.catalog-news summary::after {
  content: '';
  width: 6px; height: 6px;
  margin-left: auto;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 200ms ease;
}
.catalog-news[open] summary::after { transform: translateY(2px) rotate(225deg); }
.catalog-news ul { max-height: 280px; overflow: auto; margin: 0; padding: 12px 20px 8px 40px; border-top: 1px solid var(--line); }
.catalog-news li { padding: 4px 0; }
.catalog-news li::marker { color: var(--gold); }
.catalog-news a { display: inline-block; margin: 6px 20px 18px; color: var(--gold-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- toolbar ---------- */
.ph-box-browser { min-width: 0; margin: 0 0 72px; }
.catalog-toolbar { position: relative; z-index: 2; }
.catalog-controls { display: flex; align-items: stretch; gap: 8px; }
.catalog-controls input, .filter-fields select, .filter-fields button, .catalog-filters summary, .binder-link {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}
.catalog-controls input {
  flex: 1 1 0;
  min-width: 0;
  height: 48px;
  padding: 0 16px 0 44px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2336333d' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5.5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E") no-repeat 16px 50% / 16px;
  font-size: 15px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.catalog-controls input::placeholder { color: var(--muted); }
.catalog-controls input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgb(180 138 74 / .18); }
.binder-link, .catalog-filters summary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.binder-link { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.binder-link:hover { background: #000; }
.catalog-filters summary { list-style: none; }
.catalog-filters summary:hover { border-color: var(--ink); }
.catalog-filters summary::-webkit-details-marker { display: none; }
.catalog-filters summary::after {
  content: '';
  width: 6px; height: 6px;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
}
.catalog-filters[open] summary { border-color: var(--ink); }
.filter-fields {
  position: absolute; right: 0; top: 56px; z-index: 3;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  width: min(100%, 440px);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.filter-fields select, .filter-fields button { min-width: 0; min-height: 44px; padding: 0 12px; border-radius: 10px; }
.filter-fields select {
  appearance: none;
  padding-right: 32px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%2336333d' stroke-width='1.5'%3E%3Cpath d='m1 1 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 12px center / 10px;
  text-overflow: ellipsis;
}
.filter-fields button { font-weight: 600; cursor: pointer; }
.filter-fields button:hover, .filter-fields select:hover { border-color: var(--ink); }

/* language editions: segmented pills */
.edition-tabs, .category-tiles { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.edition-tabs { margin-top: 16px; gap: 4px; }
.edition-tabs small { margin-right: 8px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.edition-tabs a {
  display: inline-flex; align-items: center;
  min-height: 36px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 999px;
  color: var(--ink-2);
  font-size: 14px;
  transition: background 160ms ease, border-color 160ms ease;
}
.edition-tabs a:hover { background: var(--paper-2); }
.edition-tabs [aria-current] {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
/* "‹ 박스 목록" 뒤로가기 링크 (언어판 앞에 붙음) */
.edition-tabs > a:first-child {
  margin-right: 12px;
  padding: 0 16px 0 14px;
  gap: 8px;
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
}
.edition-tabs > a:first-child:hover { border-color: var(--ink); }

/* product categories: underline tabs */
.category-tiles {
  flex-wrap: nowrap;
  gap: 4px;
  margin: 24px 0 36px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}
.category-tiles::-webkit-scrollbar { display: none; }
.category-tile {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  flex: none;
  min-height: 48px; padding: 0 16px;
  color: var(--muted);
  font-size: 15px;
  white-space: nowrap;
  transition: color 160ms ease;
}
.category-tile::after {
  content: '';
  position: absolute; left: 12px; right: 12px; bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background 160ms ease;
}
.category-tile:hover { color: var(--ink); }
.category-tile strong { font-weight: 600; }
.category-tile small {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.category-tile[aria-current] { color: var(--ink); }
.category-tile[aria-current]::after { background: var(--ink); }
.category-tile[aria-current] small { background: var(--ink); color: var(--paper); }

/* ---------- content ---------- */
.catalog-content h2 {
  margin: 0 0 24px;
  font: 700 clamp(22px, 2.4vw, 30px)/1.3 var(--sans);
  letter-spacing: -.03em;
}
.catalog-content > p { color: var(--muted); }

/* box / product grid */
.ph-box-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 32px 20px; }
.ph-box-tile { display: flex; flex-direction: column; min-width: 0; color: var(--ink); }
.ph-box-tile .ph-finder-art, .ph-box-tile .no-art {
  width: 100%; height: auto;
  aspect-ratio: 1;
  border: 0;
  border-radius: var(--radius-lg);
  background: radial-gradient(ellipse 75% 70% at 50% 42%, #fff 0%, #f3eee6 70%, #ebe5da 100%);
  box-shadow: 0 0 0 1px var(--line);
  transition: box-shadow 320ms var(--ease-out), transform 320ms var(--ease-out);
}
.ph-box-tile .ph-finder-art { display: grid; place-items: center; }
.ph-box-tile .ph-finder-art img {
  inset: 10%;
  width: 80%; height: 80%;
  padding: 0;
  mix-blend-mode: multiply;
  transform: scale(var(--art-scale, 1));
  transition: transform 520ms var(--ease-out);
}
/* 니벨아레나 박스 사진은 여백이 커서 확대 */
.ph-box-tile .nivel-box-cutout { --art-scale: 1.48; }
.ph-box-tile .product-cutout { background: radial-gradient(ellipse 75% 70% at 50% 42%, #fff 0%, #f3eee6 70%, #ebe5da 100%); }
.product-cutout > img {
  -webkit-mask: var(--product-mask) center / contain no-repeat;
  mask-image: var(--product-mask);
  mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
}
.ph-finder-art.product-framed { --box-fill: .82; }
.ph-box-hero-art .ph-finder-art.product-framed { --box-fill: .90; }
.ph-box-tile .product-framed > img, .ph-box-hero-art .product-framed > img {
  inset: calc(50% - var(--box-mid-y) * var(--box-fill)) auto auto calc(50% - var(--box-mid-x) * var(--box-fill));
  width: calc(var(--box-width) * var(--box-fill));
  height: calc(var(--box-height) * var(--box-fill));
  max-width: none;
  transform-origin: var(--box-pivot);
}
.no-art { display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.ph-box-copy { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px 2px 0; color: var(--ink); }
.ph-box-copy strong { font: 650 16px/1.4 var(--sans); letter-spacing: -.02em; overflow-wrap: anywhere; }
.ph-box-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.ph-box-badges span {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.ph-box-badges .is-code { border-color: var(--ink); background: var(--ink); color: var(--paper); letter-spacing: .02em; }
.ph-box-copy small { color: var(--muted); font-size: 12px; }
.ph-box-release { margin: auto 0 0; padding-top: 2px; color: var(--muted); font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) {
  .ph-box-tile:hover .ph-finder-art, .ph-box-tile:hover .no-art { box-shadow: 0 0 0 1px var(--line-strong), var(--shadow); }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .ph-box-tile:hover .ph-finder-art, .ph-box-tile:hover .no-art { transform: translateY(-4px); }
  .ph-box-tile:hover .ph-finder-art img { transform: scale(calc(var(--art-scale, 1) * 1.04)); }
}

/* rarity sections */
.ph-grade { margin: 44px 0; }
.ph-grade h3 {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 22px;
  font: 700 19px/1.35 var(--sans);
  letter-spacing: -.02em;
}
.ph-grade h3::before { content: ''; flex: none; width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); }
.ph-grade h3::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.more-cards, .grade-guide button, .grade-guide-list a {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 22px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.more-cards { display: flex; margin: 28px auto 0; }
.more-cards:hover, .grade-guide-list a:hover { border-color: var(--ink); }
.more-cards:disabled { opacity: .5; cursor: default; }
.more-cards[hidden] { display: none; }

/* grade guide dialog */
.grade-guide {
  max-width: min(600px, 92vw);
  padding: 32px;
  border: 0;
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 40px 120px -30px rgb(0 0 0 / .6);
}
.grade-guide::backdrop { background: rgb(18 17 22 / .64); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.grade-guide h2 { font-size: 24px; }
.grade-guide > p { margin: 8px 0 20px; color: var(--muted); font-size: 14px; }
.grade-guide-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.grade-guide-list a { min-height: 38px; padding: 0 14px; font-size: 13px; font-weight: 500; }
.grade-guide > button { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.catalog-variants { margin: 14px 0; color: var(--ink); }
.catalog-variants summary { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; list-style: none; }
.catalog-variants summary::-webkit-details-marker { display: none; }
.catalog-variants summary::after {
  content: '';
  width: 6px; height: 6px;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
}
.catalog-variants[open] summary::after { transform: translateY(2px) rotate(225deg); }
.catalog-variants button {
  display: block; width: 100%;
  margin: 8px 0; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: inherit;
  font: inherit; font-size: 13px; text-align: left;
  cursor: pointer;
}
.catalog-variants button:hover { border-color: var(--ink); }

.ph-box-browser :focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .ph-box-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 860px) { .ph-box-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .ph-catalog-intro { margin: 14px 0 24px; }
  .ph-catalog-visual { height: clamp(120px, 34vw, 200px); border-radius: 18px; }
  .ph-catalog-heading { margin-top: -28px; }
  .ph-catalog-intro h1 { width: min(230px, 72%); padding: 10px 18px 9px; border-radius: 16px; }
  .ph-catalog-logo { height: 50px; }
  .ph-catalog-intro p { margin-top: 12px; font-size: 13px; }
  .catalog-controls { flex-wrap: wrap; }
  .catalog-controls input { flex-basis: 100%; height: 46px; }
  .catalog-filters, .binder-link { flex: 1 1 0; }
  .catalog-filters summary, .binder-link { min-height: 44px; font-size: 13px; }
  .filter-fields { top: 104px; width: 100%; grid-template-columns: minmax(0, 1fr); }
  .edition-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
  .edition-tabs::-webkit-scrollbar { display: none; }
  .edition-tabs a { flex: none; }
  .category-tiles { margin: 16px calc(-1 * var(--gutter)) 24px; padding-inline: calc(var(--gutter) - 12px); }
  .category-tile { padding: 0 12px; font-size: 14px; }
  .ph-box-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .ph-box-tile .ph-finder-art, .ph-box-tile .no-art { border-radius: 16px; }
  .ph-box-copy { gap: 6px; padding-top: 12px; }
  .ph-box-copy strong { font-size: 14.5px; }
  .catalog-content h2 { margin-bottom: 16px; font-size: 21px; }
  .ph-grade { margin: 32px 0; }
  .ph-grade h3 { font-size: 17px; margin-bottom: 16px; }
  .grade-guide { padding: 24px; }
}
/* ---------- per-catalog brand accents ---------- */
.category-tile[aria-current] { color: var(--brand-ink); }
.category-tile[aria-current]::after { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.category-tile[aria-current] small { background: var(--brand-ink); color: #fff; }
.edition-tabs [aria-current] { border-color: color-mix(in srgb, var(--brand) 55%, var(--line-strong)); color: var(--brand-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent), var(--shadow-sm); }

/* ---------- store search link ---------- */
.ph-store-link {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; margin: 4px 0 18px; padding: 0 18px;
  border-radius: 999px;
  background: var(--brand-ink, var(--ink)); color: #fff;
  font: 600 14px/1 var(--sans);
  box-shadow: 0 8px 20px -12px var(--brand, #000);
  transition: transform 200ms var(--ease-out), filter 200ms ease;
}
.ph-store-link::after { content: '↗'; font-size: 13px; opacity: .85; }
.ph-finder-detail-copy .ph-store-link { margin: 12px 0 4px; }
@media (hover: hover) and (pointer: fine) { .ph-store-link:hover { filter: brightness(1.12); transform: translateY(-1px); } }
/* ---------- binder sharing ---------- */
.binder-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 22px; }
.binder-share button {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 0 18px;
  border-radius: 999px; cursor: pointer;
  font: 700 14px/1 var(--sans);
}
.binder-share-link { border: 0; background: #fee500; color: #191600; box-shadow: 0 6px 16px -10px rgb(120 100 0 / .8); }
.binder-share-link::before { content: ''; width: 18px; height: 15px; border-radius: 50% / 46%; background: #191600; }
.binder-share-image { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.binder-share-image:disabled { opacity: .55; cursor: progress; }
.binder-share-status { color: var(--muted); font-size: 13px; }
.binder-shared-note { margin: -4px 0 20px; color: var(--ink-2); font-size: 14px; }
.binder-shared-note a { color: var(--brand-ink, var(--gold-ink)); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.binder-count { margin-left: 8px; color: var(--muted); font-size: 15px; font-weight: 600; }
@media (hover: hover) and (pointer: fine) {
  .binder-share-link:hover { filter: brightness(.97); }
  .binder-share-image:hover { border-color: var(--ink); }
}
/* ---------- release flags on box tiles ---------- */
.ph-box-tile { position: relative; }
.ph-box-flag {
  position: absolute; z-index: 3; top: 8px; left: 8px;
  padding: 5px 10px 5px;
  border-radius: 999px;
  font: 800 11px/1 var(--sans); letter-spacing: .08em;
  pointer-events: none;
}
.ph-box-flag.is-new {
  background: linear-gradient(110deg, #ff5f7e, #ff9d5c);
  color: #fff;
  box-shadow: 0 6px 14px -6px rgb(255 95 126 / .8);
}
.ph-box-flag.is-soon {
  background: #16141b; color: #f1e4c8;
  box-shadow: inset 0 0 0 1px rgb(214 178 112 / .55), 0 6px 14px -6px rgb(0 0 0 / .6);
}
.ph-box-tile.is-soon .ph-finder-art img, .ph-box-tile.is-soon .no-art { filter: saturate(.85); }
@media (prefers-reduced-motion: no-preference) {
  .ph-box-flag.is-new { animation: flag-pop 2.8s ease-in-out infinite; }
  @keyframes flag-pop { 0%, 80%, 100% { transform: none; } 88% { transform: scale(1.08) rotate(-2deg); } }
}
/* ---------- collection progress ---------- */
.ph-progress { display: grid; gap: 7px; width: min(100%, 420px); margin: 2px 0 20px; }
.ph-progress-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ph-progress-label b { font: 700 14px/1.2 var(--sans); color: var(--ink); }
.ph-progress-label small { color: var(--brand-ink, var(--gold-ink)); font: 800 13px/1 var(--sans); font-variant-numeric: tabular-nums; }
.ph-progress-bar { position: relative; height: 8px; overflow: hidden; border-radius: 999px; background: var(--paper-2); box-shadow: inset 0 0 0 1px rgb(22 20 27 / .05); }
.ph-progress-bar::after {
  content: ''; position: absolute; inset: 0 auto 0 0; width: var(--pct, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand, var(--gold)), var(--brand-2, #d9c39a));
}
.ph-progress.is-complete .ph-progress-bar::after {
  background: linear-gradient(100deg, #ff9ac8, #ffd58a 25%, #9dffc8 50%, #8fd6ff 75%, #c3a2ff);
}
.ph-progress.is-compact { width: 100%; margin: 2px 0 0; gap: 5px; }
.ph-progress.is-compact .ph-progress-label b { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.ph-progress.is-compact .ph-progress-label small { font-size: 11px; }
.ph-progress.is-compact .ph-progress-bar { height: 5px; }
.ph-rank-count.is-complete { color: var(--brand-ink, var(--gold-ink)); }
.ph-rank-count.is-complete::after { content: ' · 컴플리트'; font-weight: 800; }
@media (prefers-reduced-motion: no-preference) {
  .ph-progress-bar::after { animation: progress-fill 900ms var(--ease-out) both; }
  @keyframes progress-fill { from { width: 0; } }
}
/* dark-aware surfaces that were hard-coded light */
.ph-box-tile .no-art { background: var(--tile-glow); }

/* ---------- wishlist entry next to the binder button ---------- */
.wish-link {
  display: inline-grid; place-items: center; flex: none;
  width: 48px; min-height: 48px;
  border: 1px solid var(--line-strong); border-radius: 14px;
  background: var(--surface); color: #e5476b;
}
.wish-link::before {
  content: ''; width: 20px; height: 18px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21s-8.5-5.3-10.6-10C-.3 6.7 2.4 2 6.8 2c2.3 0 3.9 1.2 5.2 3 1.3-1.8 2.9-3 5.2-3 4.4 0 7.1 4.7 5.4 9C20.5 15.7 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21s-8.5-5.3-10.6-10C-.3 6.7 2.4 2 6.8 2c2.3 0 3.9 1.2 5.2 3 1.3-1.8 2.9-3 5.2-3 4.4 0 7.1 4.7 5.4 9C20.5 15.7 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.wish-link[aria-current] { border-color: #e5476b; background: color-mix(in srgb, #e5476b 12%, var(--surface)); }
@media (max-width: 740px) { .wish-link { flex: 0 0 48px; min-height: 44px; } }

/* ---------- box hero ---------- */
.ph-box-hero {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; gap: 26px;
  margin: 6px 0 26px; padding: 26px 30px;
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(ellipse 55% 95% at 82% 70%, color-mix(in srgb, var(--brand, #b48a4a) 34%, transparent), transparent 70%),
    radial-gradient(ellipse 40% 60% at 6% 0%, #2a2530, transparent 70%),
    linear-gradient(160deg, #1c1a21, #0f0e13 72%);
  color: #f4efe6;
  box-shadow: var(--shadow-lg);
}
.ph-box-hero::before { content: ''; position: absolute; inset: 0; z-index: 3; border-radius: inherit; border: 1px solid rgb(212 180 120 / .2); pointer-events: none; }
.ph-box-hero-art .ph-finder-art { aspect-ratio: 1; background: none !important; }
.ph-box-hero-art .ph-finder-art > img { object-fit: contain; filter: drop-shadow(0 18px 24px rgb(0 0 0 / .6)); }
.ph-box-hero-art > .no-art { aspect-ratio: 1; color: #b3aca1; border: 1px dashed rgb(244 239 230 / .25); border-radius: 12px; text-align: center; }
.ph-box-hero-copy { display: grid; gap: 10px; justify-items: start; min-width: 0; }
.ph-box-hero-eyebrow { color: #c9a465; font: 700 12px/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.ph-box-hero-copy h2 { margin: 0; color: #f4efe6; font: 800 clamp(22px, 2.6vw, 32px)/1.2 var(--sans); letter-spacing: -.03em; overflow-wrap: anywhere; }
.ph-box-hero-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: #b3aca1; font-size: 14px; }
.ph-box-hero-facts span:not(.ph-box-flag) { padding: 4px 10px; border-radius: 999px; background: rgb(255 255 255 / .07); color: #d8d1c5; font-size: 13px; }
.ph-box-flag.is-inline { position: static; }
.ph-box-hero .ph-store-link { margin: 6px 0 0; white-space: nowrap; }
@media (max-width: 900px) { .ph-box-hero .ph-store-link { min-height: 38px; padding: 0 14px; font-size: 13px; } }
.ph-box-hero-fan { position: relative; height: 230px; margin: 0; padding: 0; list-style: none; }
.ph-box-hero-card {
  position: absolute; left: calc(50% - 60px); bottom: 6px;
  width: 120px;
  transform-origin: 50% 230%;
  transform: rotate(var(--r, 0deg));
}
.ph-box-hero-card .ph-finder-art { aspect-ratio: 63 / 88; overflow: hidden; border-radius: 6% / 4.3%; background: #24212a !important; box-shadow: 0 0 0 1px rgb(255 255 255 / .1), 0 22px 36px -14px rgb(0 0 0 / .85); }
.ph-box-hero-card .ph-finder-art > img { object-fit: cover; }
@media (prefers-reduced-motion: no-preference) {
  .ph-box-hero-card { animation: hero-deal 800ms var(--ease-out) var(--d, 0ms) backwards; }
  @keyframes hero-deal { from { opacity: 0; transform: rotate(0deg) translateY(30px); } }
}
@media (max-width: 900px) {
  .ph-box-hero { grid-template-columns: minmax(0, 120px) minmax(0, 1fr); gap: 16px 18px; padding: 20px; }
  .ph-box-hero-fan { grid-column: 1 / -1; height: 190px; }
  .ph-box-hero-card { width: 96px; left: calc(50% - 48px); transform-origin: 50% 240%; }
}
/* ---------- virtual pack opening ---------- */
html.ph-pack-open { overflow: hidden; }
.ph-pack-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 42px; margin-top: 6px; padding: 0 18px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(110deg, #ffd36e, #ff9ac8 45%, #8fd6ff);
  color: #1c1430; font: 800 14px/1 var(--sans);
  box-shadow: 0 8px 22px -10px rgb(255 150 200 / .9);
}
.ph-pack-btn::before { content: '✦'; }
.ph-pack {
  position: fixed; inset: 0; z-index: 200;
  display: grid; grid-template-rows: auto 1fr auto; justify-items: center;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(ellipse 70% 60% at 50% 45%, color-mix(in srgb, var(--brand, #b48a4a) 35%, #1c1a21), #0b0a0e 75%);
  color: #f4efe6;
}
.ph-pack-close {
  justify-self: end; min-height: 40px; padding: 0 16px;
  border: 1px solid rgb(255 255 255 / .25); border-radius: 999px;
  background: rgb(255 255 255 / .06); color: #f4efe6; font: 700 14px/1 var(--sans); cursor: pointer;
}
.ph-pack-stage { display: grid; place-items: center; align-content: center; gap: 18px; width: min(100%, 980px); }
.ph-pack-note { color: #a39b8f; font-size: 12px; text-align: center; }
.ph-pack-foil {
  position: relative; overflow: hidden;
  display: grid; align-content: center; justify-items: center; gap: 12px;
  width: min(66vw, 260px); aspect-ratio: 5 / 8;
  border: 0; border-radius: 14px; cursor: pointer;
  background:
    linear-gradient(115deg, transparent 30%, rgb(255 255 255 / .55) 46%, transparent 60%) 0 0 / 260% 100%,
    linear-gradient(160deg, var(--brand, #b48a4a), var(--brand-2, #6b3f1d));
  color: #fff; text-shadow: 0 2px 8px rgb(0 0 0 / .5);
  box-shadow: 0 30px 60px -20px rgb(0 0 0 / .9), inset 0 0 0 2px rgb(255 255 255 / .25);
}
.ph-pack-foil::before, .ph-pack-foil::after {
  content: ''; position: absolute; left: 0; right: 0; height: 16px;
  background: repeating-linear-gradient(90deg, rgb(255 255 255 / .4) 0 6px, transparent 6px 12px);
}
.ph-pack-foil::before { top: 10px; } .ph-pack-foil::after { bottom: 10px; }
.ph-pack-name { padding: 0 16px; font: 800 17px/1.3 var(--sans); text-align: center; }
.ph-pack-art { position: relative; display: block; width: 78%; aspect-ratio: 1; filter: drop-shadow(0 14px 22px rgb(0 0 0 / .45)); }
.ph-pack-art .ph-finder-art { position: absolute; inset: 0; aspect-ratio: auto; background: none !important; }
.ph-pack-art .ph-finder-art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 1 !important; }
.ph-pack-back img { filter: drop-shadow(0 0 10px rgb(255 214 140 / .35)); }
.ph-pack-tap { font: 800 12px/1 var(--sans); letter-spacing: .25em; opacity: .9; }
.ph-pack-cards {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  margin: 0; padding: 0; list-style: none; cursor: pointer;
}
.ph-pack-card { width: clamp(84px, 26vw, 150px); aspect-ratio: 63 / 88; perspective: 900px; }
.ph-pack-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 600ms var(--ease-out); }
.ph-pack-card.is-open .ph-pack-inner { transform: rotateY(180deg); }
.ph-pack-back, .ph-pack-front { position: absolute; inset: 0; border-radius: 6% / 4.3%; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.ph-pack-back {
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, #2b2733, #121116 70%);
  box-shadow: inset 0 0 0 3px #c9a465, 0 14px 30px -12px rgb(0 0 0 / .9);
}
.ph-pack-back img { width: 70%; height: auto; opacity: .9; }
.ph-pack-front { transform: rotateY(180deg); background: #24212a; box-shadow: 0 14px 30px -12px rgb(0 0 0 / .9); }
.ph-pack-front .ph-finder-art { position: absolute; inset: 0; aspect-ratio: auto; background: none !important; }
.ph-pack-front .ph-finder-art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 1 !important; }
.ph-pack-card.is-hit .ph-pack-front { box-shadow: 0 0 0 2px #fff6de, 0 0 40px 6px rgb(255 214 140 / .75); }
.ph-pack-card.is-hit[data-tier="rainbow"] .ph-pack-front { box-shadow: 0 0 0 2px #fff, 0 0 46px 10px rgb(190 140 255 / .8), 0 0 90px 20px rgb(255 150 200 / .45); }
.ph-pack-card.is-hit[data-tier="rainbow"] .ph-pack-front::after {
  content: ''; position: absolute; inset: 0; mix-blend-mode: overlay; opacity: .7;
  background: repeating-linear-gradient(115deg, #ff7ab6 0%, #ffd36e 7%, #7dffb2 14%, #6ecbff 21%, #b48cff 28%, #ff7ab6 35%) 0 0 / 300% 300%;
}
.ph-pack-hint { color: #f1e4c8; font: 700 15px/1.4 var(--sans); text-align: center; min-height: 1.4em; }
.ph-pack-all, .ph-pack-actions button {
  min-height: 42px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgb(255 255 255 / .3); background: rgb(255 255 255 / .08); color: #f4efe6; font: 700 14px/1 var(--sans);
}
.ph-pack-summary { display: grid; justify-items: center; gap: 8px; text-align: center; }
.ph-pack-summary strong { font: 800 18px/1.3 var(--sans); }
.ph-pack-summary p { color: #d8d1c5; font-size: 14px; }
.ph-pack-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }
.ph-pack-actions .ph-pack-again { background: #f4efe6; color: #16141b; border-color: #f4efe6; }
.ph-pack-actions .ph-store-link { margin: 0; }
@media (prefers-reduced-motion: no-preference) {
  .ph-pack-foil { animation: pack-shimmer 2.4s ease-in-out infinite, pack-wobble 3.2s ease-in-out infinite; }
  .ph-pack-foil.is-torn { animation: pack-tear 650ms var(--ease-out) forwards; }
  .ph-pack-card { animation: pack-deal 520ms var(--ease-out) calc(var(--i) * 70ms) backwards; }
  .ph-pack-card.is-hit .ph-pack-inner { animation: pack-pop 700ms var(--ease-out); }
  @keyframes pack-shimmer { 0%, 100% { background-position: 120% 0, 0 0; } 50% { background-position: -20% 0, 0 0; } }
  @keyframes pack-wobble { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
  @keyframes pack-tear { 40% { transform: scale(1.06) rotate(-3deg); } 100% { transform: translateY(-40px) scale(.8); opacity: 0; } }
  @keyframes pack-deal { from { opacity: 0; transform: translateY(40px) scale(.9); } }
  @keyframes pack-pop { 0% { transform: rotateY(180deg) scale(1); } 50% { transform: rotateY(180deg) scale(1.14); } 100% { transform: rotateY(180deg) scale(1); } }
}

/* ---------- clearer filters: edition segmented control + category pills ---------- */
.edition-tabs { gap: 6px; }
.edition-tabs small { color: var(--ink-2); font-size: 13px; font-weight: 700; }
.edition-tabs a:not(:first-child) {
  min-height: 40px; padding: 0 18px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font-weight: 600; font-size: 14px;
}
.edition-tabs a:not(:first-child):hover { border-color: var(--brand-ink, var(--ink)); background: var(--surface); }
.edition-tabs a[aria-current]:not(:first-child) {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand-ink, var(--ink)), color-mix(in srgb, var(--brand-ink, var(--ink)) 70%, var(--brand-2, #000)));
  color: #fff; font-weight: 700;
  box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--brand-ink, #000) 80%, transparent);
}
.category-tiles { gap: 8px; padding-bottom: 12px; border-bottom: 0; }
.category-tile {
  min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  color: var(--ink-2); font-size: 15px; font-weight: 600;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}
.category-tile::after { display: none; }
.category-tile:hover { border-color: var(--brand-ink, var(--ink)); color: var(--ink); }
.category-tile small { background: var(--paper-2); color: var(--ink-2); font-size: 12px; }
.category-tile[aria-current] {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand-ink, var(--ink)), color-mix(in srgb, var(--brand-ink, var(--ink)) 70%, var(--brand-2, #000)));
  color: #fff;
  box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--brand-ink, #000) 85%, transparent);
}
.category-tile[aria-current] small { background: rgb(255 255 255 / .22); color: #fff; }
@media (max-width: 760px) { .category-tile { min-height: 40px; padding: 0 13px; font-size: 14px; } }

/* ---------- pack opening, more drama ---------- */
.ph-pack-btn { min-height: 48px; padding: 0 22px; font-size: 15px; position: relative; overflow: hidden; }
.ph-pack-btn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgb(255 255 255 / .7) 50%, transparent 65%) -150% 0 / 250% 100% no-repeat; }
.ph-pack-flash { position: fixed; inset: 0; z-index: 210; pointer-events: none; background: radial-gradient(circle at 50% 45%, #fff 0%, rgb(255 240 210 / .85) 25%, transparent 65%); opacity: 0; }
.ph-pack-card { position: relative; }
.ph-pack-card.is-hinted:not(.is-open) .ph-pack-back { box-shadow: inset 0 0 0 3px #e8c98a, 0 0 26px 2px rgb(255 205 120 / .7); }
.ph-pack-card.is-hinted[data-tier="rainbow"]:not(.is-open) .ph-pack-back { box-shadow: inset 0 0 0 3px #fff, 0 0 30px 4px rgb(190 140 255 / .8), 0 0 60px 8px rgb(255 150 200 / .4); }
.ph-pack-burst { position: absolute; left: 50%; top: 50%; z-index: -1; width: 260%; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgb(255 226 160 / .55) 0deg 8deg, transparent 8deg 22deg);
  -webkit-mask-image: radial-gradient(circle, #000 18%, transparent 62%); mask-image: radial-gradient(circle, #000 18%, transparent 62%); opacity: 0; }
.ph-pack-card[data-tier="rainbow"] .ph-pack-burst { background: repeating-conic-gradient(from 0deg, rgb(255 140 200 / .5) 0deg 6deg, rgb(140 210 255 / .45) 6deg 12deg, transparent 12deg 22deg); }
.ph-pack-confetti { position: absolute; left: 50%; top: 40%; width: 0; height: 0; pointer-events: none; z-index: 3; }
.ph-pack-confetti i { position: absolute; width: 7px; height: 11px; border-radius: 2px; background: var(--c); opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .ph-pack-btn { animation: pack-btn-pulse 2.4s ease-in-out infinite; }
  .ph-pack-btn::after { animation: pack-btn-shine 2.8s ease-in-out infinite; }
  .ph-pack-foil.is-charging { animation: pack-charge 520ms ease-in-out; }
  .ph-pack-flash { animation: pack-flash 900ms ease-out forwards; }
  .ph-pack-card.is-hinted:not(.is-open) .ph-pack-back { animation: pack-hint 1.2s ease-in-out infinite; }
  .ph-pack-card.is-hit .ph-pack-burst { animation: pack-burst 1.6s ease-out forwards, pack-spin 8s linear infinite; }
  .ph-pack-confetti i { animation: pack-confetti 1.4s cubic-bezier(.2, .7, .3, 1) forwards; }
  @keyframes pack-btn-pulse { 50% { box-shadow: 0 8px 26px -6px rgb(255 150 200 / .95), 0 0 0 4px rgb(255 211 110 / .25); } }
  @keyframes pack-btn-shine { 0%, 55% { background-position: -150% 0; } 100% { background-position: 150% 0; } }
  @keyframes pack-charge { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-4deg) scale(1.03); } 40% { transform: rotate(4deg) scale(1.05); } 60% { transform: rotate(-3deg) scale(1.07); } 80% { transform: rotate(2deg) scale(1.08); } }
  @keyframes pack-flash { 0% { opacity: 0; } 15% { opacity: .95; } 100% { opacity: 0; } }
  @keyframes pack-hint { 50% { filter: brightness(1.25); transform: translateY(-3px); } }
  @keyframes pack-burst { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 30% { opacity: 1; } 100% { opacity: .55; transform: translate(-50%, -50%) scale(1); } }
  @keyframes pack-spin { to { rotate: 360deg; } }
  @keyframes pack-confetti { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) rotate(0); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--d))) rotate(540deg); } }
}

/* ---------- pack simulator: big call-to-action in the box hero ---------- */
.ph-pack-cta {
  position: relative; isolation: isolate;
  display: grid; gap: 14px; margin-top: 16px; padding: 18px 20px;
  border-radius: 20px; color: #fff;
  background: radial-gradient(circle at 12% 0%, rgb(255 211 110 / .35), transparent 55%),
              linear-gradient(135deg, #2a1d4d, #4b2a6b 45%, #7a2f5c);
  box-shadow: 0 18px 40px -18px rgb(90 40 120 / .8);
}
.ph-pack-cta::before {
  content: ''; position: absolute; inset: -2px; z-index: -1; border-radius: 22px; padding: 2px;
  background: linear-gradient(110deg, #ffd36e, #ff9ac8, #8fd6ff, #b48cff, #ffd36e) 0 0 / 300% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.ph-pack-cta-kicker { font: 800 12px/1 var(--sans); letter-spacing: .08em; color: #ffd98f; }
.ph-pack-cta-title { display: block; margin-top: 6px; font: 800 clamp(18px, 2.2vw, 22px)/1.25 var(--sans); }
.ph-pack-cta-sub { display: block; margin-top: 4px; color: rgb(255 255 255 / .72); font-size: 13px; }
.ph-pack-cta-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-pack-cta .ph-pack-btn { margin: 0; min-height: 50px; padding: 0 22px; font-size: 16px; }
.ph-pack-cta .ph-pack-btn.is-box { background: #fff; color: #2a1d4d; box-shadow: 0 8px 22px -10px rgb(0 0 0 / .6); }
.ph-pack-cta .ph-pack-btn.is-box::before { content: '📦'; }
@media (prefers-reduced-motion: no-preference) {
  .ph-pack-cta::before { animation: cta-border 4s linear infinite; }
  @keyframes cta-border { to { background-position: 300% 0; } }
}
@media (max-width: 760px) { .ph-pack-cta-buttons .ph-pack-btn { flex: 1 1 140px; justify-content: center; } }

/* single pack: price under each revealed card, pack total, record */
.ph-pack-price { position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%); padding: 3px 9px; border-radius: 999px; background: rgb(255 255 255 / .12); color: #ffd98f; font: 800 12px/1.2 var(--sans); white-space: nowrap; }
.ph-pack-cards { row-gap: 34px; }
.ph-pack-total { color: #ffd98f !important; font-weight: 800; font-size: 16px !important; }
.ph-pack-record, .ph-box-record { color: #a39b8f !important; font-size: 12px !important; text-align: center; }
.ph-pack-actions .ph-pack-boxbtn { background: linear-gradient(110deg, #ffd36e, #ff9ac8); color: #1c1430; border-color: transparent; }

/* whole-box opening */
.ph-box-open { overflow-y: auto; }
.ph-box-open .ph-pack-stage { align-content: start; padding: 8px 0 24px; }
.ph-box-progress { display: grid; justify-items: center; gap: 14px; margin-top: 12vh; }
.ph-box-name { color: #d8d1c5; font: 700 15px/1.3 var(--sans); text-align: center; }
.ph-box-flyer { position: relative; width: 120px; height: 160px; border-radius: 14px;
  background: linear-gradient(160deg, var(--brand, #b48a4a), var(--brand-2, #6b3f1d)); box-shadow: 0 20px 50px -18px rgb(0 0 0 / .9), inset 0 0 0 2px rgb(255 255 255 / .25); }
.ph-box-mini { position: absolute; inset: 0; border-radius: 14px; background: linear-gradient(160deg, #fff6de, var(--brand, #e8c98a)); opacity: 0; }
.ph-box-counter { font: 800 28px/1 var(--sans); font-variant-numeric: tabular-nums; }
.ph-box-bar { width: min(320px, 70vw); height: 8px; border-radius: 999px; background: rgb(255 255 255 / .12); overflow: hidden; }
.ph-box-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #ffd36e, #ff9ac8); transition: width 80ms linear; }
.ph-box-result { display: grid; gap: 16px; width: min(100%, 920px); }
.ph-box-head { display: grid; justify-items: center; gap: 6px; text-align: center; }
.ph-box-total { font: 800 clamp(26px, 4vw, 38px)/1.1 var(--sans); background: linear-gradient(100deg, #fff6de, #e8c98a 55%, #fff6de); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ph-box-sub { color: #a39b8f; font-size: 12px; }
.ph-box-tally { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ph-box-tally li { padding: 6px 11px; border-radius: 999px; background: rgb(255 255 255 / .08); color: #d8d1c5; font: 700 12px/1 var(--sans); }
.ph-box-tally li[data-tier="gold"] { background: rgb(232 201 138 / .22); color: #ffe2a3; }
.ph-box-tally li[data-tier="rainbow"] { background: linear-gradient(110deg, rgb(255 122 182 / .35), rgb(110 203 255 / .35)); color: #fff; }
.ph-box-best { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 16px; margin: 0 auto; padding: 14px 18px; border-radius: 18px;
  background: linear-gradient(135deg, rgb(255 211 110 / .16), rgb(255 154 200 / .12)); box-shadow: inset 0 0 0 1px rgb(255 226 160 / .35); }
.ph-box-best-art { position: relative; width: 96px; aspect-ratio: 63 / 88; border-radius: 6px; overflow: hidden; box-shadow: 0 0 30px 2px rgb(255 205 120 / .55); }
.ph-box-best-art .ph-finder-art, .ph-box-hit-art .ph-finder-art { position: absolute; inset: 0; aspect-ratio: auto; background: none !important; }
.ph-box-best-art img, .ph-box-hit-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 1 !important; }
.ph-box-best-copy { display: grid; gap: 4px; }
.ph-box-best-copy small { color: #ffd98f; font-weight: 700; }
.ph-box-best-copy strong { font: 800 18px/1.3 var(--sans); }
.ph-box-best-copy span { color: #d8d1c5; font-size: 13px; }
.ph-box-section { color: #f1e4c8; font: 800 15px/1 var(--sans); text-align: center; }
.ph-box-hits { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px 10px; margin: 0; padding: 0; list-style: none; }
.ph-box-hit { display: grid; gap: 4px; text-align: center; }
.ph-box-hit-art { position: relative; display: block; aspect-ratio: 63 / 88; border-radius: 6px; overflow: hidden; background: #24212a; }
.ph-box-hit[data-tier="gold"] .ph-box-hit-art { box-shadow: 0 0 0 2px #e8c98a, 0 0 18px 1px rgb(255 205 120 / .5); }
.ph-box-hit[data-tier="rainbow"] .ph-box-hit-art { box-shadow: 0 0 0 2px #fff, 0 0 22px 3px rgb(190 140 255 / .65); }
.ph-box-hit-count { position: absolute; right: 4px; top: 4px; z-index: 2; padding: 3px 6px; border-radius: 999px; background: rgb(0 0 0 / .75); color: #fff; font: 800 11px/1 var(--sans); }
.ph-box-hit-name { overflow: hidden; color: #f4efe6; font: 700 12px/1.3 var(--sans); white-space: nowrap; text-overflow: ellipsis; }
.ph-box-hit small { color: #ffd98f; font-size: 11px; font-weight: 700; }
@media (prefers-reduced-motion: no-preference) {
  .ph-box-flyer { animation: box-wobble .5s ease-in-out infinite; }
  .ph-box-mini { animation: box-pop 700ms ease-out forwards; }
  .ph-box-hit { animation: pack-deal 480ms var(--ease-out) calc(var(--i) * 60ms) backwards; }
  .ph-box-total { animation: box-total 900ms var(--ease-out) both; }
  @keyframes box-wobble { 50% { transform: rotate(2deg) scale(1.02); } }
  @keyframes box-pop { 0% { opacity: .9; transform: translateY(0) rotate(0) scale(1); } 100% { opacity: 0; transform: translateY(-120px) rotate(-18deg) scale(.6); } }
  @keyframes box-total { from { opacity: 0; transform: scale(.8); } }
}

/* ---------- celebrations per rarity tier ---------- */
.ph-pack::after { content: ''; position: fixed; inset: 0; z-index: 205; pointer-events: none; opacity: 0; }
.ph-pack.fx-gold::after { box-shadow: inset 0 0 120px 30px rgb(255 205 120 / .75); background: radial-gradient(circle at 50% 50%, rgb(255 226 160 / .18), transparent 60%); }
.ph-pack.fx-rainbow::after { box-shadow: inset 0 0 160px 50px rgb(190 140 255 / .7);
  background: conic-gradient(from 0deg, rgb(255 122 182 / .28), rgb(255 211 110 / .28), rgb(125 255 178 / .28), rgb(110 203 255 / .28), rgb(180 140 255 / .28), rgb(255 122 182 / .28)); }
.ph-pack-banner { position: fixed; left: 50%; top: 18%; z-index: 220; display: grid; justify-items: center; gap: 6px; padding: 16px 28px 18px;
  transform: translateX(-50%); border-radius: 22px; text-align: center; pointer-events: none;
  background: rgb(16 14 20 / .82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; }
.ph-pack-banner.is-gold { box-shadow: 0 0 0 2px #e8c98a, 0 20px 60px -10px rgb(255 190 90 / .8); }
.ph-pack-banner.is-rainbow { box-shadow: 0 0 0 3px #fff, 0 0 60px 10px rgb(190 140 255 / .7), 0 0 120px 30px rgb(255 150 200 / .4); }
.ph-pack-banner small { font: 800 12px/1 var(--sans); letter-spacing: .3em; color: #ffd98f; }
.ph-pack-banner.is-rainbow small { background: linear-gradient(90deg, #ff7ab6, #ffd36e, #7dffb2, #6ecbff, #b48cff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ph-pack-banner strong { font: 900 clamp(26px, 5vw, 44px)/1.1 var(--sans); letter-spacing: -.02em; }
.ph-pack-banner.is-gold strong { background: linear-gradient(100deg, #fff6de, #e8c98a 50%, #fff6de); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ph-pack-banner.is-rainbow strong { background: linear-gradient(90deg, #ff9ac8, #ffe08a, #9dffc8, #8fd6ff, #c9a8ff, #ff9ac8) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
.ph-pack-banner-name { color: #e4dccf; font: 700 14px/1.2 var(--sans); }
.ph-pack-banner-art { position: relative; display: block; width: 110px; aspect-ratio: 63 / 88; border-radius: 7px; overflow: hidden; margin-bottom: 4px; }
.ph-pack-banner.is-rainbow .ph-pack-banner-art { width: 150px; box-shadow: 0 0 40px 6px rgb(190 140 255 / .8); }
.ph-pack-banner-art .ph-finder-art { position: absolute; inset: 0; aspect-ratio: auto; background: none !important; }
.ph-pack-banner-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 1 !important; }
.ph-pack-banner.is-leaving { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(.95); transition: opacity 300ms ease, transform 300ms ease; }
.ph-pack-card.is-spotlight { z-index: 6; }
.ph-pack-rain { position: fixed; inset: 0; z-index: 215; pointer-events: none; overflow: hidden; }
.ph-pack-rain i { position: absolute; top: -20px; width: 8px; height: 14px; border-radius: 2px; background: var(--c); opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .ph-pack.fx-gold::after { animation: fx-glow 1.1s ease-out; }
  .ph-pack.fx-rainbow::after { animation: fx-glow 1.9s ease-out; }
  .ph-pack.fx-rainbow .ph-pack-stage { animation: fx-shake 500ms ease-in-out; }
  .ph-pack-banner { animation: banner-in 500ms cubic-bezier(.2, 1.4, .4, 1) both; }
  .ph-pack-banner.is-rainbow strong { animation: banner-shine 1.2s linear infinite; }
  .ph-pack-card.is-spotlight .ph-pack-inner { animation: spotlight 1.1s ease-in-out; }
  .ph-pack-card.is-spotlight[data-tier="rainbow"] .ph-pack-inner { animation: spotlight-big 1.9s ease-in-out; }
  .ph-pack-rain i { animation: rain-fall var(--dur) linear var(--delay) forwards; }
  @keyframes fx-glow { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
  @keyframes fx-shake { 0%, 100% { transform: translate(0); } 20% { transform: translate(-8px, 4px); } 40% { transform: translate(7px, -5px); } 60% { transform: translate(-5px, 3px); } 80% { transform: translate(3px, -2px); } }
  @keyframes banner-in { from { opacity: 0; transform: translateX(-50%) scale(.5); } }
  @keyframes banner-shine { to { background-position: 200% 0; } }
  @keyframes spotlight { 0%, 100% { transform: rotateY(180deg) scale(1); } 40%, 70% { transform: rotateY(180deg) scale(1.25); } }
  @keyframes spotlight-big { 0%, 100% { transform: rotateY(180deg) scale(1); } 30%, 75% { transform: rotateY(180deg) scale(1.45); } }
  @keyframes rain-fall { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: .9; transform: translateY(110vh) rotate(720deg); } }
}

/* ---------- real pack photos ---------- */
.ph-pack-foil.has-photo { background: none; box-shadow: none; overflow: visible; gap: 10px; aspect-ratio: auto; width: min(64vw, 270px); }
.ph-pack-foil.has-photo::before, .ph-pack-foil.has-photo::after { display: none; }
.ph-pack-foil.has-photo .ph-pack-art { width: 100%; aspect-ratio: auto; filter: drop-shadow(0 24px 34px rgb(0 0 0 / .7)); }
.ph-pack-foil.has-photo .ph-pack-art img { display: block; width: auto; max-width: 100%; height: auto; max-height: 58vh; margin: 0 auto; object-fit: contain; }
.ph-pack-foil.has-photo .ph-pack-name { font-size: 15px; }
.ph-pack-foil.has-photo .ph-pack-tap { padding: 8px 16px; border-radius: 999px; background: rgb(255 255 255 / .14); }
.ph-box-flyer.has-photo { background: var(--pack) center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 20px 30px rgb(0 0 0 / .7)); width: 140px; height: 210px; }
.ph-box-flyer.has-photo .ph-box-mini { background: var(--pack) center / contain no-repeat; }
.ph-pack-cta.has-pack { grid-template-columns: 74px 1fr; column-gap: 16px; }
.ph-pack-cta.has-pack > :not(.ph-pack-cta-pack) { grid-column: 2; }
.ph-pack-cta-pack { grid-row: 1 / span 2; align-self: center; }
.ph-pack-cta-pack img { display: block; width: 74px; height: auto; filter: drop-shadow(0 10px 16px rgb(0 0 0 / .55)); transform: rotate(-6deg); }
@media (prefers-reduced-motion: no-preference) {
  .ph-pack-cta-pack img { animation: cta-pack 3s ease-in-out infinite; }
  @keyframes cta-pack { 50% { transform: rotate(4deg) translateY(-4px); } }
}
@media (max-width: 560px) { .ph-pack-cta.has-pack { grid-template-columns: 56px 1fr; } .ph-pack-cta-pack img { width: 56px; } }

/* the pack CTA is its own full-width row of the box hero (it used to squeeze into the text column on phones) */
.ph-box-hero-art { grid-row: 1; grid-column: 1; }
.ph-box-hero-copy { grid-row: 1; grid-column: 2; }
.ph-box-hero-fan { grid-row: 1; grid-column: 3; }
.ph-box-hero > .ph-pack-cta { grid-row: 2; grid-column: 1 / -1; margin-top: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 20px; }
.ph-box-hero > .ph-pack-cta.has-pack { grid-template-columns: 74px minmax(0, 1fr) auto; }
.ph-box-hero > .ph-pack-cta .ph-pack-cta-copy { grid-column: auto; }
.ph-box-hero > .ph-pack-cta .ph-pack-cta-buttons { grid-column: auto; justify-content: flex-end; }
.ph-box-hero > .ph-pack-cta.has-pack > :not(.ph-pack-cta-pack) { grid-column: auto; }
.ph-box-hero > .ph-pack-cta .ph-pack-cta-pack { grid-row: auto; }
@media (max-width: 900px) {
  .ph-box-hero-fan { grid-row: 2; grid-column: 1 / -1; }
  .ph-box-hero > .ph-pack-cta, .ph-box-hero > .ph-pack-cta.has-pack { grid-row: 3; grid-template-columns: 56px minmax(0, 1fr); row-gap: 14px; padding: 16px; }
  .ph-box-hero > .ph-pack-cta:not(.has-pack) { grid-template-columns: minmax(0, 1fr); }
  .ph-box-hero > .ph-pack-cta > .ph-pack-cta-buttons, .ph-box-hero > .ph-pack-cta.has-pack > .ph-pack-cta-buttons { grid-column: 1 / -1; justify-content: stretch; }
  .ph-box-hero > .ph-pack-cta .ph-pack-cta-buttons .ph-pack-btn { flex: 1 1 0; justify-content: center; min-height: 52px; padding: 6px 10px; font-size: 14px; line-height: 1.25; white-space: normal; text-align: center; }
  .ph-box-hero > .ph-pack-cta .ph-pack-btn.is-box::before, .ph-box-hero > .ph-pack-cta .ph-pack-btn:not(.is-box)::before { display: none; }
  .ph-box-hero > .ph-pack-cta .ph-pack-cta-pack img { width: 56px; }
}
.ph-pack-filler { font-size: 13px; letter-spacing: .02em; text-align: center; padding: 0 6px; }

/* ---------- common / uncommon filler card ---------- */
.ph-pack-filler {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 10px;
  border-radius: inherit; overflow: hidden; text-align: center; letter-spacing: normal;
  background:
    radial-gradient(circle at 50% 38%, rgb(255 255 255 / .16), transparent 55%),
    repeating-linear-gradient(45deg, rgb(255 255 255 / .05) 0 2px, transparent 2px 9px),
    linear-gradient(160deg, color-mix(in srgb, var(--brand, #7a7480) 55%, #2a2731), color-mix(in srgb, var(--brand-2, #3a3542) 45%, #17151b));
  box-shadow: inset 0 0 0 3px rgb(255 255 255 / .18), inset 0 0 0 7px rgb(0 0 0 / .18);
  color: #f4efe6;
}
.ph-filler-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 7px 11px; border-radius: 999px;
  background: rgb(255 255 255 / .14); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .35);
  font: 900 15px/1 var(--sans); letter-spacing: .04em;
}
.ph-filler-badge i { opacity: .6; font-style: normal; }
.ph-filler-title { font: 800 clamp(11px, 3.4vw, 14px)/1.2 var(--sans); text-shadow: 0 1px 6px rgb(0 0 0 / .5); white-space: nowrap; }
.ph-filler-sub { color: rgb(244 239 230 / .72); font: 600 10.5px/1 var(--sans); letter-spacing: .14em; }

/* ---------- swipe to tear ---------- */
.ph-pack-foil { touch-action: none; }
.ph-pack-tearline { position: absolute; left: 4%; right: 4%; top: 9%; z-index: 4; height: 3px; border-radius: 2px; pointer-events: none;
  background: linear-gradient(90deg, #fff calc(var(--tear, 0) * 100%), rgb(255 255 255 / .25) calc(var(--tear, 0) * 100%));
  box-shadow: 0 0 calc(var(--tear, 0) * 18px) rgb(255 240 200 / .9); opacity: .9; }
.ph-pack-tearline::after { content: '✂'; position: absolute; top: 50%; left: calc(var(--tear, 0) * 100%); transform: translate(-50%, -55%); color: #fff; font-size: 16px; text-shadow: 0 1px 6px rgb(0 0 0 / .6); }
.ph-pack-foil.has-photo .ph-pack-tearline { top: 7%; }

/* ---------- last card: tease, then a slow flip ---------- */
.ph-pack-card.is-slow .ph-pack-inner { transition-duration: 1.3s; }
@media (prefers-reduced-motion: no-preference) {
  .ph-pack-card.is-teasing { animation: tease 1s ease-in-out; z-index: 5; }
  .ph-pack-card.is-teasing .ph-pack-back { box-shadow: inset 0 0 0 3px #fff, 0 0 34px 6px rgb(255 230 170 / .8); }
  @keyframes tease { 0% { transform: none; } 15% { transform: translateY(-8px) rotate(-3deg) scale(1.06); } 30% { transform: translateY(-8px) rotate(3deg) scale(1.08); }
    45% { transform: translateY(-10px) rotate(-2deg) scale(1.1); } 60% { transform: translateY(-10px) rotate(2deg) scale(1.12); } 100% { transform: translateY(-12px) scale(1.14); } }
}

/* ---------- collection + badges ---------- */
.ph-pack-collect { color: #9dffc8 !important; font-weight: 800; font-size: 14px !important; }
.ph-pack-actions .ph-pack-albumbtn { background: rgb(157 255 200 / .14); border-color: rgb(157 255 200 / .45); color: #c8ffe0; }
.ph-pack-albumlink { min-height: 50px; padding: 0 16px; border-radius: 999px; border: 1px solid rgb(255 255 255 / .35); background: rgb(255 255 255 / .1); color: #fff; font: 800 14px/1 var(--sans); cursor: pointer; }
.ph-album { overflow-y: auto; }
.ph-album .ph-pack-stage { align-content: start; padding: 8px 0 24px; gap: 16px; }
.ph-album-head { display: grid; justify-items: center; gap: 10px; text-align: center; width: min(100%, 760px); }
.ph-album-title { font: 800 clamp(20px, 3.4vw, 28px)/1.2 var(--sans); }
.ph-album-bar { width: min(100%, 420px); height: 10px; }
.ph-album-count { color: #ffd98f; font: 800 15px/1 var(--sans); }
.ph-album-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.ph-album-badges li { display: grid; justify-items: center; gap: 3px; width: 66px; padding: 8px 4px; border-radius: 12px; background: rgb(255 255 255 / .05); opacity: .35; filter: grayscale(1); }
.ph-album-badges li.is-on { opacity: 1; filter: none; background: rgb(255 211 110 / .14); box-shadow: inset 0 0 0 1px rgb(255 211 110 / .45); }
.ph-album-badges span { font-size: 20px; line-height: 1; }
.ph-album-badges small { color: #e4dccf; font-size: 10px; line-height: 1.2; text-align: center; }
.ph-album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; width: min(100%, 980px); margin: 0; padding: 0; list-style: none; }
.ph-album-grid li { display: grid; gap: 4px; text-align: center; }
.ph-album-grid small { color: #a39b8f; font-size: 10.5px; font-weight: 700; }
.ph-album-grid li.is-missing .ph-box-hit-art img { filter: grayscale(1) brightness(.35); }
.ph-album-grid li.is-owned[data-tier="gold"] .ph-box-hit-art { box-shadow: 0 0 0 2px #e8c98a; }
.ph-album-grid li.is-owned[data-tier="rainbow"] .ph-box-hit-art { box-shadow: 0 0 0 2px #fff, 0 0 14px 2px rgb(190 140 255 / .6); }
.ph-album-q { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; color: rgb(255 255 255 / .55); font: 900 28px/1 var(--sans); font-style: normal; }
.ph-badge-toast { position: fixed; right: 16px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 230; display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px;
  padding: 12px 18px 12px 14px; border-radius: 16px; background: linear-gradient(135deg, #3a2a10, #5a3d12); box-shadow: 0 0 0 1px #e8c98a, 0 18px 40px -12px rgb(0 0 0 / .8); color: #fff; }
.ph-badge-icon { grid-row: 1 / span 2; font-size: 28px; }
.ph-badge-kicker { color: #ffd98f; font: 800 11px/1 var(--sans); letter-spacing: .12em; }
.ph-badge-toast strong { font: 800 15px/1.2 var(--sans); }
.ph-badge-toast.is-leaving { opacity: 0; transform: translateY(12px); transition: opacity 300ms ease, transform 300ms ease; }
@media (prefers-reduced-motion: no-preference) { .ph-badge-toast { animation: toast-in 420ms cubic-bezier(.2, 1.4, .4, 1); } @keyframes toast-in { from { opacity: 0; transform: translateY(24px) scale(.9); } } }
@media (max-width: 760px) { .ph-box-hero > .ph-pack-cta .ph-pack-albumlink { flex: 1 1 100%; min-height: 44px; } }

/* ---------- sound toggle ---------- */
.ph-pack-sound { position: fixed; left: 16px; top: 16px; z-index: 240; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .25); background: rgb(255 255 255 / .08); font-size: 18px; cursor: pointer; }

/* ---------- pity gauge ---------- */
.ph-pity { display: grid; gap: 5px; width: min(100%, 320px); }
.ph-pity small { color: #ffd98f; font: 800 12px/1.2 var(--sans); }
.ph-pity-bar { display: block; height: 7px; border-radius: 999px; background: rgb(255 255 255 / .12); overflow: hidden; }
.ph-pity-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ff7ab6, #ffd36e, #7dffb2, #6ecbff, #b48cff); }
.ph-pack-summary .ph-pity, .ph-box-result .ph-pity { justify-self: center; text-align: center; }

/* ---------- binder / wishlist value ---------- */
.ph-binder-value { display: grid; gap: 8px; margin: 4px 0 16px; padding: 18px 20px; border-radius: 20px; color: #fff;
  background: radial-gradient(circle at 90% 0%, rgb(255 211 110 / .25), transparent 55%), linear-gradient(135deg, #1f1b2a, #2b2140 60%, #3a2342); box-shadow: var(--shadow-sm); }
.ph-binder-value-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.ph-binder-value-head small { flex-basis: 100%; color: #ffd98f; font: 800 12px/1 var(--sans); letter-spacing: .06em; }
.ph-binder-value-head strong { font: 900 clamp(26px, 4vw, 36px)/1.1 var(--sans); letter-spacing: -.02em;
  background: linear-gradient(100deg, #fff6de, #e8c98a 55%, #fff6de); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ph-binder-value-move { padding: 4px 10px; border-radius: 999px; background: rgb(255 255 255 / .1); color: #d8d1c5; font: 800 13px/1.2 var(--sans); }
.ph-binder-value-move.is-up { background: rgb(209 73 91 / .22); color: #ff9aa8; }
.ph-binder-value-move.is-down { background: rgb(47 127 209 / .22); color: #9cc8ff; }
.ph-binder-value-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; color: #c9c1b4; font-size: 13px; }
.ph-binder-value-label { color: #a39b8f; font-size: 11px; font-weight: 700; }
.ph-binder-value-top { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: top; }
.ph-binder-value-top li { counter-increment: top; padding: 5px 10px; border-radius: 999px; background: rgb(255 255 255 / .08); font-size: 13px; font-weight: 700; }
.ph-binder-value-top li::before { content: counter(top) '. '; color: #ffd98f; }
.ph-binder-value-note { color: #8f887d; font-size: 11px; }
.ph-finder-results > li { position: relative; }
.ph-card-change { position: absolute; top: 8px; right: 8px; z-index: 3; padding: 3px 7px; border-radius: 999px; font: 800 11px/1 var(--sans); color: #fff; box-shadow: 0 4px 10px -4px rgb(0 0 0 / .6); }
.ph-card-change.is-up { background: #d1495b; }
.ph-card-change.is-down { background: #2f7fd1; }

/* box result: the ordinary cards, smaller than the hits */
.ph-box-rest { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px 8px; }
.ph-box-rest .ph-box-hit { animation: none; min-width: 0; }
.ph-box-rest .ph-box-hit-name { font-size: 11px; font-weight: 600; }
.ph-box-rest .ph-pack-filler { position: absolute; inset: 0; }
.ph-box-result .ph-pack-collect { justify-self: center; text-align: center; }

/* ---------- edition + card game badges ---------- */
.ph-editions { display: flex; flex-wrap: wrap; gap: 5px; }
.ph-edition, .ph-series {
  position: relative; display: inline-flex; align-items: center; gap: 6px; overflow: hidden;
  min-height: 25px; padding: 3px 9px 3px 5px; border-radius: 7px;
  font: 700 12px/1 var(--sans); letter-spacing: -.01em; white-space: nowrap;
}
.ph-edition { padding-left: 6px; background: var(--surface, #fff); color: var(--ink, #16141b); box-shadow: inset 0 0 0 1.5px var(--ed, #9b948a); }
.ph-edition.is-jp { --ed: #d0314b; } .ph-edition.is-na { --ed: #3c4b9e; } .ph-edition.is-en { --ed: #2b4fa8; } .ph-edition.is-kr { --ed: #1c5fc4; } .ph-edition.is-cn { --ed: #de2910; }
.ph-flag { display: inline-block; flex: none; width: 19px; height: 13px; border-radius: 2.5px; background: center / cover no-repeat; box-shadow: 0 0 0 .75px rgb(0 0 0 / .28); }
.ph-flag.is-jp { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20' preserveAspectRatio='xMidYMid slice'%3E%3Crect width='30' height='20' fill='%23fff'/%3E%3Ccircle cx='15' cy='10' r='6' fill='%23bc002d'/%3E%3C/svg%3E"); }
.ph-flag.is-na { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20' preserveAspectRatio='xMidYMid slice'%3E%3Crect width='30' height='20' fill='%23fff'/%3E%3Crect y='0.00' width='30' height='1.6' fill='%23b22234'/%3E%3Crect y='1.54' width='30' height='1.6' fill='%23fff'/%3E%3Crect y='3.08' width='30' height='1.6' fill='%23b22234'/%3E%3Crect y='4.62' width='30' height='1.6' fill='%23fff'/%3E%3Crect y='6.15' width='30' height='1.6' fill='%23b22234'/%3E%3Crect y='7.69' width='30' height='1.6' fill='%23fff'/%3E%3Crect y='9.23' width='30' height='1.6' fill='%23b22234'/%3E%3Crect y='10.77' width='30' height='1.6' fill='%23fff'/%3E%3Crect y='12.31' width='30' height='1.6' fill='%23b22234'/%3E%3Crect y='13.85' width='30' height='1.6' fill='%23fff'/%3E%3Crect y='15.38' width='30' height='1.6' fill='%23b22234'/%3E%3Crect y='16.92' width='30' height='1.6' fill='%23fff'/%3E%3Crect y='18.46' width='30' height='1.6' fill='%23b22234'/%3E%3Crect width='12.6' height='10.8' fill='%233c3b6e'/%3E%3Ccircle cx='2.0' cy='2.0' r='.6' fill='%23fff'/%3E%3Ccircle cx='2.0' cy='4.6' r='.6' fill='%23fff'/%3E%3Ccircle cx='2.0' cy='7.2' r='.6' fill='%23fff'/%3E%3Ccircle cx='2.0' cy='9.8' r='.6' fill='%23fff'/%3E%3Ccircle cx='4.6' cy='2.0' r='.6' fill='%23fff'/%3E%3Ccircle cx='4.6' cy='4.6' r='.6' fill='%23fff'/%3E%3Ccircle cx='4.6' cy='7.2' r='.6' fill='%23fff'/%3E%3Ccircle cx='4.6' cy='9.8' r='.6' fill='%23fff'/%3E%3Ccircle cx='7.2' cy='2.0' r='.6' fill='%23fff'/%3E%3Ccircle cx='7.2' cy='4.6' r='.6' fill='%23fff'/%3E%3Ccircle cx='7.2' cy='7.2' r='.6' fill='%23fff'/%3E%3Ccircle cx='7.2' cy='9.8' r='.6' fill='%23fff'/%3E%3Ccircle cx='9.8' cy='2.0' r='.6' fill='%23fff'/%3E%3Ccircle cx='9.8' cy='4.6' r='.6' fill='%23fff'/%3E%3Ccircle cx='9.8' cy='7.2' r='.6' fill='%23fff'/%3E%3Ccircle cx='9.8' cy='9.8' r='.6' fill='%23fff'/%3E%3C/svg%3E"); }
.ph-flag.is-en { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20' preserveAspectRatio='xMidYMid slice'%3E%3Crect width='30' height='20' fill='%23012169'/%3E%3Cpath d='M0 0L30 20M30 0L0 20' stroke='%23fff' stroke-width='4'/%3E%3Cpath d='M0 0L30 20M30 0L0 20' stroke='%23c8102e' stroke-width='1.6'/%3E%3Cpath d='M15 0V20M0 10H30' stroke='%23fff' stroke-width='6.4'/%3E%3Cpath d='M15 0V20M0 10H30' stroke='%23c8102e' stroke-width='3.8'/%3E%3C/svg%3E"); }
.ph-flag.is-kr { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20' preserveAspectRatio='xMidYMid slice'%3E%3Crect width='30' height='20' fill='%23fff'/%3E%3Cpath d='M10 10a5 5 0 0 1 10 0' fill='%23cd2e3a'/%3E%3Cpath d='M10 10a5 5 0 0 0 10 0' fill='%230047a0'/%3E%3Ccircle cx='12.5' cy='10' r='2.5' fill='%23cd2e3a'/%3E%3Ccircle cx='17.5' cy='10' r='2.5' fill='%230047a0'/%3E%3Cpath d='M4 4.4l3-2M4.9 5.6l3-2M23 2.4l3 2M22.1 3.6l3 2M4 15.6l3 2M4.9 14.4l3 2M23 17.6l3-2M22.1 16.4l3-2' stroke='%23222' stroke-width='.8'/%3E%3C/svg%3E"); }
.ph-flag.is-cn { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20' preserveAspectRatio='xMidYMid slice'%3E%3Crect width='30' height='20' fill='%23de2910'/%3E%3Cpath d='M6 3l1.2 3.6H11L8 8.8l1.1 3.6L6 10.2l-3.1 2.2L4 8.8 1 6.6h3.8z' fill='%23ffde00'/%3E%3C/svg%3E"); }
.ph-series { background: linear-gradient(115deg, var(--s1, #55505c), var(--s2, #2d2a33)); color: #fff; text-shadow: 0 1px 1px rgb(0 0 0 / .25); }
.ph-series-tag { display: inline-grid; place-items: center; min-width: 22px; height: 18px; padding: 0 4px; border-radius: 4px; background: rgb(255 255 255 / .94); color: var(--s2, #2d2a33); font: 900 10.5px/1 var(--sans); letter-spacing: 0; text-shadow: none; }
:is(.ph-series, .ph-series-tag, .edition-tabs a).is-ua { --s1: #f0620c; --s2: #b02d06; }
:is(.ph-series, .ph-series-tag, .edition-tabs a).is-ws { --s1: #4b4b55; --s2: #101014; }
:is(.ph-series, .ph-series-tag, .edition-tabs a).is-blau { --s1: #2f7fe0; --s2: #123f8f; }
:is(.ph-series, .ph-series-tag, .edition-tabs a).is-nivel { --s1: #d43f8d; --s2: #6a2480; }
:is(.ph-series, .ph-series-tag, .edition-tabs a).is-bd { --s1: #16808f; --s2: #0b4753; }
:is(.ph-series, .ph-series-tag, .edition-tabs a).is-uvs { --s1: #6a45e0; --s2: #35178f; }
:is(.ph-series, .ph-series-tag, .edition-tabs a).is-map { --s1: #0c8f60; --s2: #065039; }
:is(.ph-series, .ph-series-tag, .edition-tabs a).is-fusion { --s1: #d9630f; --s2: #8d3206; }
:is(.ph-series, .ph-series-tag, .edition-tabs a).is-kayou { --s1: #c3273b; --s2: #741221; }
:is(.ph-series, .ph-series-tag, .edition-tabs a).is-bandai { --s1: #d8222a; --s2: #86101a; }
:is(.ph-series, .ph-series-tag, .edition-tabs a).is-lorcana { --s1: #6a3fb5; --s2: #38206e; }
:is(.ph-series, .ph-series-tag, .edition-tabs a).is-rift { --s1: #0a8f93; --s2: #07535a; }
.ph-box-hero .ph-editions { margin: 2px 0 6px; }
.ph-box-hero .ph-edition { background: #f7f3ea; color: #16141b; }
.ph-finder-detail-copy .ph-editions { margin: 2px 0 4px; }
/* language tabs carry the flag, game tabs the game colour */
.edition-tabs a.is-edition { gap: 8px; }
.edition-tabs a.is-edition .ph-flag { width: 22px; height: 15px; }
.series-tabs { margin-top: 10px; }
.edition-tabs a.is-line { position: relative; gap: 7px; overflow: hidden; border-color: var(--line-strong); }
.edition-tabs a.is-line:not([aria-current]) .ph-series-tag { background: linear-gradient(115deg, var(--s1), var(--s2)); color: #fff; }
.edition-tabs a.is-line[class*=" is-"]:not(.is-edition)[aria-current] { border-color: transparent; background: linear-gradient(115deg, var(--s1, var(--brand, #55505c)), var(--s2, var(--brand-ink, #2d2a33))); color: #fff; box-shadow: 0 6px 18px -6px var(--s1, rgb(0 0 0 / .5)); }
/* a light sweep over the badge when its box is pointed at, and once over the chosen tab */
:is(.ph-edition, .ph-series, .edition-tabs a.is-line[aria-current])::after { content: ''; position: absolute; inset: -20% auto -20% -45%; width: 34%; transform: skewX(-20deg); background: linear-gradient(90deg, transparent, rgb(255 255 255 / .6), transparent); opacity: 0; pointer-events: none; }
.ph-edition::after { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ed, #999) 45%, transparent), transparent); }
@media (prefers-reduced-motion: no-preference) {
  @keyframes ph-badge-sweep { from { left: -45%; opacity: 1; } to { left: 120%; opacity: 1; } }
  :is(a, button, li):is(:hover, :focus-visible) :is(.ph-edition, .ph-series)::after { animation: ph-badge-sweep 800ms ease-out; }
  .ph-box-hero :is(.ph-edition, .ph-series)::after { animation: ph-badge-sweep 900ms ease-out 700ms 2; }
  .edition-tabs a.is-line[aria-current]::after { animation: ph-badge-sweep 900ms ease-out 500ms 1; }
}
@media (max-width: 740px) {
  .ph-edition, .ph-series { min-height: 23px; padding-right: 7px; font-size: 11px; gap: 5px; }
  .ph-flag { width: 17px; height: 12px; }
}

/* daily bonus pack */
.ph-pack-bonus { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; border: 0; border-radius: 999px; background: linear-gradient(110deg, #ffd36e, #ff9d5c 55%, #ff7ab6); color: #2a1408; font: 800 14px/1 var(--sans); cursor: pointer; box-shadow: 0 8px 22px -8px rgb(255 150 90 / .8); }
.ph-pack-bonus:disabled { background: rgb(255 255 255 / .12); color: rgb(244 239 230 / .7); box-shadow: none; cursor: default; }
@media (prefers-reduced-motion: no-preference) {
  .ph-pack-bonus.is-calling { animation: ph-bonus-call 1.1s ease-in-out 6; }
  @keyframes ph-bonus-call { 50% { transform: scale(1.06); box-shadow: 0 0 0 8px rgb(255 190 110 / .25), 0 10px 30px -6px rgb(255 150 90 / .9); } }
}
@media (max-width: 740px) { .ph-pack-cta-buttons .ph-pack-bonus { flex: 1 1 100%; grid-column: 1 / -1; min-height: 48px; } }

/* search-engine text at the end of a catalog (public build only, seo.py) */
.ph-about { margin: 56px 0 8px; padding-top: 24px; border-top: 1px solid rgb(128 120 110 / .25); color: var(--muted, #77706a); font-size: 14px; line-height: 1.7; }
.ph-about h2 { margin: 0 0 8px; font-size: 17px; color: var(--ink, inherit); }
.ph-about summary { cursor: pointer; padding: 8px 0; font-weight: 700; }
.ph-about ul { margin: 4px 0 0; padding: 0; list-style: none; columns: 220px; column-gap: 24px; }
.ph-about li { break-inside: avoid; padding: 2px 0; }

/* binder backup / restore (assets/backup.js) */
.binder-backup { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; }
.binder-backup-note { flex: 1 1 100%; margin: 0; color: var(--muted); font-size: 13px; }
.binder-backup button { min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: transparent; color: var(--ink-2); font: 600 14px/1 var(--sans); cursor: pointer; }
@media (hover: hover) { .binder-backup button:hover { border-color: var(--ink); color: var(--ink); } }
