/* Global Settings */
body {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

/* 1. Noise Texture */
.bg-noise {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* 2. Grid Pattern */
.bg-grid-pattern {
  background-size: 50px 50px;
  background-image: linear-gradient(to right, rgba(99, 102, 241, 0.05) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(99, 102, 241, 0.05) 1px, transparent 1px);
}

.mask-radial-faded {
  mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

/* 3. Floating Blobs Animation */
@keyframes blob {
  0% { transform: translate(0px, 0px) scale(1); }
  33% { transform: translate(30px, -50px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
  100% { transform: translate(0px, 0px) scale(1); }
}
.animate-blob {
  animation: blob 10s infinite;
}
.animation-delay-2000 {
  animation-delay: 2s;
}
.animation-delay-4000 {
  animation-delay: 4s;
}

/* Glassmorphism Header */
.glass-nav {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #F8FAFC;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Animations */
@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  opacity: 0;
  animation: floatUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Hero Specific Blur Reveal Animation */
@keyframes heroBlurFade {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    filter: blur(15px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.hero-animate {
  opacity: 0;
  animation: heroBlurFade 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity, filter;
}

/* Scroll Reveal Class */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Bento Card Common Styles */
.bento-card {
  border-radius: 1.5rem; /* rounded-3xl */
  border: 1px solid rgba(226, 232, 240, 0.8);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
}

@media (min-width: 640px) {
  .bento-card {
    padding: 2.5rem; 
  }
}

.bento-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.3);
}

/* Puzzle Piece Floating Animation */
.puzzle-float {
  animation: floating 6s ease-in-out infinite;
}

@keyframes floating {
  0% { transform: translateY(0px) rotate(var(--tw-rotate)); }
  50% { transform: translateY(-20px) rotate(calc(var(--tw-rotate) + 5deg)); }
  100% { transform: translateY(0px) rotate(var(--tw-rotate)); }
}

.animation-delay-1000 { animation-delay: 1s; }

/* Five Elements Row */
.five-el-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border-width: 1px;
  transition: all 0.2s ease-in-out;
}

/* Game Cards */
.game-card {
  position: absolute;
  width: 7rem; 
  height: 10rem; 
  border-radius: 1rem; 
  border: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: white;
}

.group:hover .game-card {
  transform: translateY(-1rem) rotate(0deg) scale(1.05) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.perspective-1000 {
  perspective: 1000px;
}

/* Spin Slow Animation */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.animate-spin-slow {
  animation: spin-slow 30s linear infinite;
}

/* Progress Bar Fill */
@keyframes fillBar {
  from { width: 0%; }
  to { width: 75%; }
}
.reveal-on-scroll.is-visible .animate-fill-bar {
  animation: fillBar 1.5s ease-out 0.5s forwards;
}