:root {
  --background: #020617;
  --foreground: #f1f5f9;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #020617;
    --foreground: #f1f5f9;
  }
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
}

.app-shell {
  min-height: 100vh;
  background-color: #020617;
  color: #f1f5f9;
}

.app-container {
  max-width: 66rem;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.hero {
  border-radius: 2rem;
  padding: 2.25rem;
  background: #0D1324;
  border: none;
  box-shadow: 0 15px 50px rgba(2, 6, 23, 0.8);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hero-overline {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.7rem;
  color: #67e8f9;
}

.hero-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
}

.hero-logo {
  width: 48px;
  height: 48px;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 30px rgba(3, 7, 18, 0.6);
}

.hero-logo img {
  width: 36px;
  height: 36px;
}

.hero-title {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.hero-description {
  max-width: 48rem;
  color: rgba(226, 232, 240, 0.9);
  margin: 0;
  line-height: 1.6;
}

.hero-credit {
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(241, 245, 249, 0.7);
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stat-value {
  font-size: 2.3rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(241, 245, 249, 0.7);
  margin: 0;
}

.search-panel {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
}

.search-label {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: rgba(241, 245, 249, 0.8);
}

.type-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  justify-content: space-between;
}

.type-label {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: rgba(241, 245, 249, 0.75);
}

.type-select {
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.6);
  padding: 0.65rem 0.9rem;
  color: #f1f5f9;
  font-size: 0.9rem;
}

.search-input {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(15, 23, 42, 0.65);
  padding: 0.85rem 1.1rem;
  color: #f8fafc;
  font-size: 1rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.search-input:focus {
  border-color: #2dd4bf;
  outline: none;
  background: rgba(15, 23, 42, 0.85);
}

.search-help {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: rgba(241, 245, 249, 0.85);
}

.hero span,
.search-help span {
  margin: 0;
}

.help-copy {
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.error-message {
  margin-top: 1rem;
  color: #fcd34d;
  font-size: 0.9rem;
}

.cursor-grid {
  margin-top: 2.25rem;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: 360px;
  gap: 1.2rem;
}

.cursor-card {
  background: rgba(15, 23, 42, 0.65);
  border-radius: 1.5rem;
  padding: 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
  transition: background 0.25s ease, transform 0.25s ease;
  position: relative;
  overflow: hidden;
}

.cursor-card:hover {
  background: rgba(15, 23, 42, 0.85);
  transform: translateY(-3px);
}

.cursor-card.favorited {
  border-color: #38bdf8;
  box-shadow: 0 10px 30px rgba(56, 189, 248, 0.25);
}

.favorite-toggle {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  border: none;
  background: transparent;
  color: #f8fafc;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.favorite-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.favorite-toggle .favorite-icon {
  width: 24px;
  height: 24px;
  transition: transform 0.2s ease;
}

.favorite-toggle:hover .favorite-icon {
  transform: scale(1.05);
}

.cursor-card.favorited .favorite-toggle .favorite-icon {
  transform: scale(1.1);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.cursor-image-wrapper {
  width: 120px;
  height: 120px;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0f172a;
  box-shadow: 0 20px 60px -20px rgba(15, 23, 42, 0.9);
}

.cursor-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cursor-meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.cursor-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.cursor-author {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(241, 245, 249, 0.7);
  margin: 0;
}

.cursor-type-pill {
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  align-self: center;
  margin: 0 auto;
  background: rgba(15, 23, 42, 0.5);
}

.cursor-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.cursor-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.cursor-id {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #e2e8f0;
}

.copy-button {
  min-width: 120px;
  padding: 0.65rem 1.25rem;
  border-radius: 1.1rem;
  border: none;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(90deg, #06b6d4, #3b82f6);
  color: #fff;
  transition: opacity 0.2s ease;
}

.copy-button.secondary {
  background: linear-gradient(90deg, #475569, #0f172a);
}

.copy-button:hover {
  opacity: 0.9;
}

.copy-button:focus-visible {
  outline: 2px solid #67e8f9;
  outline-offset: 2px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  padding-top: 0.6rem;
  color: rgba(241, 245, 249, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.55rem;
}

.tag-pill {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.15rem 0.75rem;
}

.tag-pill:first-letter {
  text-transform: uppercase;
}

@media (max-width: 640px) {
  .hero {
    padding: 1.75rem;
  }

  .search-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .cursor-row {
    flex-direction: column;
    align-items: center;
  }

  .copy-button {
    width: 100%;
    justify-content: center;
  }
}

.supernova-glow {
  animation: supernova-glow 1.5s ease-out;
}
.supernova-ring {
  animation: supernova-ring 1.1s ease-out;
}
.supernova-spark {
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9), rgba(14, 165, 233, 0.4), transparent 60%);
  mix-blend-mode: screen;
  animation: supernova-spark 1.25s cubic-bezier(0.6, 0, 0.2, 1);
  position: absolute;
  opacity: 0;
}
.supernova-spark-1 {
  top: 10%;
  left: 15%;
  animation-delay: 0.05s;
}
.supernova-spark-2 {
  bottom: 12%;
  right: 18%;
  animation-delay: 0.15s;
}
.supernova-spark-3 {
  top: 30%;
  right: 12%;
  animation-delay: 0.1s;
}
.supernova-spark-4 {
  top: 45%;
  left: 8%;
  animation-delay: 0.2s;
}

.supernova-pulse {
  animation: supernova-pulse 1.2s ease-out;
}

.supernova-core {
  animation: supernova-core 1.4s ease-out;
}
.supernova-confetti {
  width: 16px;
  height: 6px;
  border-radius: 9999px;
  background: linear-gradient(120deg, rgba(14, 165, 233, 0.85), rgba(59, 130, 246, 0.7));
  animation: supernova-confetti 1s cubic-bezier(0.3, 0, 0.1, 1);
  position: absolute;
  opacity: 0;
  mix-blend-mode: screen;
}
.supernova-confetti-1 {
  top: 20%;
  left: 12%;
  animation-delay: 0s;
}
.supernova-confetti-2 {
  top: 25%;
  right: 18%;
  animation-delay: 0.05s;
}
.supernova-confetti-3 {
  bottom: 26%;
  left: 33%;
  animation-delay: 0.1s;
}
.supernova-confetti-4 {
  bottom: 30%;
  right: 28%;
  animation-delay: 0.15s;
}
.supernova-confetti-5 {
  top: 40%;
  left: 50%;
  animation-delay: 0.08s;
}
.supernova-confetti-6 {
  bottom: 15%;
  right: 55%;
  animation-delay: 0.12s;
}

@keyframes supernova-glow {
  0% {
    transform: scale(0.9);
    opacity: 0;
  }
  40% {
    opacity: 0.75;
  }
  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}

@keyframes supernova-ring {
  0% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

@keyframes supernova-pulse {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  50% {
    opacity: 0.9;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}

@keyframes supernova-core {
  0% {
    opacity: 0.4;
    transform: scale(0.7);
  }
  30% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: scale(1.4);
  }
}

@keyframes supernova-confetti {
  0% {
    opacity: 0;
    transform: translateY(0) rotate(0deg) scaleX(0.5);
  }
  30% {
    opacity: 1;
    transform: translateY(-12px) rotate(15deg) scaleX(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-40px) rotate(45deg) scaleX(1.2);
  }
}

@keyframes supernova-spark {
  0% {
    transform: translateY(0) scale(0.6);
    opacity: 0;
  }
  20% {
    opacity: 0.9;
    transform: translateY(-10px) scale(1);
  }
  60% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-40px) scale(1.2);
    opacity: 0;
  }
}
