* { box-sizing: border-box; }
.portal :is(h1,h2,h3,p,figure) { margin: 0; }
.portal {
  width: min(1192px, calc(100% - clamp(34px,7vw,96px)));
  margin: 6px auto 0;
  padding-bottom: 20px;
}
.feature {
  position: relative; isolation: isolate; overflow: hidden; display: grid;
  grid-template-columns: 1.04fr 1fr; align-items: center;
  min-height: clamp(310px,30vw,398px);
  border: 1px solid #a6b5d6a6; border-radius: 32px;
  background:
    radial-gradient(ellipse at 84% 4%, #b9b5ee 0,transparent 41%),
    radial-gradient(ellipse at 77% 79%, #d2c4ee 0,transparent 48%),
    radial-gradient(ellipse at 43% 0%, #d1f3ff 0,transparent 50%),
    linear-gradient(113deg,#f1f9ff 1%,#d4e7fb 47%,#c9d2ed 75%,#aebcde 100%);
  box-shadow: inset 0 1.5px 1px #fff, inset 0 -2px 2px #a2aecb65, 0 10px 36px -18px #2f4e8466;
}
.feature::before {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background: linear-gradient(124deg,#ffffff50,transparent 56%),linear-gradient(23deg,transparent 50%,#ffffff48 61%,transparent 75%);
  pointer-events: none;
}
.feature-copy { padding: 30px 0 35px clamp(28px,5vw,72px); z-index: 3; }
.game { display: flex; align-items: center; gap: 9px; font-weight: 620; color: #3d526f; font-size: .94rem; }
.ball { width: 16px; height: 16px; border-radius: 50%; border: 1.7px solid currentColor; display: inline-grid; place-items: center; background: linear-gradient(to bottom,transparent 43%, currentColor 44% 56%,transparent 57%); }
.ball::after { content: ""; width: 3px; height: 3px; border: 1.5px solid currentColor; background: #e9f4ff; border-radius: 50%; }
.portal h1 { margin: 17px 0 16px; font-size: clamp(2.3rem,4.6vw,4.2rem); line-height: 1.13; letter-spacing: -.059em; font-weight: 720; color: #182744; }
.intro { color: #41546d; font-size: clamp(1rem,1.5vw,1.15rem); line-height: 1.6; }
.launch {
  margin-top: 25px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(160deg,#4c69ae 0%,#2b4378 45%,#20355f); color: #fff;
  border: 1px solid #283e6b; border-radius: 32px; padding: 12px 22px; min-height: 45px;
  font-size: .97rem; font-weight: 650; text-decoration: none;
  box-shadow: inset 0 1.5px 1.5px #aebff1b3,inset 0 -1px 1px #12203a66,0 5px 10px #304a7a2b;
}
.launch:hover { background: linear-gradient(160deg,#466ac0,#263f76); }
.launch:active { transform: translateY(1px); }
.moon-scene { position: relative; align-self: stretch; min-width: 0; z-index: 1; }
.stars {
  position: absolute; inset: 0 -7% 0 -14%; pointer-events: none;
  background:
    radial-gradient(circle at 19% 22%,#fff 0 1.5px,transparent 2.5px),
    radial-gradient(circle at 77% 69%,#fff 0 2px,transparent 3px),
    radial-gradient(circle at 84% 22%,#fff 0 2px,transparent 3px),
    radial-gradient(circle at 22% 85%,#fffb 0 1.5px,transparent 2.5px),
    radial-gradient(circle at 4% 64%,#fff9 0 1.5px,transparent 2.5px);
}
.stars::before,.stars::after {
  content:""; position:absolute; height: 19px; aspect-ratio: 1; background: #fff;
  clip-path: polygon(50% 0,58% 40%,100% 50%,60% 59%,50% 100%,40% 60%,0 50%,40% 40%);
}
.stars::before { left: 6%; top: 31%; } .stars::after { right: 17%; top: 40%; height: 12px; }
.moon-disc {
  position:absolute; height: 83%; aspect-ratio: 1; left: 49%; top: 49%; transform: translate(-50%,-50%);
  border-radius: 50%; border: 1px solid #ffffffe0;
  background: radial-gradient(at 28% 18%,#ffffffe8 0%,#f4f3ffa8 39%,#dadbf96b 66%,#a6a8de40 89%);
  box-shadow: inset 2px 5px 12px #ffffffbc,inset -2px -5px 16px #9f9cc533,0 0 42px #fffbff69;
}
.orbit { position:absolute; top:49%; left:49%; border:1px solid #f6f8ffe0; border-radius: 50%; pointer-events:none; }
.orbit-outer { width:106%; height:57%; transform:translate(-50%,-50%) rotate(-23deg); box-shadow:0 1px 0 #8799bc45; }
.orbit-inner { width:83%; height:68%; transform:translate(-50%,-50%) rotate(32deg); border-color:#fff8; }
.lunala {
  display: block; position: absolute; height: 106%; width: 94%; max-width: none; top: -4%; left: 1%;
  object-fit: contain; transform: rotate(9deg);
  filter: drop-shadow(0 14px 12px #49488138);
}
.species-tag {
  display:flex; align-items:center; gap:8px; position:absolute; bottom:18px; right:20px;
  padding:6px 11px; background:#f5f6ffe8; color:#364560;
  border:1px solid #9eacca8c;border-radius:20px; box-shadow:var(--yy-edge);
  font-weight:600; font-size:.82rem;line-height:1.35;
}
.type-pair { display:flex; gap:2px; } .type-pair img { width:15px;height:15px;object-fit:contain; }
.dex-no { font-family:ui-monospace,Menlo,monospace;font-size:.77rem;font-weight:550;color:#4c5b72; }
.directory { margin: clamp(28px,3vw,40px) 0 0; }
.portal h2 { margin-bottom: 14px; color:var(--yy-ink);font-size:clamp(1.3rem,2.1vw,1.72rem); line-height:1.3;letter-spacing:-.04em; }
.cards { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px; }
.tool {
  --tint: #d4e5f4; --accent:#284a88; --edge:#96adca;
  color:var(--yy-ink); text-decoration:none; position:relative;display:block;overflow:hidden;isolation:isolate;
  padding:clamp(18px,2vw,26px); min-height:189px;
  border-radius:24px;border:1px solid color-mix(in srgb, var(--edge) 61%, #fff);
  background:radial-gradient(ellipse 75% 100% at 99% 8%,var(--tint),transparent),linear-gradient(145deg,#fff,#f9fbff);
  box-shadow:inset 0 1.5px 1.5px white, inset 0 -1px 1px #b5c1d02b, 0 4px 12px #43577b09;
  transition: transform .2s,box-shadow .2s;
}
.rank-tool { --tint:#fae6bc; --accent:#875619; --edge:#cebb94; }
.calc-tool { --tint:#d8d6f7; --accent:#6152a3; --edge:#b5abce; }
.query-tool { --tint:#c5ecea; --accent:#16727b; --edge:#a1c7c8; }
.tool::before {
  content:""; position:absolute;z-index:-1;inset:-25% -9% auto auto;width:51%;height:89%;
  border:1px solid #ffffffbf; border-radius:50%; transform:rotate(-24deg);
}
.tool-symbol {
  width:34px;height:34px;display:grid;place-items:center;border:1px solid color-mix(in srgb,var(--tint) 70%,#869aaa);
  background:color-mix(in srgb,var(--tint) 48%,white);color:var(--accent);border-radius:11px;
  box-shadow:inset 0 1.5px 1px #fff;
}
.card-art { position:absolute;right:2%;top:-2%;width:36%;height:68%;object-fit:contain;z-index:-1;filter:drop-shadow(0 6px 4px #41526a1b); }
.rank-tool .card-art { transform:rotate(7deg); }
.portal h3 { margin:18px 0 6px;font-size:clamp(1.1rem,1.7vw,1.45rem);font-weight:680;letter-spacing:-.035em; }
.tool p { font-size:.96rem;line-height:1.53;color:var(--yy-muted); }
@media (hover:hover) {
  .tool:hover { transform:translateY(-3px);box-shadow:inset 0 1.5px 1px white,0 9px 20px #394b7620; }
}
.portal a:focus-visible { outline:3px solid #315cc9;outline-offset:3px; }
.portal footer { display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;margin:28px 3px 0;padding-top:15px;border-top:1px solid #adbbd085;color:var(--yy-muted);font-size:.85rem; }
.portal footer a { color:#3a5278;text-underline-offset:3px; }
@media (min-width:1500px) { .feature { min-height:400px; } }
@media (max-width:820px) and (min-width:661px) {
  .feature-copy { padding-left:30px; } .portal h1 { font-size:2.4rem; }
  .tool {padding:15px;min-height:170px;} .card-art { width:40%;height:51%;right:0; }
}
@media (max-width:660px) {
  .portal { width:calc(100% - 32px); margin-top:2px; }
  .feature { display:flex;flex-direction:column;align-items:stretch;border-radius:24px; }
  .moon-scene { order:-1;height:clamp(178px,41vw,235px);width:100%; }
  .moon-disc { height:96%;left:54%;top:53%; } .orbit { left:54%; }
  .orbit-outer {width:89%;height:66%;} .orbit-inner {width:65%;height:80%;}
  .lunala { width:85%;height:121%;top:-8%;left:9%; }
  .species-tag {right:11px;bottom:5px;gap:5px;padding:4px 8px;font-size:.73rem;} .type-pair img {width:13px;height:13px;} .dex-no {font-size:.67rem;}
  .feature-copy { padding:10px 22px 23px; }
  .game {font-size:.86rem;} .portal h1 {font-size:clamp(2rem,8vw,2.85rem);margin:7px 0 8px;}
  .intro { font-size:.96rem; } .intro br {display:none;} .launch {margin-top:14px;padding:9px 16px;}
  .directory {margin-top:24px;} .portal h2 {margin-bottom:12px;}
  .cards {grid-template-columns:1fr;gap:11px;}
  .tool {padding:16px 95px 16px 18px;min-height:106px;display:grid;grid-template-columns:32px 1fr;column-gap:10px;align-content:center;border-radius:19px;}
  .tool-symbol {width:30px;height:30px;border-radius:10px;grid-column:1;grid-row:1;}
  .portal h3 {grid-column:2;align-self:center;margin:0;font-size:1.14rem;}
  .tool p {grid-column:1/-1;margin:5px 0 0;line-height:1.5;font-size:.89rem;} .tool p br {display:none;}
  .card-art {right:5px;top:4%;width:24%;height:91%;} .tool::before {width:36%;height:118%;inset:-29% -2% auto auto;}
}
@media (prefers-reduced-motion:reduce) { .tool {transition:none;} .tool:hover,.launch:active {transform:none;} }
@media (prefers-reduced-transparency:reduce), (prefers-contrast:more) {
  .species-tag {background:#f9fbff;} .feature,.tool {border-color:#8798b1;}
}
