:root {
  --bg: #f3f7fa;
  --text: #0b1325;
  --muted: #64748b;
  --line: rgba(56, 216, 135, 0.22);
  --green: #29b96f;
  --panel: rgba(255, 255, 255, 0.45);
  --shadow: 
    0 24px 60px rgba(56, 216, 135, 0.08), 
    0 8px 16px rgba(0, 0, 0, 0.03), 
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  background: var(--bg);
}

.bg-glows {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 20%, rgba(56, 216, 135, 0.14), transparent 30%),
    radial-gradient(circle at 90% 15%, rgba(56, 216, 135, 0.1), transparent 30%),
    radial-gradient(circle at 50% 80%, rgba(56, 216, 135, 0.08), transparent 40%),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(56, 216, 135, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 216, 135, 0.025) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(circle at center, black 18%, transparent 88%);
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 40px;
}

.hero {
  text-align: center;
}

.brand-mark {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.brand-mark-ring {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(56, 216, 135, 0.25);
  box-shadow: 0 18px 38px rgba(56, 216, 135, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

.brand-mark-svg {
  width: 46px;
  height: 46px;
  fill: var(--green);
  filter: drop-shadow(0 4px 10px rgba(56, 216, 135, 0.2));
}

.eyebrow,
.mini-label,
.mode-badge,
.status,
.profile-chip,
.tier-pill,
.result-footer span {
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow,
.mini-label {
  margin: 0;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 700;
}

h1,
.score-card strong,
.hero-score span,
#score-tier,
.section-heading h3 {
  font-family: "Sora", sans-serif;
}

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
  color: var(--text);
}

.headline-accent {
  color: var(--green);
}

.lede {
  width: min(780px, 100%);
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

.scan-form {
  width: min(820px, 100%);
  margin: 20px auto 0;
  padding: 24px;
  display: grid;
  gap: 16px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  z-index: 10;
}

.scan-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.scan-card-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.scan-card-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.scan-card-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(56, 216, 135, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.scan-card-logo-svg {
  width: 26px;
  height: 26px;
  fill: var(--green);
}

.scan-card-brand strong {
  display: block;
  font-family: "Sora", sans-serif;
  font-size: 1.08rem;
  letter-spacing: -0.03em;
  color: var(--text);
}

.scan-card-brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.scan-card-mode {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(56, 216, 135, 0.25);
  background: rgba(56, 216, 135, 0.08);
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 700;
}

.scan-fields {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

.scan-fields > .input-group:first-child {
  grid-column: span 7;
}

.scan-fields > .input-group:nth-child(2) {
  grid-column: span 5;
}

.scan-fields > #discord-roles-select {
  grid-column: span 4;
}

.scan-fields > #portal-tier-select {
  grid-column: span 4;
}

.scan-fields > #pudgy-nft-select {
  grid-column: span 4;
}

.discord-roles-wrap {
  margin-top: 14px;
  margin-bottom: 2px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.discord-roles-wrap .field-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(15, 23, 42, 0.55);
}

.roles-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.role-chip {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(56, 216, 135, 0.16);
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 3px rgba(0, 0, 0, 0.02);
}

.role-chip:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(56, 216, 135, 0.35);
  transform: translateY(-1px);
}

.role-chip.active {
  background: rgba(56, 216, 135, 0.12);
  border-color: rgba(56, 216, 135, 0.8);
  color: #1b7445;
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(56, 216, 135, 0.08);
}

/* Custom Select Dropdowns */
.custom-select {
  position: relative;
  width: 100%;
  height: 50px;
  cursor: pointer;
  user-select: none;
  z-index: 2;
}

.custom-select.active {
  z-index: 50;
}

.select-trigger {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(56, 216, 135, 0.15);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  padding: 0 16px;
  display: flex;
  align-items: center;
  font-size: 0.96rem;
  box-sizing: border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 200ms ease, box-shadow 200ms ease, background-color 200ms ease;
  overflow: hidden;
}

.select-trigger > span {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select.active .select-trigger {
  border-color: rgba(56, 216, 135, 0.45);
  box-shadow: 0 0 0 4px rgba(56, 216, 135, 0.08);
  background: #ffffff;
}

.select-trigger .chevron {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: rgba(15, 23, 42, 0.45);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 200ms ease;
  flex-shrink: 0;
  margin-left: 8px;
}

.custom-select.active .select-trigger .chevron {
  transform: rotate(180deg);
}

.select-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(56, 216, 135, 0.18);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
}

.custom-select.active .select-options {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.select-options .option {
  padding: 10px 16px;
  font-size: 0.92rem;
  color: var(--text);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background-color 150ms ease, color 150ms ease;
}

/* Tier and Role Icons */
.tier-icon,
.role-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
  pointer-events: none;
  overflow: visible; /* Prevents stroke clipping */
}

.tier-icon.none path,
.tier-icon.none circle {
  fill: rgba(15, 23, 42, 0.1);
  stroke: rgba(15, 23, 42, 0.25);
  stroke-width: 1.5;
}
.tier-icon.bronze path {
  fill: #d08854;
  stroke: #8e4e20;
  stroke-width: 2;
}
.tier-icon.bronze {
  filter: drop-shadow(0 0 6px rgba(208, 136, 84, 0.8));
}
.tier-icon.silver path {
  fill: #b4c0cc;
  stroke: #667584;
  stroke-width: 2;
}
.tier-icon.silver {
  filter: drop-shadow(0 0 6px rgba(180, 192, 204, 0.75));
}
.tier-icon.gold path {
  fill: #ffd700;
  stroke: #b59800;
  stroke-width: 2;
}
.tier-icon.gold {
  filter: drop-shadow(0 0 7px rgba(255, 215, 0, 0.85));
}
.tier-icon.platinum path {
  fill: #54a0ff;
  stroke: #1257ab;
  stroke-width: 2;
}
.tier-icon.platinum {
  filter: drop-shadow(0 0 8px rgba(84, 160, 255, 0.9));
}
.tier-icon.diamond path {
  fill: #00d2d3;
  stroke: #007c7d;
  stroke-width: 2;
}
.tier-icon.diamond {
  filter: drop-shadow(0 0 8px rgba(0, 210, 211, 0.9));
}
.tier-icon.obsidian path {
  fill: #8e44ad;
  stroke: #592570;
  stroke-width: 2;
}
.tier-icon.obsidian {
  filter: drop-shadow(0 0 8px rgba(142, 68, 173, 0.95));
}

.role-emoji {
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
  display: inline-block;
  pointer-events: none;
}

.role-icon.verified {
  color: #10b981;
}

.select-trigger-content {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  min-width: 0;
}

.select-options .option:first-child {
  border-top-left-radius: 13px;
  border-top-right-radius: 13px;
}

.select-options .option:last-child {
  border-bottom-left-radius: 13px;
  border-bottom-right-radius: 13px;
}

.select-options .option:hover {
  background: rgba(56, 216, 135, 0.08);
  color: #1b7445;
}

.select-options .option.selected {
  background: rgba(56, 216, 135, 0.14);
  color: #1b7445;
  font-weight: 600;
}

.select-options::-webkit-scrollbar {
  width: 6px;
}
.select-options::-webkit-scrollbar-track {
  background: transparent;
}
.select-options::-webkit-scrollbar-thumb {
  background: rgba(56, 216, 135, 0.2);
  border-radius: 3px;
}
.select-options::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 216, 135, 0.4);
}

.scan-form input,
.scan-form select {
  width: 100%;
  min-width: 0;
  height: 50px;
  border: 1px solid rgba(56, 216, 135, 0.15);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  padding: 0 16px;
  outline: none;
  font-size: 0.96rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 200ms ease, box-shadow 200ms ease, background-color 200ms ease;
}

.scan-form input::placeholder {
  color: rgba(100, 116, 139, 0.55);
}

.scan-form input:focus,
.scan-form select:focus {
  border-color: rgba(56, 216, 135, 0.4);
  box-shadow: 0 0 0 4px rgba(56, 216, 135, 0.08);
  background: #ffffff;
}

.input-group {
  position: relative;
  width: 100%;
}

.input-group input.valid {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1) !important;
}

.wallet-group.is-valid::after {
  content: "✓";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #10b981;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.field-feedback {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  pointer-events: none;
  transition: all 180ms ease;
  white-space: nowrap;
}

.field-feedback.hidden {
  opacity: 0;
}

.field-feedback.valid {
  color: #10b981;
}

.field-feedback.invalid {
  color: #ef4444;
}

.field-feedback.checking {
  color: rgba(15, 23, 42, 0.4);
  font-style: italic;
}

.scan-form button,
.result-actions button {
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

.scan-form button:hover,
.result-actions button:hover {
  transform: translateY(-1px);
}

.scan-form button {
  height: 50px;
  color: #ffffff;
  min-width: 180px;
  background: linear-gradient(135deg, #38d887, #24a864);
  box-shadow: 0 10px 24px rgba(56, 216, 135, 0.2);
  font-weight: 700;
}

.scan-meta {
  width: min(820px, 100%);
  margin: 14px auto 0;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mode-badge,
.status,
.profile-chip,
.tier-pill,
.result-footer span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(56, 216, 135, 0.15);
  background: rgba(255, 255, 255, 0.7);
}

.mode-badge,
.status {
  min-height: 36px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 0.74rem;
}

.result {
  width: min(980px, 100%);
  margin: 28px auto 0;
}

.tiers-section {
  width: min(1120px, 100%);
  margin: 28px auto 0;
  text-align: center;
}

.tiers-kicker {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}

.tiers-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.tier-card {
  padding: 24px 16px 20px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.45);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 200ms ease, border-color 200ms ease;
}

.tier-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 216, 135, 0.35);
}

.penguin-badge {
  width: 140px;
  height: 140px;
  margin: 0 auto 16px;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.75) 0%, rgba(56, 216, 135, 0.09) 100%);
  border: 1px solid rgba(56, 216, 135, 0.22);
  box-shadow: 
    0 8px 24px rgba(56, 216, 135, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 0 rgba(56, 216, 135, 0.05);
  transition: transform 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}

.tier-card:hover .penguin-badge {
  transform: scale(1.04) translateY(-2px);
  border-color: rgba(56, 216, 135, 0.38);
  box-shadow: 
    0 12px 30px rgba(56, 216, 135, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.penguin-badge {
  position: relative;
  isolation: isolate;
}

/* ============================================================
   NINJA: remove white background from the PNG rendering
   ============================================================ */
.penguin-badge.mid .penguin-img {
  mix-blend-mode: multiply;
}

/* ============================================================
   SCALE PER TIER
   ============================================================ */
.penguin-img {
  width: 90%;
  height: 90%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  transition: transform 200ms ease;
  position: relative;
  z-index: 1;
}

.penguin-badge.muted .penguin-img {
  transform: scale(0.95);
}

.penguin-badge.soft .penguin-img {
  transform: scale(0.90);
}

.penguin-badge.mid .penguin-img {
  transform: scale(1.0);
}

.penguin-badge.bright .penguin-img {
  transform: scale(1.10);
}

.penguin-badge.max .penguin-img {
  transform: scale(0.95);
}

.tier-card strong {
  display: block;
  font-family: "Sora", sans-serif;
  font-size: 0.98rem;
  letter-spacing: -0.03em;
  color: var(--text);
}

.tier-card span {
  display: block;
  margin-top: 6px;
  color: var(--green);
  font-weight: 700;
  font-size: 0.88rem;
}

.tier-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.88rem;
}

.hidden {
  display: none !important;
}

.score-card {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 24px;
  border-radius: 34px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.04),
    0 8px 16px rgba(0, 0, 0, 0.02);
  position: relative;
  display: flex;
  flex-direction: column;
}

.score-card-dots {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18'><circle cx='9' cy='9' r='1.5' fill='rgba(56, 216, 135, 0.12)'/></svg>");
  background-repeat: repeat;
  pointer-events: none;
  z-index: 0;
  border-radius: 33px;
}

.score-card-glow-line {
  display: none !important;
}

.score-card-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 75%;
  height: 75%;
  opacity: 0.015;
  pointer-events: none;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-card-watermark svg {
  width: 100%;
  height: 100%;
  fill: #000000;
}

.score-card-mascot {
  display: none;
}

.score-card-mascot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(0.02) saturate(0.95);
}

.score-card-head,
.score-card-main,
.result-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.score-card-head {
  padding-top: 4px;
}

.score-brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.score-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #f3faf6;
  border: 1px solid rgba(56, 216, 135, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 6px 14px rgba(56, 216, 135, 0.05);
}

.score-brand-logo {
  width: 24px;
  height: 24px;
  fill: #10b981;
  filter: drop-shadow(0 2px 4px rgba(56, 216, 135, 0.15));
}

.score-brand strong {
  display: block;
  font-size: 1.16rem;
  letter-spacing: -0.04em;
  color: var(--text);
}

.score-brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.profile-chip {
  min-height: 36px;
  padding: 0 14px;
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 700;
  background: #f3faf6;
  border: 1px solid rgba(56, 216, 135, 0.16);
}

.score-card-main {
  margin-top: 20px;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 20px;
  background: #f3faf6;
  border: 1px solid rgba(56, 216, 135, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 6px 14px rgba(56, 216, 135, 0.05);
}

.score-copy {
  flex: 1;
  padding-top: 10px;
  padding-bottom: 4px;
}

.hero-score {
  margin-top: 6px;
}

.hero-score span {
  display: block;
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  line-height: 0.85;
  letter-spacing: -0.06em;
  color: var(--green);
  text-shadow: 0 4px 10px rgba(56, 216, 135, 0.1);
}

.hero-score small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.tier-pill {
  margin-top: 10px;
  min-height: 32px;
  width: fit-content;
  padding: 0 14px;
  color: var(--green);
  font-size: 0.66rem;
  font-weight: 700;
  background: rgba(56, 216, 135, 0.08);
  border: 1px solid rgba(56, 216, 135, 0.2);
  display: none;
}

.score-ring-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 156px;
  padding: 2px 0 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.score-mascot-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.score-mascot-stack::after {
  content: "";
  width: 110px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(56, 216, 135, 0) 0%,
    rgba(56, 216, 135, 0.18) 18%,
    rgba(56, 216, 135, 0.34) 50%,
    rgba(56, 216, 135, 0.18) 82%,
    rgba(56, 216, 135, 0) 100%
  );
  margin-top: -1px;
}

.score-mascot-panel {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(242, 249, 245, 0.96));
  border: 1px solid rgba(56, 216, 135, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -8px 18px rgba(56, 216, 135, 0.03),
    0 8px 18px rgba(15, 23, 42, 0.04);
  z-index: 1;
}

.score-mascot-panel::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.score-ring-mascot {
  width: 88%;
  height: 88%;
  object-fit: contain;
  opacity: 1;
  filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.06));
  pointer-events: none;
  z-index: 1;
}

.tier-panel {
  min-height: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.mini-metrics {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  position: relative;
  z-index: 1;
}

.mini-metric {
  min-width: 0;
  padding: 12px 6px;
  border-radius: 16px;
  border: 1px solid rgba(56, 216, 135, 0.16);
  background: #f3faf6;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 6px 14px rgba(56, 216, 135, 0.05);
  text-align: center;
}

.mini-metric strong {
  display: block;
  font-size: 1.05rem;
  color: var(--text);
}

.mini-metric span {
  display: block;
  margin-top: 2px;
  color: var(--green);
  font-weight: 700;
  font-size: 0.68rem;
}

.metric-grid.hidden-metrics,
.signal-grid.hidden-signals {
  display: none;
}

.summary-line {
  margin-top: 16px;
  padding: 14px 0;
  position: relative;
  z-index: 1;
}

.summary-line::before,
.summary-line::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(56, 216, 135, 0) 0%,
    rgba(56, 216, 135, 0.32) 20%,
    rgba(56, 216, 135, 0.32) 80%,
    rgba(56, 216, 135, 0) 100%
  );
}

.summary-line::before {
  top: 0;
}

.summary-line::after {
  bottom: 0;
}

.summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  min-height: calc(1.45em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-actions {
  width: min(560px, 100%);
  margin: 16px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.result-actions button {
  min-height: 44px;
  padding: 0 20px;
  font-weight: 700;
  font-size: 0.82rem;
  border-radius: 14px;
}

.ghost-action {
  color: var(--green);
  background: rgba(56, 216, 135, 0.06);
  border: 1px solid rgba(56, 216, 135, 0.22) !important;
}

.ghost-action:hover {
  background: rgba(56, 216, 135, 0.12);
}

.result-actions #share-x {
  color: #ffffff;
  background: #0b1325;
  box-shadow: 0 10px 20px rgba(11, 19, 37, 0.15);
}

.result-actions #share-x:hover {
  opacity: 0.9;
}

.result-footer {
  margin-top: 16px;
  padding-top: 14px;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 6px;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.result-footer span {
  min-height: 28px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.54rem;
  background: #f3faf6;
  border: 1px solid rgba(56, 216, 135, 0.16);
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
}

.detail-section {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.calendar-card,
.analytics-card {
  padding: 24px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.45);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.section-kicker {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
}

.section-heading h3 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--text);
}

.section-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.section-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(56, 216, 135, 0.2);
  background: rgba(56, 216, 135, 0.08);
  color: var(--green);
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
}

.calendar {
  margin-top: 16px;
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.7);
  position: relative;
}

.calendar-months {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: end;
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 4px;
}

.calendar-month-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  width: 100%;
}

.calendar-month-track span {
  white-space: nowrap;
  text-align: left;
  font-size: 0.72rem;
  overflow: hidden;
}

.calendar-heatmap {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.calendar-day-labels {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  gap: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  align-items: center;
}

.calendar-day-labels span {
  line-height: 1;
}

.calendar-weeks {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  width: 100%;
}

.calendar-week {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calendar-cell {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 3px;
  background: rgba(56, 216, 135, 0.07);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.calendar-cell:hover {
  transform: scale(1.3);
  box-shadow: 0 2px 8px rgba(56, 216, 135, 0.4);
  outline: 1.5px solid rgba(56, 216, 135, 0.8);
  z-index: 2;
}

.calendar-cell.empty {
  background: rgba(0, 0, 0, 0.03);
  outline: none;
  cursor: default;
}

.calendar-cell.empty:hover {
  transform: none;
  box-shadow: none;
}

.calendar-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(11, 19, 37, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 0.72rem;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  white-space: nowrap;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.calendar-legend {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.72rem;
}

.legend-scale {
  display: flex;
  gap: 4px;
}

.legend-scale i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.legend-scale i:nth-child(1) { background: rgba(56, 216, 135, 0.07); }
.legend-scale i:nth-child(2) { background: rgba(56, 216, 135, 0.28); }
.legend-scale i:nth-child(3) { background: rgba(56, 216, 135, 0.55); }
.legend-scale i:nth-child(4) { background: rgba(56, 216, 135, 0.82); }
.legend-scale i:nth-child(5) { background: #2bb86f; }

.calendar-loading {
  min-height: 188px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.calendar-loading-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(56, 216, 135, 0.24);
  animation: calendarPulse 1.2s ease-in-out infinite;
}

@keyframes calendarPulse {
  0%, 100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(56, 216, 135, 0.24);
  }
  50% {
    transform: scale(1.15);
    box-shadow: 0 0 0 10px rgba(56, 216, 135, 0);
  }
}

.detail-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.detail-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  position: relative;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 6px 16px rgba(56, 216, 135, 0.03);
}

.detail-card-left {
  min-width: 0;
  flex: 1 1 auto;
}

.detail-card.featured {
  background: linear-gradient(180deg, rgba(239, 253, 245, 0.95), rgba(220, 250, 230, 0.85));
  border-color: rgba(56, 216, 135, 0.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 10px 20px rgba(56, 216, 135, 0.06);
}

.detail-card-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-card .detail-kicker {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-card.featured .detail-kicker {
  color: var(--green);
}

.detail-card .detail-label {
  display: block;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.2;
  max-width: 100%;
}

.detail-card strong.detail-card-value {
  font-family: "Sora", sans-serif;
  flex: 0 1 40%;
  min-width: 0;
  max-width: 40%;
  font-size: 0.92rem;
  letter-spacing: -0.04em;
  color: var(--green);
  text-align: right;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-card strong.detail-card-value .unit-break {
  display: inline;
  margin-left: 0.18em;
}

.detail-card strong.detail-card-value.balance-break .unit-break {
  display: block;
  margin-left: 0;
  margin-top: 0.08em;
}

.detail-card.featured strong.detail-card-value {
  color: var(--green);
}

.detail-score-badge {
  position: absolute;
  top: -9px;
  right: -9px;
  min-width: 0;
  height: 22px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(56, 216, 135, 0.32);
  color: var(--green);
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow:
    0 6px 14px rgba(56, 216, 135, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
  z-index: 2;
}

@media (max-width: 940px) {
  .detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .scan-fields > .input-group:first-child {
    grid-column: span 12;
  }
  .scan-fields > .input-group:nth-child(2) {
    grid-column: span 12;
  }
  .scan-fields > #discord-roles-select {
    grid-column: span 6;
  }
  .scan-fields > #portal-tier-select {
    grid-column: span 6;
  }
  .scan-fields > #pudgy-nft-select {
    grid-column: span 12;
  }

  .tiers-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 18px, 1120px);
  }

  .scan-form {
    padding: 16px;
  }

  .scan-meta,
  .score-card-head,
  .score-card-main,
  .scan-card-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .scan-card-bottom {
    flex-direction: column;
    align-items: center;
  }

  .scan-fields > * {
    grid-column: span 12 !important;
  }

  .score-ring-wrap {
    min-width: 0;
    width: 100%;
  }

  .score-copy {
    padding-top: 8px;
    padding-bottom: 0;
  }

  .score-mascot-panel {
    width: 104px;
    height: 104px;
  }

  .score-card-mascot {
    display: none;
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-card strong.detail-card-value {
    flex-basis: 42%;
    max-width: 42%;
    font-size: 0.88rem;
  }

  .calendar {
    padding: 10px;
  }

  .calendar-months,
  .calendar-heatmap {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 8px;
  }

  .result-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

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

@media (max-width: 560px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

body.exporting,
html.exporting {
  background: none !important;
  background-image: none !important;
  background-color: transparent !important;
}

body.exporting .bg-glows,
body.exporting .noise {
  display: none !important;
}

body.exporting .score-card {
  box-shadow: none !important;
}

/* Custom Validation Styles */
.scan-fields input.error,
.custom-select.error .select-trigger {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25) !important;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.scan-form.shake {
  animation: shake 0.2s ease-in-out 0s 2;
}

/* Loading Overlay Styles */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.loading-overlay:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08);
  max-width: 380px;
  width: 90%;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.spinner-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid rgba(56, 216, 135, 0.15);
  border-top-color: #38d887;
  animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-logo {
  width: 34px;
  height: 34px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-logo-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 5px rgba(56, 216, 135, 0.25));
}

.loading-title {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.loading-status {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  color: rgba(15, 23, 42, 0.65);
  min-height: 24px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
