/* ============================================================
   Button Animations — すべて CSS で定義
   JS は .btn-ripple など必要な子要素の付与のみ
   ============================================================ */

.btn-anim {
  --btn-duration: 0.35s;
  --btn-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 8.5rem;
  padding: 0.7rem 1.5rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  background: #7c6cff;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: none;
}

.btn-anim:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ===================== 出現（1回） ===================== */

.btn-anim-fade-in {
  animation: btn-fade-in 0.8s var(--btn-ease) both;
}

@keyframes btn-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.btn-anim-slide-up {
  animation: btn-slide-up 0.7s var(--btn-ease) both;
}

@keyframes btn-slide-up {
  from { opacity: 0; transform: translateY(1.25rem); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-anim-slide-down {
  animation: btn-slide-down 0.7s var(--btn-ease) both;
}

@keyframes btn-slide-down {
  from { opacity: 0; transform: translateY(-1.25rem); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-anim-bounce-in {
  animation: btn-bounce-in 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes btn-bounce-in {
  0% { opacity: 0; transform: scale(0.4) translateY(1rem); }
  60% { opacity: 1; transform: scale(1.06) translateY(-0.15rem); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.btn-anim-pop-in {
  animation: btn-pop-in 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes btn-pop-in {
  from { opacity: 0; transform: scale(0); }
  to { opacity: 1; transform: scale(1); }
}

.btn-anim-scale-in {
  animation: btn-scale-in 0.6s var(--btn-ease) both;
}

@keyframes btn-scale-in {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}

.btn-anim-flip-in {
  animation: btn-flip-in 0.75s var(--btn-ease) both;
  transform-style: preserve-3d;
}

@keyframes btn-flip-in {
  from { opacity: 0; transform: perspective(400px) rotateX(-80deg); }
  to { opacity: 1; transform: perspective(400px) rotateX(0); }
}

.btn-anim-elastic-in {
  animation: btn-elastic-in 1s cubic-bezier(0.68, -0.55, 0.27, 1.55) both;
}

@keyframes btn-elastic-in {
  0% { opacity: 0; transform: scale(0.3); }
  55% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

/* ===================== ホバーでループ ===================== */

.btn-anim-pulse:hover {
  animation: btn-pulse 1.8s ease-in-out infinite;
}

@keyframes btn-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(124, 108, 255, 0.5); }
  50% { transform: scale(1.04); box-shadow: 0 0 0 10px rgba(124, 108, 255, 0); }
}

.btn-anim-shake:hover {
  animation: btn-shake 0.7s ease-in-out infinite;
}

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

.btn-anim-glow:hover {
  animation: btn-glow 2s ease-in-out infinite;
}

@keyframes btn-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(124, 108, 255, 0.5); }
  50% { box-shadow: 0 0 24px rgba(124, 108, 255, 0.9), 0 0 40px rgba(124, 108, 255, 0.4); }
}

.btn-anim-gradient-flow {
  background: linear-gradient(90deg, #7c6cff, #ff6b9d, #ffd54f, #7c6cff);
  background-size: 300% 100%;
}

.btn-anim-gradient-flow:hover {
  animation: btn-gradient-flow 3s linear infinite;
}

@keyframes btn-gradient-flow {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.btn-anim-neon:hover {
  animation: btn-neon 2.5s ease-in-out infinite;
}

@keyframes btn-neon {
  0%, 100% {
    box-shadow: 0 0 6px #7c6cff, 0 0 14px #7c6cff;
  }
  50% {
    box-shadow: 0 0 4px #7c6cff, 0 0 24px #7c6cff, 0 0 36px #ff6b9d;
  }
}

.btn-anim-wobble:hover {
  animation: btn-wobble 1.2s ease-in-out infinite;
}

@keyframes btn-wobble {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

/* ===================== ホバー ===================== */

.btn-anim-lift {
  transition: transform var(--btn-duration) var(--btn-ease), box-shadow var(--btn-duration) var(--btn-ease);
}

.btn-anim-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(124, 108, 255, 0.45);
}

.btn-anim-scale-hover {
  transition: transform var(--btn-duration) var(--btn-ease);
}

.btn-anim-scale-hover:hover {
  transform: scale(1.08);
}

.btn-anim-grow-border {
  background: transparent;
  color: #7c6cff;
  border-color: #7c6cff;
  transition: color var(--btn-duration) var(--btn-ease), background var(--btn-duration) var(--btn-ease);
}

.btn-anim-grow-border:hover {
  color: #fff;
  background: #7c6cff;
  box-shadow: 0 0 0 3px rgba(124, 108, 255, 0.25);
}

.btn-anim-fill-slide {
  color: #7c6cff;
  background: transparent;
  border-color: #7c6cff;
  z-index: 0;
}

.btn-anim-fill-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #7c6cff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--btn-duration) var(--btn-ease);
}

.btn-anim-fill-slide:hover {
  color: #fff;
}

.btn-anim-fill-slide:hover::before {
  transform: scaleX(1);
}

.btn-anim-shine {
  overflow: hidden;
}

.btn-anim-shine::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s var(--btn-ease);
}

.btn-anim-shine:hover::after {
  left: 140%;
}

.btn-anim-underline {
  background: transparent;
  color: #7c6cff;
  border-color: transparent;
  border-radius: 0;
}

.btn-anim-underline::after {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.45rem;
  height: 2px;
  background: #7c6cff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--btn-duration) var(--btn-ease);
}

.btn-anim-underline:hover::after {
  transform: scaleX(1);
}

.btn-anim-skew {
  transition: transform var(--btn-duration) var(--btn-ease);
}

.btn-anim-skew:hover {
  transform: skewX(-6deg);
}

.btn-anim-rotate {
  transition: transform var(--btn-duration) var(--btn-ease);
}

.btn-anim-rotate:hover {
  transform: rotate(-3deg) scale(1.05);
}

.btn-anim-flip-3d {
  transform-style: preserve-3d;
  transition: transform 0.5s var(--btn-ease);
}

.btn-anim-flip-3d:hover {
  transform: perspective(500px) rotateY(12deg);
}

/* ===================== 押下・リップル ===================== */

.btn-anim-press {
  transition: transform 0.12s ease;
}

.btn-anim-press:active {
  transform: scale(0.94);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.25);
}

.btn-anim-ripple {
  overflow: hidden;
}

.btn-anim-ripple .btn-ripple {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
}

.btn-anim-ripple:hover .btn-ripple {
  animation: btn-ripple-wave 0.65s ease-out;
}

@keyframes btn-ripple-wave {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  70% { opacity: 0.3; }
  100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0; }
}

.btn-anim-icon-slide .btn-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: gap var(--btn-duration) var(--btn-ease);
}

.btn-anim-icon-slide .btn-icon {
  display: inline-block;
  transition: transform var(--btn-duration) var(--btn-ease);
}

.btn-anim-icon-slide:hover .btn-icon {
  transform: translateX(4px);
}

.btn-anim-icon-slide:hover .btn-label {
  gap: 0.6rem;
}

.btn-anim-border-run {
  background: transparent;
  color: #7c6cff;
  border-color: #7c6cff;
}

.btn-anim-border-run::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 10px;
  padding: 2px;
  background: linear-gradient(90deg, #7c6cff, #ff6b9d, #ffd54f, #7c6cff);
  background-size: 300% 100%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.btn-anim-border-run:hover::before {
  opacity: 1;
  animation: btn-border-run 2.5s linear infinite;
}

@keyframes btn-border-run {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* ===================== Codrops-inspired (lab-original) ===================== */

.btn-anim-text-reveal {
  background: transparent;
  color: #7c6cff;
  border-color: #7c6cff;
}

.btn-anim-text-reveal .btn-text-reveal {
  position: relative;
  display: inline-block;
  overflow: hidden;
}

.btn-anim-text-reveal .btn-text-outline,
.btn-anim-text-reveal .btn-text-fill {
  display: block;
  transition: transform 0.45s var(--btn-ease), clip-path 0.45s var(--btn-ease);
}

.btn-anim-text-reveal .btn-text-outline {
  color: transparent;
  -webkit-text-stroke: 1px rgba(124, 108, 255, 0.85);
}

.btn-anim-text-reveal .btn-text-fill {
  position: absolute;
  inset: 0;
  color: #fff;
  clip-path: inset(0 100% 0 0);
}

.btn-anim-text-reveal:hover .btn-text-fill {
  clip-path: inset(0 0 0 0);
}

.btn-anim-text-reveal:hover {
  color: #fff;
  background: #7c6cff;
  border-color: #7c6cff;
}

.btn-anim-bracket-grow::before,
.btn-anim-bracket-grow::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0;
  height: 55%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  opacity: 0;
  transition: width 0.4s var(--btn-ease), opacity 0.25s ease;
  pointer-events: none;
}

.btn-anim-bracket-grow::before {
  left: 0.5rem;
  border-right: none;
  transform: translateY(-50%);
}

.btn-anim-bracket-grow::after {
  right: 0.5rem;
  border-left: none;
  transform: translateY(-50%);
}

.btn-anim-bracket-grow:hover::before,
.btn-anim-bracket-grow:hover::after {
  width: 0.55rem;
  opacity: 1;
}

.btn-anim-spotlight {
  overflow: hidden;
  z-index: 0;
}

.btn-anim-spotlight::before {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: -1;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.55), transparent 55%);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.35s ease, transform 0.45s var(--btn-ease);
}

.btn-anim-spotlight:hover::before {
  opacity: 1;
  transform: scale(1.2);
}

.btn-anim-split-swap {
  background: #1a1a22;
  border-color: #7c6cff;
  color: transparent;
}

.btn-anim-split-swap .btn-split {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7c6cff;
  clip-path: inset(0 50% 0 0);
  transition: clip-path 0.4s var(--btn-ease), transform 0.4s var(--btn-ease);
  pointer-events: none;
}

.btn-anim-split-swap .btn-split--alt {
  clip-path: inset(0 0 0 50%);
  color: #ff6b9d;
}

.btn-anim-split-swap .btn-split-label {
  position: relative;
  z-index: 1;
  color: #fff;
  opacity: 0;
  transition: opacity 0.25s ease 0.15s;
}

.btn-anim-split-swap:hover .btn-split {
  clip-path: inset(0 100% 0 0);
  transform: translateX(-6px);
}

.btn-anim-split-swap:hover .btn-split--alt {
  clip-path: inset(0 0 0 100%);
  transform: translateX(6px);
}

.btn-anim-split-swap:hover .btn-split-label {
  opacity: 1;
}

.btn-anim-grid-scan {
  background: #7c6cff;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 10px 10px;
}

.btn-anim-grid-scan:hover {
  animation: btn-grid-scan 1.2s linear infinite;
}

@keyframes btn-grid-scan {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 20px 0, 0 20px; }
}

/* ===================== Award-site inspired (lab-original) ===================== */

.btn-anim-pill-morph {
  border-radius: 999px;
  transition:
    border-radius 0.5s var(--btn-ease),
    transform 0.4s var(--btn-ease),
    box-shadow 0.4s ease;
}

.btn-anim-pill-morph:hover {
  border-radius: 12px;
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(124, 108, 255, 0.45);
}

.btn-anim-liquid-fill {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  overflow: hidden;
}

.btn-anim-liquid-fill::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -120%;
  width: 220%;
  aspect-ratio: 1;
  border-radius: 42%;
  background: linear-gradient(135deg, #7c6cff, #ff6b9d);
  transform: translateX(-50%);
  transition: bottom 0.55s var(--btn-ease);
  z-index: -1;
}

.btn-anim-liquid-fill:hover::before {
  bottom: -35%;
}

.btn-anim-liquid-fill:hover {
  border-color: transparent;
}

.btn-anim-label-roll {
  background: #1a1a22;
  border-color: #7c6cff;
  overflow: hidden;
}

.btn-anim-label-roll .btn-roll {
  display: block;
  height: 1.2em;
  overflow: hidden;
}

.btn-anim-label-roll .btn-roll-inner {
  display: flex;
  flex-direction: column;
  transition: transform 0.45s var(--btn-ease);
}

.btn-anim-label-roll .btn-roll-line {
  display: block;
  line-height: 1.2;
  color: #fff;
}

.btn-anim-label-roll:hover .btn-roll-inner {
  transform: translateY(-50%);
}

.btn-anim-double-outline {
  background: transparent;
  color: #f4f4f6;
  border-color: #7c6cff;
  box-shadow: 0 0 0 0 rgba(124, 108, 255, 0);
  transition:
    box-shadow 0.4s var(--btn-ease),
    transform 0.35s var(--btn-ease);
}

.btn-anim-double-outline:hover {
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 #7c6cff, 12px 12px 0 rgba(255, 107, 157, 0.55);
}

.btn-anim-glass-hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(0);
  transition:
    backdrop-filter 0.45s ease,
    background 0.45s ease,
    border-color 0.45s ease,
    transform 0.35s var(--btn-ease);
}

.btn-anim-glass-hover:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  transform: scale(1.04);
}

/* --- clip-diagonal ---
   CSS Design Awards style: a diagonal slash sweeps in from the
   bottom-left corner on hover, revealing a solid fill behind the label.
   Pure CSS clip-path — no layering tricks needed. */
.btn-anim-clip-diagonal {
  position: relative;
  overflow: hidden;
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
  transition: color 0.32s var(--btn-ease);
  z-index: 0;
}
.btn-anim-clip-diagonal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  clip-path: polygon(0% 110%, -10% 110%, -10% 110%);
  transition: clip-path 0.38s cubic-bezier(0.4, 0, 0.1, 1);
  z-index: -1;
}
.btn-anim-clip-diagonal:hover {
  color: #fff;
}
.btn-anim-clip-diagonal:hover::before {
  clip-path: polygon(0% 110%, 110% -10%, 110% 110%);
}

/* ============================================================
   NEW BUTTON ANIMATIONS — batch 2
   ============================================================ */

/* --- border-beam ---
   A glowing beam travels clockwise around the button border on hover.
   Uses a rotating conic-gradient on a pseudo-element masked to the border. */
.btn-anim-border-beam {
  position: relative;
  overflow: hidden;
  background: transparent;
  border-color: transparent;
  color: var(--accent);
  transition: color 0.25s;
  z-index: 0;
}
.btn-anim-border-beam::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    var(--accent) 60deg,
    transparent 120deg
  );
  animation: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: -2;
}
.btn-anim-border-beam::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: var(--bg, #fff);
  z-index: -1;
}
.btn-anim-border-beam:hover::before {
  opacity: 1;
  animation: anim-border-beam 1.4s linear infinite;
}
.btn-anim-border-beam:hover {
  color: var(--accent);
}
@keyframes anim-border-beam {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* --- smoke-reveal ---
   Button background blooms outward from center with a radial smoke effect.
   Pure CSS radial-gradient scale + opacity on hover. */
.btn-anim-smoke-reveal {
  position: relative;
  overflow: hidden;
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
  transition: color 0.35s ease;
  z-index: 0;
}
.btn-anim-smoke-reveal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, var(--accent) 0%, transparent 70%);
  transform: scale(0);
  opacity: 0;
  border-radius: inherit;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              opacity  0.5s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: -1;
}
.btn-anim-smoke-reveal:hover::before {
  transform: scale(2.5);
  opacity: 1;
}
.btn-anim-smoke-reveal:hover {
  color: #fff;
}

/* --- stagger-stripes ---
   On hover, 4 vertical stripes appear left-to-right filling the button. */
.btn-anim-stagger-stripes {
  position: relative;
  overflow: hidden;
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
  transition: color 0.3s;
  z-index: 0;
}
.btn-anim-stagger-stripes::before,
.btn-anim-stagger-stripes::after {
  content: '';
  position: absolute;
  top: 0;
  width: 25%;
  height: 100%;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: -1;
}
.btn-anim-stagger-stripes::before {
  left: 0%;
  transition-delay: 0s;
}
.btn-anim-stagger-stripes::after {
  left: 50%;
  transition-delay: 0.08s;
}
/* Additional stripes via box-shadow trick on the pseudo-elements */
.btn-anim-stagger-stripes:hover::before,
.btn-anim-stagger-stripes:hover::after {
  transform: scaleY(1);
}
.btn-anim-stagger-stripes:hover {
  color: #fff;
  /* Fill remaining 2 stripes with a gradient overlay */
  background: linear-gradient(to right,
    var(--accent) 0%, var(--accent) 25%,
    color-mix(in srgb, var(--accent) 85%, #fff) 25%,
    color-mix(in srgb, var(--accent) 85%, #fff) 50%,
    color-mix(in srgb, var(--accent) 90%, #000) 50%,
    color-mix(in srgb, var(--accent) 90%, #000) 75%,
    var(--accent) 75%, var(--accent) 100%
  );
  transition: color 0.3s, background 0s 0.08s;
}

/* --- icon-morph ---
   Arrow → morphs into ✓ checkmark on hover using CSS rotation.
   No inner element required; uses ::before + ::after line segments. */
.btn-anim-icon-morph {
  position: relative;
  padding-right: 2.8em;
  transition: padding-right 0.3s;
}
.btn-anim-icon-morph::before,
.btn-anim-icon-morph::after {
  content: '';
  position: absolute;
  right: 1em;
  top: 50%;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              width    0.35s cubic-bezier(0.22, 1, 0.36, 1),
              top      0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Arrow shaft */
.btn-anim-icon-morph::before {
  width: 16px;
  transform: translateY(-50%);
}
/* Arrow head — rotated to form ">" */
.btn-anim-icon-morph::after {
  width: 8px;
  transform: translateY(-50%) rotate(45deg);
  transform-origin: right center;
}
/* Hover: rotate into checkmark */
.btn-anim-icon-morph:hover::before {
  width: 10px;
  transform: translateY(-1px) rotate(45deg);
  transform-origin: left bottom;
}
.btn-anim-icon-morph:hover::after {
  width: 16px;
  transform: translateY(-4px) rotate(-45deg);
  transform-origin: left bottom;
}

/* --- bounce-press ---
   Satisfying elastic spring on :active — squish down then overshoot. */
.btn-anim-bounce-press {
  transition: transform 0.12s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.12s ease;
}
.btn-anim-bounce-press:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108, 99, 255, 0.3);
}
.btn-anim-bounce-press:active {
  animation: anim-bounce-press 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes anim-bounce-press {
  0%   { transform: scale(1);    }
  20%  { transform: scale(0.88); }
  50%  { transform: scale(1.06); }
  70%  { transform: scale(0.97); }
  85%  { transform: scale(1.02); }
  100% { transform: scale(1);    }
}

/* --- gradient-border-spin ---
   Animated conic-gradient border that continuously rotates on hover. */
.btn-anim-gradient-border-spin {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
  position: relative;
}
.btn-anim-gradient-border-spin::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: conic-gradient(from 0deg, #7c6cff, #ec4899, #06b6d4, #f59e0b, #7c6cff);
  z-index: -1;
  animation: btn-grad-spin 2s linear infinite paused;
}
.btn-anim-gradient-border-spin::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 6px;
  background: var(--bg);
  z-index: -1;
}
.btn-anim-gradient-border-spin:hover::before {
  animation-play-state: running;
}
@keyframes btn-grad-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* --- invert-hover ---
   On hover, button inverts its color scheme. */
.btn-anim-invert-hover {
  background: #fff;
  color: #18181b;
  border-color: transparent;
  transition: background 0.28s ease, color 0.28s ease;
}
.btn-anim-invert-hover:hover {
  background: #18181b;
  color: #fff;
}

/* --- squish ---
   Tactile rubber squish on hover. */
.btn-anim-squish {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn-anim-squish:hover {
  transform: scaleX(1.06) scaleY(0.92);
}

/* --- shimmer-loop ---
   Continuous shimmer that loops only while hovered. */
.btn-anim-shimmer-loop {
  position: relative;
  overflow: hidden;
}
.btn-anim-shimmer-loop::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 100%
  );
  animation: btn-shimmer-loop 1.4s linear infinite paused;
}
.btn-anim-shimmer-loop:hover::after {
  animation-play-state: running;
}
@keyframes btn-shimmer-loop {
  from { left: -100%; }
  to   { left: 140%; }
}

/* --- hover-fill-radial ---
   Background fills radially from center on hover using clip-path. */
.btn-anim-hover-fill-radial {
  position: relative;
  overflow: hidden;
  color: var(--accent);
  border-color: var(--accent);
  background: transparent;
  transition: color 0.4s ease;
}
.btn-anim-hover-fill-radial::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  clip-path: circle(0% at 50% 50%);
  transition: clip-path 0.4s ease;
  z-index: -1;  /* テキストの背後に置いて color: #fff が見えるようにする */
}
.btn-anim-hover-fill-radial:hover::before {
  clip-path: circle(150% at 50% 50%);
}
.btn-anim-hover-fill-radial:hover {
  color: #fff;
}
.btn-anim-hover-fill-radial span,
.btn-anim-hover-fill-radial > * {
  position: relative;
  z-index: 1;
}

/* --- depth-3d ---
   Button with 3D box-shadow depth that presses in on hover. */
.btn-anim-depth-3d {
  box-shadow: 5px 5px 0 #3d35a0, 4px 4px 0 #3d35a0, 3px 3px 0 #3d35a0;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.btn-anim-depth-3d:hover {
  box-shadow: 2px 2px 0 #3d35a0;
  transform: translate(3px, 3px);
}
.btn-anim-depth-3d:active {
  box-shadow: none;
  transform: translate(5px, 5px);
}

/* --- color-cycle ---
   Button continuously cycles through a hue range on hover. */
.btn-anim-color-cycle:hover {
  animation: btn-color-cycle 2s linear infinite;
}
@keyframes btn-color-cycle {
  0%   { background: #7c6cff; }
  25%  { background: #ec4899; }
  50%  { background: #06b6d4; }
  75%  { background: #f59e0b; }
  100% { background: #7c6cff; }
}

/* --- elastic-width ---
   Button width bounces on entrance, starts narrow then overshoots to full width. */
.btn-anim-elastic-width {
  animation: btn-elastic-w 0.8s cubic-bezier(0.34,1.56,0.64,1) both;
  transform-origin: center;
}
@keyframes btn-elastic-w {
  0%   { transform: scaleX(0.1); opacity:0; }
  60%  { transform: scaleX(1.08); opacity:1; }
  80%  { transform: scaleX(0.97); }
  100% { transform: scaleX(1); }
}

/* --- magnetic-drift ---
   On hover, button drifts upward as if attracted, snaps back on leave. */
.btn-anim-magnetic-drift {
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease;
}
.btn-anim-magnetic-drift:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 12px 28px rgba(124,108,255,0.5);
}

/* --- particle-emit ---
   On hover, a ring of dots appears around the button and expands outward. */
.btn-anim-particle-emit {
  transition: box-shadow 0.4s ease;
}
.btn-anim-particle-emit:hover {
  animation: btn-particles 0.6s ease-out forwards;
}
@keyframes btn-particles {
  0%  { box-shadow:
    0 0 0 0 rgba(124,108,255,0.8),
    0 0 0 0 rgba(236,72,153,0.8),
    0 0 0 0 rgba(6,182,212,0.8),
    0 0 0 0 rgba(167,139,250,0.8); }
  100%{ box-shadow:
    0 -22px 0 2px rgba(124,108,255,0),
    22px  0 0 2px rgba(236,72,153,0),
    0  22px 0 2px rgba(6,182,212,0),
   -22px  0 0 2px rgba(167,139,250,0); }
}

/* --- fill-top-down ---
   Background fills from top to bottom on hover. */
.btn-anim-fill-top-down {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
  transition: color 0.3s;
  overflow: hidden;
}
.btn-anim-fill-top-down::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1);
  z-index: -1;
}
.btn-anim-fill-top-down:hover { color: #fff; }
.btn-anim-fill-top-down:hover::before { transform: scaleY(1); }

/* --- pulse-ring-btn ---
   Pulsing ring expands outward from button border on hover. */
.btn-anim-pulse-ring-btn {
  transition: transform 0.2s ease;
}
.btn-anim-pulse-ring-btn:hover {
  animation: btn-pulse-ring 1.2s ease-out infinite;
}
@keyframes btn-pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(124,108,255,0.6); }
  70%  { box-shadow: 0 0 0 14px rgba(124,108,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(124,108,255,0); }
}

/* --- morph-pill-btn ---
   On hover, border-radius morphs to a full pill shape and back. */
.btn-anim-morph-pill-btn {
  transition: border-radius 0.4s cubic-bezier(0.34,1.56,0.64,1), transform 0.3s ease;
}
.btn-anim-morph-pill-btn:hover {
  border-radius: 50px;
  transform: scaleX(0.96);
}

/* --- fade-swap-label ---
   On hover, background + text reveal via clip-path from bottom. */
.btn-anim-fade-swap-label {
  position: relative;
  overflow: hidden;
  transition: color 0.3s;
}
.btn-anim-fade-swap-label::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.22);
  clip-path: inset(100% 0 0 0);
  transition: clip-path 0.35s cubic-bezier(0.22,1,0.36,1);
  z-index: -1;
}
.btn-anim-fade-swap-label:hover { color: #fff; }
.btn-anim-fade-swap-label:hover::before { clip-path: inset(0% 0 0 0); }

/* --- typewriter-enter-btn ---
   ホバー時にテキストがタイプライター風に展開する。 */
.btn-anim-typewriter-enter {
  overflow: hidden;
  white-space: nowrap;
  max-width: 300px;
}
.btn-anim-typewriter-enter:hover {
  animation: btn-typewriter-enter 0.7s steps(10, end) both;
}
@keyframes btn-typewriter-enter {
  from { max-width: 0; opacity: 0.5; }
  to   { max-width: 300px; opacity: 1; }
}

/* ============================================================
   21st.dev インスパイア ボタン新着 (2026-06)
   ============================================================ */

/* --- cta-arrow ---
   Arrow slides in from left on hover; label shifts right. */
.btn-anim-cta-arrow {
  position: relative;
  overflow: hidden;
  transition: padding-left 0.3s cubic-bezier(0.34,1.56,0.64,1), background 0.3s;
}
.btn-anim-cta-arrow::before {
  content: '→';
  position: absolute;
  left: -1.4em;
  top: 50%;
  transform: translateY(-50%);
  transition: left 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.btn-anim-cta-arrow:hover { padding-left: 2.2em; }
.btn-anim-cta-arrow:hover::before { left: 0.7em; }

/* --- magnetic-hover ---
   Perspective skew + scale gives a magnetic-pull feel. */
.btn-anim-magnetic-hover {
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.35s;
}
.btn-anim-magnetic-hover:hover {
  transform: perspective(400px) rotateX(-6deg) rotateY(4deg) scale(1.06);
  box-shadow: -4px 8px 24px rgba(124,108,255,0.45);
}

/* --- count-badge ---
   Pink counter badge pops out on hover. */
.btn-anim-count-badge {
  position: relative;
  overflow: visible;   /* バッジが外に出るため hidden を上書き */
  transition: transform 0.25s ease;
}
.btn-anim-count-badge::after {
  content: attr(data-count);
  position: absolute;
  top: -0.55em; right: -0.55em;
  background: #ff6b9d;
  color: #fff;
  font-size: 0.6em;
  font-weight: 700;
  width: 1.8em; height: 1.8em;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transform: scale(0);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.btn-anim-count-badge:hover::after { transform: scale(1); }
.btn-anim-count-badge:hover { transform: translateY(-2px); }

/* --- outline-draw ---
   Top and bottom borders draw toward each other on hover. */
.btn-anim-outline-draw {
  position: relative;
  background: transparent;
  border: none;
  color: var(--text, #f4f4f6);
}
.btn-anim-outline-draw::before,
.btn-anim-outline-draw::after {
  content: '';
  position: absolute;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.35s ease;
}
.btn-anim-outline-draw::before { top: 0; left: 0; }
.btn-anim-outline-draw::after  { bottom: 0; right: 0; }
.btn-anim-outline-draw:hover::before,
.btn-anim-outline-draw:hover::after { width: 100%; }

/* --- aurora ---
   Aurora glow cycles through colours on hover (box-shadow approach — avoids z-index/isolation issues). */
.btn-anim-aurora {
  transition: transform 0.2s ease, box-shadow 0.4s ease;
}
.btn-anim-aurora:hover {
  transform: scale(1.04);
  animation: btn-aurora-glow 2s linear infinite;
}
@keyframes btn-aurora-glow {
  0%   { box-shadow: 0 0 0 2px rgba(124,108,255,0.8), 0 0 18px 4px rgba(124,108,255,0.5), 0 0 36px 8px rgba(6,182,212,0.2); }
  33%  { box-shadow: 0 0 0 2px rgba(6,182,212,0.8),   0 0 18px 4px rgba(6,182,212,0.5),   0 0 36px 8px rgba(255,107,157,0.25); }
  66%  { box-shadow: 0 0 0 2px rgba(255,107,157,0.8), 0 0 18px 4px rgba(255,107,157,0.5), 0 0 36px 8px rgba(167,139,250,0.25); }
  100% { box-shadow: 0 0 0 2px rgba(124,108,255,0.8), 0 0 18px 4px rgba(124,108,255,0.5), 0 0 36px 8px rgba(6,182,212,0.2); }
}

/* --- slide-reveal-label ---
   Clipped duplicate label slides up from bottom on hover (editorial CTA style). */
.btn-anim-slide-reveal-label {
  position: relative;
  overflow: hidden;
}
.btn-anim-slide-reveal-label .btn-label-front,
.btn-anim-slide-reveal-label .btn-label-back {
  display: block;
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1);
}
.btn-anim-slide-reveal-label .btn-label-back {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: #fff;
  transform: translateY(100%);
}
.btn-anim-slide-reveal-label:hover .btn-label-front { transform: translateY(-100%); }
.btn-anim-slide-reveal-label:hover .btn-label-back  { transform: translateY(0); }
