:root {
  --bg: #f5f8ff;
  --card: #ffffff;
  --text: #18304a;
  --muted: #5c6f84;
  --line: #d9e4f2;
  --brand: #0d63c9;
  --brand-deep: #0a4fa2;
  --brand-soft: #eaf3ff;
  --accent: #ffb703;
  --success-bg: #ebfff3;
  --success-border: #63b784;
  --danger-bg: #fff0f0;
  --danger-border: #d97474;
  --shadow: 0 18px 45px rgba(14, 47, 89, 0.08);
  --radius: 22px;
  --radius-sm: 14px;
  --max: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f7fbff 0%, #eef5ff 100%);
  color: var(--text);
  font-family: Arial, sans-serif;
  line-height: 1.7;
  font-size: 18px;
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
}

body.nav-open-ios {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}

img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 20px;
}

picture {
  display: block;
}

a {
  color: var(--brand-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1400;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(217, 228, 242, 0.8);
  overflow-x: clip;
}


.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.site-branding__logo {
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, #7b5cff 100%);
  color: #fff;
  text-decoration: none;
  font-size: 1.45rem;
  box-shadow: 0 10px 20px rgba(13, 99, 201, 0.25);
}

.site-branding__name {
  display: inline-block;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
}

.site-branding__tag {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-nav {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 92vw);
  height: 100dvh;
  max-height: 100dvh;
  background: #fff;
  box-shadow: -18px 0 50px rgba(18, 35, 59, 0.16);
  padding: 18px 18px 24px;
  transform: translateX(100%);
  transition: transform 0.28s ease;
  z-index: 1250;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  visibility: hidden;
  pointer-events: none;
}

body.nav-open .site-nav {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.site-nav__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.site-nav__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.site-nav__close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--text);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.site-nav__list a {
  display: block;
  padding: 14px 16px;
  border-radius: 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 700;
  border: 1px solid var(--line);
  background: #fff;
}

.site-nav__list a:hover,
.site-nav__list a[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand-deep);
  border-color: #b7cae4;
}

.site-nav-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 14px;
  background: var(--brand-soft);
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
}

.site-nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 0;
  border-radius: 999px;
}

.site-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 35, 59, 0.34);
  z-index: 1300;
}

.hero-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 20px 0;
}

.hero-card {
  background: linear-gradient(135deg, #0f62c8 0%, #7d4eff 100%);
  color: #fff;
  border-radius: 30px;
  padding: 34px clamp(22px, 4vw, 42px);
  box-shadow: 0 24px 60px rgba(28, 69, 146, 0.24);
}

.hero-card h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.12;
}

.hero-card p {
  margin: 14px 0 0;
  max-width: 760px;
  font-size: 1.08rem;
  color: rgba(255, 255, 255, 0.95);
}

.hero-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

.button-link--light {
  background: #fff;
  color: var(--brand-deep);
}

.button-link--ghost {
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
}

.page-shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 20px 56px;
}

.breadcrumbs {
  margin: 16px 0 18px;
}

.breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  color: #95a8bc;
}

.content-card {
  background: var(--card);
  border: 1px solid #edf2f9;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 38px);
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.page-meta__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 0.95rem;
  font-weight: 700;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
  gap: 24px;
  align-items: start;
}

.calculator-card,
.sidebar-card,
.fact-card,
.callout-card,
.link-card,
.faq-card,
.result,
.error {
  border-radius: var(--radius);
}

.calculator-card,
.sidebar-card,
.fact-card,
.callout-card,
.link-card,
.faq-card {
  border: 1px solid var(--line);
  background: #fff;
  padding: 22px;
}

.calculator-card h2,
.content-card h2,
.content-card h3,
.sidebar-card h3,
.fact-card h3,
.callout-card h3,
.link-card h3,
.faq-card h3 {
  margin-top: 0;
  color: var(--brand-deep);
}

.lead-image {
  margin-bottom: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--text);
}

select,
button,
input[type="submit"] {
  font: inherit;
}

select {
  width: 100%;
  border: 1px solid #c7d5e6;
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  padding: 13px 14px;
}

input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand) 0%, #7d4eff 100%);
  color: #fff;
  font-weight: 700;
  padding: 14px 22px;
  cursor: pointer;
  box-shadow: 0 15px 25px rgba(13, 99, 201, 0.18);
}

.quick-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.quick-links li {
  margin: 0;
  padding: 0;
  background: transparent;
}

.quick-links a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
}

.quick-links a span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 400;
}

.quick-links a:hover {
  border-color: #b7cae4;
  background: #f8fbff;
}

.result {
  margin-top: 22px;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  padding: 22px;
}

.error {
  margin-top: 22px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  padding: 22px;
}

.rarity-score {
  margin: 18px 0;
  border-radius: 20px;
  padding: 22px;
  text-align: center;
  background: linear-gradient(135deg, #fff9d7 0%, #ffe7a8 100%);
  border: 2px solid #f3c45c;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.45);
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 700;
  color: #8b5d00;
}

.muted-note {
  color: var(--muted);
  font-size: 0.98rem;
}

.section-stack {
  display: grid;
  gap: 18px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 28px 0;
}

.card-grid--single {
  grid-template-columns: 1fr;
}

.callout-card {
  background: linear-gradient(180deg, #f9fbff 0%, #f1f7ff 100%);
}

.link-card {
  text-decoration: none;
  color: inherit;
}

.link-card:hover {
  border-color: #bdd2ec;
  background: #f9fbff;
}

.faq-list {
  display: grid;
  gap: 14px;
}

.faq-item {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.faq-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.site-footer {
  margin-top: 36px;
  background: #0f223a;
  color: #dfe9f5;
}

.site-footer a {
  color: #fff;
  text-decoration: none;
}

.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px;
}

.site-footer__brand h2,
.site-footer__links h3 {
  color: #fff;
}

.site-footer__links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.site-footer__links ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__links li {
  margin: 10px 0 0;
  padding: 0;
  background: transparent;
}

.site-footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 16px 20px 28px;
  text-align: center;
}

@media (max-width: 820px) {
  .site-branding__tag {
    display: none;
  }
}

@media (max-width: 900px) {
  .layout-grid,
  .site-footer__inner,
  .site-footer__links {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 17px;
  }

  .hero-wrap,
  .page-shell,
  .site-header__inner,
  .site-footer__inner,
  .site-footer__bottom {
    padding-left: 16px;
    padding-right: 16px;
  }

  .site-nav {
    width: min(340px, 92vw);
    padding: 16px 14px 22px;
  }

  .content-card,
  .calculator-card,
  .sidebar-card,
  .fact-card,
  .callout-card,
  .link-card,
  .faq-card,
  .result,
  .error {
    padding: 18px;
    border-radius: 18px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .hero-card {
    border-radius: 24px;
  }
}

.confetti-burst {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3000;
  overflow: hidden;
}

.confetti-burst.is-fading {
  opacity: 0;
  transition: opacity 0.8s ease;
}

.confetti-piece {
  position: absolute;
  top: -12vh;
  width: var(--size, 12px);
  height: calc(var(--size, 12px) * 1.3);
  border-radius: 999px;
  opacity: 0.95;
  background: linear-gradient(180deg, #ff6fd8 0%, #ffd166 100%);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
  animation: confetti-fall linear forwards;
}

.confetti-piece:nth-child(4n) {
  background: linear-gradient(180deg, #8b5cf6 0%, #60a5fa 100%);
}

.confetti-piece:nth-child(4n + 1) {
  background: linear-gradient(180deg, #34d399 0%, #fef08a 100%);
}

.confetti-piece:nth-child(4n + 2) {
  background: linear-gradient(180deg, #fb7185 0%, #fdba74 100%);
}

.confetti-piece:nth-child(4n + 3) {
  background: linear-gradient(180deg, #22d3ee 0%, #c084fc 100%);
}

@keyframes confetti-fall {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  100% {
    transform: translate3d(var(--drift, 0px), 120vh, 0) rotate(var(--spin, 0deg));
  }
}

.field--full {
  grid-column: 1 / -1;
}

.result {
  margin-top: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 22px;
}

.rarity-score {
  margin: 18px 0;
  border-radius: 24px;
  padding: 24px 22px;
  text-align: center;
  background: linear-gradient(135deg, #fff7c9 0%, #ffe6f8 45%, #e7f5ff 100%);
  border: 2px solid #f3c45c;
  box-shadow: 0 18px 40px rgba(88, 66, 180, 0.12), inset 0 0 0 1px rgba(255,255,255,0.5);
  color: #6a3cc7;
}

.rarity-score__eyebrow {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8b5d00;
}

.rarity-score__number {
  margin: 8px 0 4px;
  font-size: clamp(3.2rem, 9vw, 6rem);
  line-height: 1;
  font-weight: 800;
  color: var(--brand-deep);
  text-shadow: 0 8px 24px rgba(13, 99, 201, 0.18);
  animation: rarity-pop 0.6s ease;
}

.rarity-score__outof {
  font-size: 1rem;
  font-weight: 700;
  color: #6a3cc7;
}

@keyframes rarity-pop {
  0% {
    transform: scale(0.92);
    opacity: 0.5;
  }
  65% {
    transform: scale(1.06);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}