body {
  font-family: Arial, sans-serif;
  background: #121212;
  color: white;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

.nav {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 18px;
  border-bottom:1px solid rgba(255,255,255,0.04);
}
.brand { font-weight:700; font-size:18px; }
.nav-links { list-style:none; margin:0; padding:0; display:flex; gap:8px; align-items:center; }
.nav-links li { display:inline; }
.nav-btn {
  background:transparent; border:none; color: #dcdcdc; padding:8px 10px; cursor:pointer; border-radius:8px;
}
.nav-btn.active, .nav-btn:hover { background: rgba(255,255,255,0.04); color:#fff; }

.container {
  max-width:1080px;
  margin: 20px auto;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
}

.page { background: transparent; padding: 6px; }
.hidden { display:none; }

.page-header h1 { margin:0; font-size:22px; }
.subtitle { margin:6px 0 12px; color:#bdbdbd; }

.controls { display:flex; gap:10px; align-items:center; margin:8px 0 18px; }
button { background: #ff4d6d; color: white; padding: 10px 18px; font-size:14px; border:none; border-radius:8px; cursor:pointer; }
button.ghost { background:transparent; border:1px solid rgba(255,255,255,0.06); color:#ddd; }
button[disabled] { opacity:0.6; cursor:not-allowed; }
#result { margin-top:6px; min-height:220px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; padding:12px; border-radius:10px; background: rgba(255,255,255,0.02); }

.rate-list { margin-top:18px; background: rgba(255,255,255,0.02); border-radius:8px; padding:12px; }
.rate-item { display:flex; justify-content:space-between; padding:8px 0; border-bottom:1px solid rgba(255,255,255,0.03); }
.meta { font-size:13px; color:#cfcfcf; margin-bottom:8px; }
.small { font-size:12px; color:#bdbdbd; }

.footer { margin-top:24px; padding:18px; text-align:center; color:#bdbdbd; border-top:1px solid rgba(255,255,255,0.03); }

@media (max-width: 920px) {
  .container { grid-template-columns: 1fr; padding:12px; }
}

.rarity-label {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  margin-top: 10px;
}

.rarity-label .badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.6px;
  transform-origin: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  opacity: 0;
  transform: perspective(800px) rotateX(30deg) scale(0.92);
  transition: opacity 260ms cubic-bezier(.2,.9,.2,1),
              transform 420ms cubic-bezier(.2,.9,.2,1),
              filter 300ms;
  border: 1px solid rgba(255,255,255,0.06);
}

.rarity-label .badge .icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: rgba(255,255,255,0.95);
  background: rgba(255,255,255,0.08);
}

.rarity-label.show .badge {
  opacity: 1;
  transform: perspective(800px) rotateX(0deg) scale(1.06);
  filter: drop-shadow(0 12px 30px rgba(0,0,0,0.55));
}

.rarity-label.settled .badge {
  transform: perspective(800px) rotateX(0deg) scale(1);
  transition: transform 350ms cubic-bezier(.2,.9,.2,1);
}

.rarity-label .subtitle {
  margin-top: 8px;
  font-size: 12px;
  color: #d1d5db;
  opacity: 0.9;
}

.rarity-ur .badge {
  background: linear-gradient(90deg,#ffd6a5,#ffb4a2 40%,#fbc1ff 70%);
  color: #2b1f00;
  box-shadow: 0 18px 48px rgba(255,182,85,0.18), 0 8px 28px rgba(124,58,237,0.06);
}
.rarity-ur .badge .icon {
  background: rgba(255,255,255,0.18);
  color: #2b1f00;
}

.rarity-ssr .badge {
  background: linear-gradient(90deg,#ffd700,#ffb84d);
  color: #2b1f00;
  box-shadow: 0 16px 40px rgba(255,190,0,0.18);
}

.rarity-sr .badge {
  background: linear-gradient(90deg,#5eead4,#0ea5e9);
  color: #042a2b;
  box-shadow: 0 14px 36px rgba(14,165,233,0.10);
}
.rarity-sr .badge .icon {
  background: rgba(255,255,255,0.06);
}

.rarity-rare .badge {
  background: linear-gradient(90deg,#a78bfa,#7c3aed);
  color: #fff;
  box-shadow: 0 14px 36px rgba(124,58,237,0.12);
}

.rarity-common .badge {
  background: linear-gradient(90deg,#6b7280,#374151);
  color: #fff;
  box-shadow: 0 8px 22px rgba(0,0,0,0.35);
}

@media (max-width: 420px) {
  .rarity-label .badge {
    padding: 10px 14px;
    font-size: 16px;
    gap: 8px;
  }
  .rarity-label .badge .icon {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
}
