@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700;900&family=Share+Tech+Mono&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

body {
  min-height: 100vh;
  background: radial-gradient(ellipse at 30% 20%, #9B6DD0 0%, #6B3FA0 45%, #3D1A70 100%);
  font-family: 'Space Grotesk', sans-serif;
  color: #fff;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ── Background rarity overlay ── */
.bg-overlay {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0; transition: opacity 1.6s ease;
}
.bg-overlay.visible { opacity: 1; }

/* ── Floating Faces ── */
.faces-container { position: fixed; inset: 0; pointer-events: none; z-index: 25; }
.floating-face {
  position: absolute; cursor: pointer; pointer-events: all; user-select: none;
  touch-action: manipulation;
  animation: floatFace ease-in-out infinite;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.45));
  transition: filter 0.15s;
}
.floating-face:hover { filter: drop-shadow(0 10px 28px rgba(0,0,0,0.6)) brightness(1.1); }
@keyframes floatFace {
  0%   { transform: translateY(0px)   rotate(-2deg); }
  30%  { transform: translateY(-16px) rotate(3deg); }
  60%  { transform: translateY(-8px)  rotate(-1deg); }
  80%  { transform: translateY(-20px) rotate(4deg); }
  100% { transform: translateY(0px)   rotate(-2deg); }
}

/* ── Popup ── */
.popup-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); z-index: 999;
  align-items: center; justify-content: center;
}
.popup-overlay.active { display: flex; }
.popup-box {
  background: linear-gradient(135deg, #3D1A70, #6B3FA0);
  border: 2px solid rgba(255,255,255,0.25); border-radius: 24px;
  padding: 24px 28px 28px; text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55);
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; max-width: 340px; width: 90%;
}
.popup-face { line-height: 0; }
.popup-box span { font-size: 1.35rem; font-weight: 700; color: #fff; }
.popup-box button {
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.28);
  color: #fff; padding: 9px 30px; border-radius: 12px;
  font-size: 0.95rem; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background 0.2s;
}
.popup-box button:hover { background: rgba(255,255,255,0.26); }

/* How To Improve popup */
.improve-popup-box {
  max-width: 360px;
  background: linear-gradient(160deg, #1a0840 0%, #3D1A70 60%, #6B3FA0 100%);
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
}
.improve-popup-box::before {
  content: '';
  position: absolute; inset: -2px; border-radius: 26px; z-index: -1;
  background: linear-gradient(135deg, #f59e0b, #ec4899, #a855f7, #f59e0b);
  animation: glowPulse 2.5s ease-in-out infinite;
}
.improve-popup-img {
  width: 130px; height: 130px; border-radius: 50%; object-fit: cover;
  border: 3px solid rgba(255,255,255,0.2);
  box-shadow: 0 0 32px rgba(245,158,11,0.5), 0 0 64px rgba(168,85,247,0.3);
  animation: scanPulse 2s ease-in-out infinite;
}
.improve-popup-text {
  font-size: 1.5rem; font-weight: 900; letter-spacing: 0.5px;
  background: linear-gradient(135deg, #fbbf24, #f472b6, #c084fc);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1.25; text-align: center;
}

/* JohnWRichKid popup */
.hahaha-popup-box {
  max-width: 360px;
  background: linear-gradient(160deg, #1a0505 0%, #4a0a0a 55%, #7a1515 100%);
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
}
.hahaha-popup-box::before {
  content: '';
  position: absolute; inset: -2px; border-radius: 26px; z-index: -1;
  background: linear-gradient(135deg, #ff3333, #ff8800, #ff3333);
  animation: glowPulse 1.2s ease-in-out infinite;
}
.hahaha-popup-img {
  width: 160px; height: 160px; border-radius: 16px; object-fit: cover;
  box-shadow: 0 0 40px rgba(255,50,50,0.6), 0 0 80px rgba(255,100,0,0.3);
  animation: hahahaShake 0.4s ease-in-out infinite;
}
@keyframes hahahaShake {
  0%,100% { transform: rotate(-2deg) scale(1);    }
  25%      { transform: rotate(3deg)  scale(1.04); }
  75%      { transform: rotate(-3deg) scale(1.02); }
}
.hahaha-popup-title {
  font-size: 1.25rem; font-weight: 900; color: #fff;
  text-align: center; line-height: 1.3;
  text-shadow: 0 0 20px rgba(255,80,80,0.8);
}
.hahaha-popup-sub {
  font-size: 0.88rem; color: rgba(255,180,180,0.75);
  text-align: center; margin-top: -6px;
}
.hahaha-popup-box button {
  background: rgba(255,60,60,0.2); border: 1px solid rgba(255,80,80,0.4);
}
.hahaha-popup-box button:hover { background: rgba(255,60,60,0.35); }

/* ── Screens ── */
.screen {
  position: relative; z-index: 20; width: 100%; max-width: 480px;
  padding: 20px 20px 100px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 100vh;
}
.screen.hidden { display: none; }

/* ── Hero ── */
.hero { text-align: center; width: 100%; }
.hero-avatar {
  width: 110px; height: 110px; border-radius: 50%; object-fit: cover;
  margin: 0 auto 18px; display: block;
}
.title {
  font-size: clamp(2rem, 7vw, 3rem); font-weight: 900; line-height: 1.15;
  text-shadow: 0 4px 24px rgba(0,0,0,0.3); margin-bottom: 10px;
}
.subtitle { font-size: 1rem; color: #D4B0FF; margin-bottom: 28px; }

.input-row {
  display: flex; gap: 10px; width: 100%; max-width: 480px; margin: 0 auto 12px;
}
.handle-input {
  flex: 1; background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.25); border-radius: 16px;
  padding: 15px 20px; font-size: 1rem; font-family: inherit; color: #fff; outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.handle-input::placeholder { color: rgba(255,255,255,0.4); }
.handle-input:focus { border-color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.18); }

.btn-rate {
  background: linear-gradient(135deg, #9B59D0 0%, #5B2D9E 100%);
  color: #fff; border: none; padding: 15px 26px; font-size: 1rem; font-weight: 800;
  border-radius: 16px; opacity: 0.45; cursor: pointer; font-family: inherit;
  white-space: nowrap; box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.25s;
  display: flex; align-items: center; gap: 8px;
}
.btn-rate.active { opacity: 1; }
.btn-rate.active:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(0,0,0,0.3); }
.btn-rate:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-face-icon { width: 28px; height: auto; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3)); }

.input-hint { font-size: 0.78rem; color: rgba(255,255,255,0.4); margin-bottom: 2px; }
.scan-counter { font-size: 0.7rem; color: rgba(255,255,255,0.28); font-family: 'Share Tech Mono', monospace; margin-bottom: 0; }

/* ── Scanning ── */
.scanning-block {
  display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 36px;
}
.scanning-block.hidden { display: none; }
.scanning-face {
  width: 110px; height: auto;
  filter: drop-shadow(0 0 20px rgba(180,130,255,0.6));
  animation: scanPulse 1.4s ease-in-out infinite;
}
@keyframes scanPulse {
  0%,100% { transform: scale(1);    filter: drop-shadow(0 0 16px rgba(180,130,255,0.5)); }
  50%      { transform: scale(1.08); filter: drop-shadow(0 0 32px rgba(200,160,255,0.85)); }
}
.scanning-text { font-size: 1.05rem; font-weight: 600; color: #D4B0FF; }
.scanning-dots { display: flex; gap: 8px; }
.scanning-dots span {
  width: 10px; height: 10px; border-radius: 50%; background: #D4B0FF;
  animation: dotBounce 1.2s ease-in-out infinite;
}
.scanning-dots span:nth-child(2) { animation-delay: 0.2s; }
.scanning-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBounce {
  0%,80%,100% { transform: scale(0.7); opacity: 0.4; }
  40%          { transform: scale(1.2); opacity: 1; }
}

/* ── 3D flip scene (replaces separate reveal-overlay + card-drop-wrap) ── */
.card-flip-scene {
  width: 100%; max-width: 380px; margin-bottom: 22px;
  perspective: 1200px;
}

.card-flip-inner {
  display: grid;
  grid-template-areas: "card";
  transform-style: preserve-3d;
  /* transition set in JS so reset is instant */
}

.card-flip-inner.flipped { transform: rotateY(180deg); }

.card-flip-back,
.card-flip-front {
  grid-area: card;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}

.card-flip-back  { cursor: pointer; }
.card-flip-front { transform: rotateY(180deg); }

/* Reveal back face */
@keyframes cardBob {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}
@keyframes hintBounce {
  0%, 100% { transform: translateY(0); opacity: 0.45; }
  50%       { transform: translateY(6px); opacity: 1; }
}
.reveal-back {
  background: linear-gradient(135deg, #3D1A70 0%, #1a0840 100%);
  border: 2px solid rgba(168,85,247,0.4);
  border-radius: 26px;
  min-height: 560px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  box-shadow: 0 0 40px rgba(168,85,247,0.3), 0 16px 48px rgba(0,0,0,0.5);
  animation: cardBob 2.8s ease-in-out infinite;
}
.card-flip-back:hover .reveal-back {
  box-shadow: 0 0 60px rgba(168,85,247,0.5), 0 20px 60px rgba(0,0,0,0.6);
}
.reveal-hint {
  font-size: 1.1rem; color: rgba(168,85,247,0.7);
  animation: hintBounce 1.3s ease-in-out infinite;
  line-height: 1;
}
.reveal-face {
  width: 110px; height: auto;
  animation: scanPulse 1.6s ease-in-out infinite;
}
.reveal-text {
  font-size: 1.1rem; font-weight: 700; color: #D4B0FF; letter-spacing: 0.5px;
}

/* ══════════════════════════════════════════
   LOOT CARD
══════════════════════════════════════════ */
.card-drop-wrap {
  position: relative; width: 100%; border-radius: 26px;
}

/* Glow border (replaces spinning border — no rotation) */
.card-border-spin {
  position: absolute; inset: -2px; border-radius: 28px; z-index: 0;
  opacity: 0; transition: opacity 0.6s;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.55; }
  50%       { opacity: 1; }
}

/* Holographic shimmer sweep across card */
@keyframes cardShimmer {
  0%   { transform: translateX(-120%) skewX(-15deg); }
  100% { transform: translateX(220%) skewX(-15deg); }
}

.loot-card {
  position: relative; z-index: 1; border-radius: 24px; overflow: hidden;
  background: rgba(15, 8, 30, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 14px 14px 12px;
  display: flex; flex-direction: column;
}

/* ── Rarity variants ── */

/* SECRET */
.rarity-secret .card-border-spin {
  opacity: 1;
  background: linear-gradient(135deg, #e2e8f0, #94a3b8, #f8fafc, #64748b, #e2e8f0);
  animation: glowPulse 4s ease-in-out infinite;
}
.rarity-secret .loot-card {
  background: rgba(5, 5, 15, 0.97);
  box-shadow: 0 0 50px rgba(255,255,255,0.12), 0 20px 60px rgba(0,0,0,0.8);
}
/* secret title/rarity handled in pkm-* section below */

/* COMMON */
.rarity-common .card-border-spin { opacity: 0; }
.rarity-common .loot-card {
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

/* RARE */
.rarity-rare .card-border-spin {
  opacity: 1;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #3b82f6);
  animation: glowPulse 3s ease-in-out infinite;
}
.rarity-rare .loot-card {
  box-shadow: 0 0 28px rgba(99,102,241,0.4), 0 12px 40px rgba(0,0,0,0.5);
}

/* EPIC */
.rarity-epic .card-border-spin {
  opacity: 1;
  background: linear-gradient(135deg, #f97316, #ec4899, #f97316);
  animation: glowPulse 2.5s ease-in-out infinite;
}
.rarity-epic .loot-card {
  box-shadow: 0 0 40px rgba(249,115,22,0.4), 0 0 80px rgba(236,72,153,0.2), 0 16px 50px rgba(0,0,0,0.5);
}

/* MYTHIC */
.rarity-mythic .card-border-spin {
  opacity: 1;
  background: linear-gradient(135deg, #ec4899, #a855f7, #c026d3);
  animation: glowPulse 2s ease-in-out infinite;
}
.rarity-mythic .loot-card {
  box-shadow: 0 0 50px rgba(236,72,153,0.5), 0 0 100px rgba(168,85,247,0.3), 0 20px 60px rgba(0,0,0,0.6);
}
/* Shimmer on mythic */
.rarity-mythic .loot-card::before {
  content: '';
  position: absolute; top: 0; left: 0; width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  animation: cardShimmer 5s ease-in-out infinite;
  pointer-events: none; z-index: 2;
}

/* LEGENDARY */
.rarity-legendary .card-border-spin {
  opacity: 1;
  background: linear-gradient(135deg, #f59e0b, #fbbf24, #a855f7, #f59e0b);
  animation: glowPulse 1.8s ease-in-out infinite;
}
.rarity-legendary .loot-card {
  box-shadow: 0 0 60px rgba(245,158,11,0.5), 0 0 120px rgba(168,85,247,0.35), 0 24px 70px rgba(0,0,0,0.7);
}
/* Shimmer on legendary — faster + brighter */
.rarity-legendary .loot-card::before {
  content: '';
  position: absolute; top: 0; left: 0; width: 45%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  animation: cardShimmer 3.5s ease-in-out infinite;
  pointer-events: none; z-index: 2;
}
.rarity-legendary .loot-card::after {
  content: '';
  position: absolute; inset: 0; border-radius: 24px; pointer-events: none;
  background: repeating-linear-gradient(
    45deg, transparent, transparent 8px,
    rgba(245,158,11,0.025) 8px, rgba(245,158,11,0.025) 9px
  );
}

/* ── Particles (legendary only) ── */
.card-particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: 24px; }
.particle {
  position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: #f59e0b;
  animation: particleFloat linear infinite;
  opacity: 0;
}
@keyframes particleFloat {
  0%   { transform: translateY(100%) scale(0); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 0.8; }
  100% { transform: translateY(-120%) scale(1.5); opacity: 0; }
}

/* ══════════════════════════════════════════
   POKÉMON-STYLE CARD INTERIOR
══════════════════════════════════════════ */

/* Header row: name (left) + score (right) */
.pkm-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 8px;
}
.pkm-name-side { display: flex; flex-direction: column; gap: 1px; }
.pkm-stage {
  font-size: 0.55rem; font-weight: 700; letter-spacing: 2px;
  color: rgba(255,255,255,0.3); text-transform: uppercase;
}
.pkm-name {
  font-size: 1.15rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px; line-height: 1;
  background: linear-gradient(135deg, #fff 30%, #D4B0FF);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.rarity-legendary .pkm-name {
  background: linear-gradient(135deg, #fbbf24, #f59e0b, #fff, #f59e0b);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.rarity-mythic .pkm-name {
  background: linear-gradient(135deg, #f472b6, #a855f7, #fff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.rarity-epic .pkm-name {
  background: linear-gradient(135deg, #fb923c, #ec4899, #fff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.rarity-secret .pkm-name {
  background: linear-gradient(135deg, #e2e8f0, #94a3b8, #fff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.pkm-score-side {
  display: flex; align-items: center; gap: 5px;
}
.pkm-score-label {
  font-size: 0.55rem; font-weight: 700; color: rgba(255,255,255,0.3);
  text-transform: uppercase; letter-spacing: 1px; align-self: flex-end; padding-bottom: 2px;
}
.pkm-score {
  font-size: 1.45rem; font-weight: 900; line-height: 1; color: #fff;
}
.rarity-legendary .pkm-score { color: #f59e0b; }
.rarity-mythic    .pkm-score { color: #ec4899; }
.rarity-epic      .pkm-score { color: #f97316; }
.rarity-rare      .pkm-score { color: #8b5cf6; }
.rarity-secret    .pkm-score { color: #94a3b8; }
.pkm-typeicon { width: 22px; height: auto; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5)); }

/* Art image area */
.pkm-img-wrap {
  width: 100%; padding: 5px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.04) 100%);
  margin-bottom: 0;
}
.rarity-legendary .pkm-img-wrap { background: linear-gradient(135deg, #f59e0b 0%, #a855f7 50%, #f59e0b 100%); }
.rarity-mythic    .pkm-img-wrap { background: linear-gradient(135deg, #ec4899, #a855f7); }
.rarity-epic      .pkm-img-wrap { background: linear-gradient(135deg, #f97316, #ec4899); }
.rarity-rare      .pkm-img-wrap { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.rarity-secret    .pkm-img-wrap { background: linear-gradient(135deg, #64748b, #e2e8f0); }

.pkm-img-box {
  width: 100%; aspect-ratio: 1 / 1;
  border-radius: 8px; overflow: hidden;
  background: rgba(5,2,15,0.8);
  display: flex; align-items: center; justify-content: center;
}
.pkm-img-box img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Caption strip */
.pkm-caption {
  font-size: 0.6rem; font-family: 'Share Tech Mono', monospace;
  color: rgba(255,255,255,0.3); padding: 5px 2px 6px;
  display: flex; gap: 6px; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.pkm-dot { opacity: 0.3; }

/* Move / ability section */
.pkm-moves { padding: 8px 0 4px; }
.pkm-move-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 5px;
}
.pkm-cost-icon { width: 18px; height: auto; flex-shrink: 0; }
.pkm-move-name {
  font-size: 1rem; font-weight: 800; color: #fff;
}
.pkm-move-desc {
  font-size: 0.72rem; color: rgba(255,255,255,0.45); line-height: 1.5;
  padding-left: 26px; font-style: italic; margin: 0;
}

/* Stats strip — 2 rows of 3, like weakness / resistance / retreat */
.pkm-stats-strip {
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin: 6px 0 0;
}
.pkm-stats-row { display: flex; }
.pkm-stats-row + .pkm-stats-row { border-top: 1px solid rgba(255,255,255,0.07); }
.pkm-stat-cell {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 5px 4px; text-align: center;
}
.pkm-stat-cell + .pkm-stat-cell { border-left: 1px solid rgba(255,255,255,0.08); }
.pkm-stat-label {
  font-size: 0.5rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
  color: rgba(255,255,255,0.3); margin-bottom: 2px;
}
.pkm-stat-val { font-size: 0.78rem; font-weight: 800; }

/* Footer */
.pkm-footer {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding-top: 7px; gap: 8px;
}
.pkm-flavor {
  font-size: 0.62rem; font-style: italic; color: rgba(255,255,255,0.3);
  flex: 1; line-height: 1.4;
}
.pkm-rarity {
  font-size: 0.6rem; font-weight: 800; letter-spacing: 2px;
  text-transform: uppercase; color: rgba(255,255,255,0.35); white-space: nowrap;
}
.rarity-legendary .pkm-rarity { color: #f59e0b; }
.rarity-mythic    .pkm-rarity { color: #ec4899; }
.rarity-epic      .pkm-rarity { color: #f97316; }
.rarity-rare      .pkm-rarity { color: #8b5cf6; }
.rarity-secret    .pkm-rarity { color: #94a3b8; }

/* ── Share buttons ── */
.share-buttons { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 12px; }
.btn-share {
  padding: 11px 22px; border-radius: 50px; border: none;
  font-size: 0.88rem; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-share:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }
.btn-download { background: #fff; color: #4A2070; }
.btn-twitter  { background: #000; color: #fff; }
.btn-copy     { background: rgba(255,255,255,0.14); color: #fff; border: 1px solid rgba(255,255,255,0.28); }
.btn-improve  {
  background: linear-gradient(135deg, #f59e0b, #ec4899, #a855f7);
  color: #fff; border: none;
  font-weight: 800; letter-spacing: 0.3px;
  box-shadow: 0 4px 20px rgba(236,72,153,0.4);
}

.btn-retry {
  background: transparent; border: 1.5px solid rgba(255,255,255,0.25); color: #D4B0FF;
  padding: 9px 24px; border-radius: 50px; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; font-family: inherit; margin-bottom: 18px;
  transition: border-color 0.2s, color 0.2s;
}
.btn-retry:hover { border-color: #fff; color: #fff; }

.disclaimer {
  font-size: 0.76rem; color: rgba(255,255,255,0.4); text-align: center;
  max-width: 400px; line-height: 1.6;
}
.disclaimer a { color: rgba(255,255,255,0.6); text-decoration: underline; }
.disclaimer a:hover { color: #fff; }
.home-disclaimer { margin-top: 32px; text-align: center; width: 100%; max-width: 100%; }

/* ── Leaderboard ── */
.leaderboard-section {
  width: 100%; max-width: 480px;
  margin: 6px 0 100px;
}
.lb-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding: 0 2px;
}
.lb-title {
  font-size: 1rem; font-weight: 900; letter-spacing: 1.5px;
  text-transform: uppercase; color: #fff;
}
.lb-count {
  font-size: 0.68rem; color: rgba(255,255,255,0.38);
  font-family: 'Share Tech Mono', monospace;
}
.lb-list {
  display: flex; flex-direction: column; gap: 5px;
  max-height: 440px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(168,85,247,0.4) transparent;
}
.lb-list::-webkit-scrollbar { width: 3px; }
.lb-list::-webkit-scrollbar-thumb { background: rgba(168,85,247,0.35); border-radius: 2px; }
.lb-entry {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  border-left: 3px solid #a78bfa;
  border-radius: 12px; padding: 9px 14px;
}
@keyframes lbFlash {
  0%   { background: rgba(168,85,247,0.28); box-shadow: 0 0 18px rgba(168,85,247,0.35); }
  100% { background: rgba(255,255,255,0.05); box-shadow: none; }
}
.lb-entry-new { animation: lbFlash 2.5s ease-out forwards; }
.lb-rank {
  font-size: 0.85rem; font-weight: 900; min-width: 28px;
  text-align: center; color: rgba(255,255,255,0.3); flex-shrink: 0;
}
.lb-rank-gold   { color: #f59e0b; }
.lb-rank-silver { color: #94a3b8; }
.lb-rank-bronze { color: #cd7c3a; }
.lb-handle {
  flex: 1; font-size: 0.85rem; font-weight: 700; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lb-score {
  font-size: 0.88rem; font-weight: 900; flex-shrink: 0;
}
.lb-tier {
  font-size: 0.58rem; color: rgba(255,255,255,0.32);
  font-family: 'Share Tech Mono', monospace;
  white-space: nowrap; max-width: 90px;
  overflow: hidden; text-overflow: ellipsis; flex-shrink: 0;
}

/* ── Footer ── */
.footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 20px; background: rgba(0,0,0,0.3); backdrop-filter: blur(8px);
  font-size: 0.82rem; color: rgba(255,255,255,0.6);
}
.footer a { color: rgba(255,255,255,0.9); font-weight: 700; text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer-sep { opacity: 0.35; }

/* ── Download snapshot (off-screen) ── */
#downloadSnapshot {
  position: fixed; top: -9999px; left: -9999px; width: 380px;
  font-family: 'Space Grotesk', sans-serif; color: #fff;
  background: rgba(15,8,30,0.98); border-radius: 24px;
  padding: 20px 20px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}

@media (max-width: 480px) {
  .card-drop-wrap { max-width: 100%; }
  .input-row { flex-direction: column; }
  .btn-rate { width: 100%; justify-content: center; }
}
