@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --background: 40 33% 98%;
    --foreground: 20 14.3% 4.1%;

    --card: 40 30% 96%;
    --card-foreground: 20 14.3% 4.1%;

    --popover: 40 33% 98%;
    --popover-foreground: 20 14.3% 4.1%;

    --primary: 24 9.8% 10%;
    --primary-foreground: 40 33% 98%;

    --secondary: 40 30% 96%;
    --secondary-foreground: 24 9.8% 10%;

    --muted: 40 30% 96%;
    --muted-foreground: 25 5.3% 44.7%;

    --accent: 40 30% 96%;
    --accent-foreground: 24 9.8% 10%;

    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 40 33% 98%;

    --border: 20 5.9% 90%;
    --input: 20 5.9% 90%;
    --ring: 20 14.3% 4.1%;

    --radius: 0.5rem;
  }

  .dark {
    --background: 0 0% 5%; /* Slightly lighter black */
    --foreground: 210 40% 98%;

    --card: 0 0% 15%; /* Slightly lighter black */
    --card-foreground: 210 40% 98%;

    --popover: 0 0% 15%; /* Slightly lighter black */
    --popover-foreground: 210 40% 98%;

    --primary: 210 40% 98%;
    --primary-foreground: 222.2 47.4% 11.2%;

    --secondary: 217.2 32.6% 17.5%;
    --secondary-foreground: 210 40% 98%;

    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;

    --accent: 217.2 32.6% 17.5%;
    --accent-foreground: 210 40% 98%;

    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;

    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 212.7 26.8% 83.9%;
  }
}

@layer base {
  * {
    @apply border-border;
  }
  body {
    @apply bg-background text-foreground transition-colors duration-300;
    overflow: auto;
  }
  
  .light body {
    @apply bg-[#FAF8F3];
  }

  .dark body {
    @apply bg-[#131313];
  }

  /* Smooth scrolling */
  html {
    scroll-behavior: smooth;
  }

  /* Better mobile tap targets */
  @media (max-width: 640px) {
    button, a {
      @apply min-h-[44px] min-w-[44px];
    }
  }
}

/* Custom styles */
.game-card {
  @apply relative overflow-hidden rounded-lg transition-all duration-300;
  aspect-ratio: 3/4;
  background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.8));
}

.game-card:hover {
  transform: scale(1.02);
}

.game-card::before {
  content: '';
  @apply absolute inset-0 bg-black/40 transition-opacity duration-300;
}

.game-card:hover::before {
  @apply opacity-20;
}

.game-card img {
  @apply absolute inset-0 w-full h-full object-cover transition-transform duration-300;
}

.game-card:hover img {
  transform: scale(1.1);
}

.game-card-content {
  @apply absolute inset-x-0 bottom-0 p-4 text-white text-center;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

/* Custom animations */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* Card hover effects */
.card-hover {
  @apply transition-all duration-300 hover:shadow-lg hover:-translate-y-1;
}

/* Game grid responsive layout */
.game-grid {
  @apply grid gap-6;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Responsive table */
.responsive-table {
  @apply w-full overflow-x-auto;
}

/* Custom scrollbar */
@media (min-width: 640px) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  ::-webkit-scrollbar-track {
    @apply bg-muted;
  }

  ::-webkit-scrollbar-thumb {
    @apply bg-primary/50 rounded-full;
  }

  ::-webkit-scrollbar-thumb:hover {
    @apply bg-primary;
  }
}