button,
[role="button"] {
  cursor: pointer;
}

.hero-grain {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.035;
}

.hero-shimmer {
  background-image: linear-gradient(
    100deg,
    #9a3412 0%,
    #c2410c 18%,
    #d97706 36%,
    #be123c 58%,
    #c2410c 80%,
    #9a3412 100%
  );
  background-size: 300% 100%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hero-shimmer 16s linear infinite;
}

@keyframes hero-shimmer {
  to {
    background-position: 150% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-shimmer {
    animation: none;
  }
}

.dotted-rule {
  height: 3px;
  background-image: radial-gradient(circle at center, #cbd5e1 1.4px, transparent 1.5px);
  background-size: 10px 3px;
  background-repeat: repeat-x;
}

.save-btn.save-pop {
  animation: save-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes save-pop {
  0% {
    transform: scale(1) rotate(0deg);
  }
  40% {
    transform: scale(1.15) rotate(8deg);
  }
  60% {
    transform: scale(0.95) rotate(-4deg);
  }
  80% {
    transform: scale(1.05) rotate(2deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

.save-confetti {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  animation: confetti-fall 0.8s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(var(--fall-distance)) rotate(var(--rotation)) scale(0.5);
  }
}

.logo-wordmark {
  font-family: "Gabarito", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.drill-land {
  animation: drill-land 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.35);
}

@keyframes drill-land {
  0% {
    transform: translateY(-16px) scale(0.94);
    opacity: 0.35;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.quiz-card.correct {
  animation: quiz-success-pulse 0.4s ease-out;
  box-shadow: 2px 2px 0 0 rgba(110, 231, 183, 0.55);
}

.quiz-card.incorrect {
  animation: quiz-shake 0.4s ease-out;
  box-shadow: 2px 2px 0 0 rgba(252, 165, 165, 0.55);
}

@keyframes quiz-success-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

.quiz-success-check,
.quiz-error-x {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-success-check {
  background: #10b981;
  animation: quiz-pop-in 0.3s ease-out;
}

.quiz-error-x {
  background: #ef4444;
  animation: quiz-shake 0.4s ease-out;
}

@keyframes quiz-pop-in {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  70% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes quiz-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-4px);
  }
  40%,
  80% {
    transform: translateX(4px);
  }
}

.quiz-confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  top: -10px;
  opacity: 0;
  border-radius: 2px;
  animation: quiz-confetti-fall 2.5s ease-out forwards;
}

@keyframes quiz-confetti-fall {
  0% {
    top: -10px;
    opacity: 1;
    transform: rotate(0deg);
  }
  100% {
    top: 100%;
    opacity: 0;
    transform: rotate(720deg);
  }
}

.deck-card {
  position: relative;
}

.deck-card::before,
.deck-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  z-index: -1;
}

.deck-card::before {
  transform: translate(4px, 4px) rotate(0.6deg);
}

.deck-card::after {
  transform: translate(8px, 8px) rotate(1.2deg);
  opacity: 0.6;
}

.quiz-shake-anim {
  animation: quiz-shake 0.4s ease-out;
}

.word-collected-fly {
  opacity: 0;
  animation: word-collected-fly 0.55s ease-out forwards;
}

@keyframes word-collected-fly {
  0% {
    transform: translateY(14px) scale(0.96);
    opacity: 0;
  }
  58% {
    transform: translateY(-3px) scale(1.015);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.badge-pop {
  animation: badge-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s backwards;
}

@keyframes badge-pop {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  70% {
    transform: scale(1.12);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.site-links { display: none; align-items: center; gap: 2px; margin-right: 6px; }
.site-links :is(button, a) { border: 0; text-decoration: none; border-radius: 8px; background: none; padding: 8px 12px; font-size: 15px; font-weight: 500; color: #44523e; cursor: pointer; transition: background 0.15s, color 0.15s; }
.site-links :is(button, a):hover { background: #e9eddf; color: #24382d; }
.site-account { position: relative; }
.site-menu-backdrop { display: none; }
.site-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; display: grid; width: 250px; padding: 6px; background: #fff; border: 1px solid #dedfd5; border-radius: 14px; box-shadow: 0 16px 40px #17282024; font-family: system-ui, sans-serif; }
.site-menu-id { display: grid; gap: 1px; padding: 10px 12px 12px; margin-bottom: 4px; border-bottom: 1px solid #dedfd5; font-size: 13px; color: #5f6a58; }
.site-menu-id strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 17px/1.3 Gabarito, system-ui, sans-serif; color: #24382d; }
.site-menu :is(a, button) { display: flex; align-items: center; width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 8px; background: none; font-size: 15px; font-weight: 400; color: #24382d; text-align: left; text-decoration: none; cursor: pointer; }
.site-menu :is(a, button):hover { background: #e9eddf; }
.site-menu .is-quiet { color: #5f6a58; }
.site-menu hr { width: 100%; margin: 4px 0; border: 0; border-top: 1px solid #dedfd5; }

@media (min-width: 768px) {
  .site-links { display: flex; }
}

@media (max-width: 767px) {
  .site-menu-backdrop { display: block; position: fixed; inset: 0; z-index: 69; background: #17282066; animation: site-menu-fade 0.2s ease both; }
  .site-menu { position: fixed; inset: auto 0 0 0; width: auto; padding: 10px 10px calc(18px + env(safe-area-inset-bottom)); border: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -12px 40px #17282024; animation: site-menu-rise 0.25s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .site-menu::before { content: ""; justify-self: center; width: 36px; height: 4px; margin-bottom: 4px; border-radius: 4px; background: #cbd0c3; }
  .site-menu :is(a, button) { min-height: 50px; font-size: 16px; }
}

@keyframes site-menu-rise { from { transform: translateY(100%); } }
@keyframes site-menu-fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .site-menu, .site-menu-backdrop { animation: none; }
}

html:has(dialog:modal) { overflow: hidden; }
