
.page { max-width: 1180px; margin: 0 auto; padding: 0 20px 4rem; }

.head {
  position: relative; margin-top: 150px; padding: 2rem 2.2rem;
  background: var(--yellow); border: var(--b); border-radius: 24px; box-shadow: var(--s-lg);
  display: grid; grid-template-columns: 1fr auto; gap: 1.5rem 2rem; align-items: end;
}
.head::before {
  content: ""; position: absolute; inset: 0; border-radius: 21px; pointer-events: none;
  background: radial-gradient(circle at 90% 10%, rgba(255,255,255,0.45), transparent 40%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cdefs%3E%3Cg id='p'%3E%3Cellipse cx='0' cy='8' rx='11' ry='9'/%3E%3Ccircle cx='-12' cy='-4' r='4.5'/%3E%3Ccircle cx='-4.5' cy='-11' r='4.5'/%3E%3Ccircle cx='4.5' cy='-11' r='4.5'/%3E%3Ccircle cx='12' cy='-4' r='4.5'/%3E%3C/g%3E%3Cpath id='s' d='M0-9C1-3 3-1 9 0 3 1 1 3 0 9-1 3-3 1-9 0-3-1-1-3 0-9Z'/%3E%3C/defs%3E%3Cg fill='%23502B04' fill-opacity='0.075'%3E%3Cuse href='%23p' transform='translate%2842 52%29 rotate%28-20%29 scale%281.0%29'/%3E%3Cuse href='%23p' transform='translate%28172 40%29 rotate%2825%29 scale%280.65%29'/%3E%3Cuse href='%23p' transform='translate%28120 142%29 rotate%2810%29 scale%281.25%29'/%3E%3Cuse href='%23p' transform='translate%2834 190%29 rotate%28-35%29 scale%280.7%29'/%3E%3Cuse href='%23p' transform='translate%28206 178%29 rotate%2840%29 scale%280.9%29'/%3E%3Cuse href='%23s' transform='translate%2898 62%29 rotate%280%29 scale%281.0%29'/%3E%3Cuse href='%23s' transform='translate%28216 104%29 rotate%2815%29 scale%280.7%29'/%3E%3Cuse href='%23s' transform='translate%2870 122%29 rotate%280%29 scale%280.55%29'/%3E%3Cuse href='%23s' transform='translate%28150 218%29 rotate%2820%29 scale%280.85%29'/%3E%3Ccircle cx='140' cy='20' r='2.2'/%3E%3Ccircle cx='12' cy='110' r='2.2'/%3E%3Ccircle cx='230' cy='230' r='2.2'/%3E%3Ccircle cx='92' cy='230' r='2.2'/%3E%3Ccircle cx='190' cy='140' r='2.2'/%3E%3C/g%3E%3C/svg%3E");
}
.head > * { position: relative; }
.peek { position: absolute; left: 4%; bottom: calc(100% - 15px); width: 260px; z-index: 2; }
.head h1 { margin: 0.7rem 0 0.2rem; font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.02; }
.head p { margin: 0 0 1.1rem; font-weight: 600; color: #3f3a2c; max-width: 560px; }
.head .search { max-width: 520px; }
.stats { display: flex; gap: 0.7rem; }
.stat { background: var(--paper); border: var(--b); border-radius: 16px; box-shadow: var(--s-sm); padding: 0.6rem 1rem; min-width: 120px; }
.stat b { display: block; font-size: 1.8rem; line-height: 1; }
.stat small { font-weight: 700; color: var(--muted); }
@media (max-width: 760px) {
  .head { grid-template-columns: 1fr; margin-top: 120px; padding: 1.6rem 1.3rem; }
  .peek { width: 200px; left: 50%; margin-left: -100px; }
}

.grid { margin-top: 2.5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1.4rem 1.2rem; }
.dex-card {
  position: relative; cursor: pointer; text-align: left; padding: 0; overflow: hidden;
  background: #fff; border: var(--b); border-radius: 18px; box-shadow: var(--s-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.dex-card:nth-child(odd) { transform: rotate(-1.5deg); }
.dex-card:nth-child(even) { transform: rotate(1.5deg); }
.dex-card:hover, .dex-card:focus-visible { transform: rotate(0) translate(-2px, -3px); box-shadow: 6px 6px 0 var(--ink); outline: none; }
.dex-card .num {
  position: absolute; top: 8px; left: 8px; z-index: 1; background: var(--yellow);
  border: 2px solid var(--ink); border-radius: 999px; padding: 0 0.5rem; font-size: 0.72rem; font-weight: 800;
}
.dex-card .thumb { height: 130px; display: flex; align-items: center; justify-content: center; border-bottom: 2.5px solid var(--ink); background: var(--tint); }
.dex-card .thumb img { max-width: 84%; max-height: 84%; object-fit: contain; }
.dex-card .thumb .bi { font-size: 2.2rem; color: #b9b2a0; }
.dex-card .nm { display: block; padding: 0.5rem 0.6rem; text-align: center; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skeleton { height: 178px; border: var(--b); border-radius: 18px; background: repeating-linear-gradient(45deg, #fff, #fff 10px, #f5ead2 10px, #f5ead2 20px); }
.empty { grid-column: 1 / -1; text-align: center; padding: 3rem 1rem; font-weight: 800; font-size: 1.1rem; }
#sentinel { height: 1px; }
.more { text-align: center; color: var(--muted); font-weight: 800; padding: 1.5rem 0; }

dialog {
  width: min(440px, 92vw); padding: 0; border: var(--b); border-radius: 24px; box-shadow: var(--s-lg);
  background: var(--paper); color: var(--ink); overflow: visible;
}
dialog::backdrop { background: rgba(31, 31, 31, 0.45); backdrop-filter: blur(3px); }
dialog[open] { animation: pop 0.18s ease-out; }
@keyframes pop { from { transform: scale(0.94); opacity: 0; } }
.d-art {
  height: 250px; display: flex; align-items: center; justify-content: center; border-bottom: var(--b);
  border-radius: 21px 21px 0 0; background: radial-gradient(circle, rgba(255,255,255,0.75) 0 25%, transparent 65%), var(--tint);
}
.d-art img { max-height: 88%; max-width: 88%; object-fit: contain; filter: drop-shadow(3px 4px 0 rgba(31,31,31,0.25)); }
.d-art .bi { font-size: 4rem; color: #b9b2a0; }
.d-body { padding: 1.2rem 1.4rem 1.5rem; }
.d-body h2 { margin: 0.5rem 0 0.4rem; font-size: 1.9rem; line-height: 1.05; }
.d-body p { margin: 0; font-weight: 600; color: var(--muted); }
.d-close { position: absolute; top: -14px; right: -14px; background: var(--coral); color: #fff; border-radius: 50%; width: 44px; height: 44px; }
