@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #1a1a24;
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-tertiary: #ec4899;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border-color: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.2);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
  min-height: 100vh;
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: min(1200px, 100% - 40px);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 6vw, 48px);
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

header {
  text-align: center;
  padding: 0;
}

.main-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.description {
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  font-weight: 400;
  line-height: 1.7;
}

.games-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(20px, 4vw, 24px);
  padding: 0;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: clamp(16px, 2vw, 20px);
  padding: clamp(20px, 4vw, 32px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-card:hover::before {
  transform: scaleX(1);
}

.game-card:hover {
  transform: translateY(-8px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 
    var(--shadow-lg),
    var(--shadow-glow);
}

.game-icon {
  font-size: clamp(36px, 5vw, 48px);
  margin-bottom: 20px;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}

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

.game-title {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.game-description {
  font-size: clamp(0.875rem, 1.2vw, 0.9375rem);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 28px;
  font-weight: 400;
}

.game-btn {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.875rem, 1.2vw, 0.9375rem);
  font-weight: 600;
  padding: clamp(12px, 2vw, 14px) clamp(24px, 4vw, 28px);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  border-radius: clamp(10px, 1.5vw, 12px);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  width: 100%;
  overflow: hidden;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.game-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.game-btn:hover::before {
  left: 100%;
}

.game-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
}

.game-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.rps-btn {
  background: linear-gradient(135deg, #ec4899, #f43f5e);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.rps-btn:hover {
  background: linear-gradient(135deg, #f43f5e, #ec4899);
  box-shadow: 0 8px 24px rgba(236, 72, 153, 0.4);
}

.guess-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.guess-btn:hover {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

footer {
  text-align: center;
  padding: 24px 0;
}

.footer-text {
  font-size: clamp(0.8125rem, 1vw, 0.9375rem);
  color: var(--text-muted);
  font-weight: 400;
}

/* Responsive design */
@media (max-width: 1024px) {
  .games-section {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  }
}

@media (max-width: 768px) {
  body {
    padding: clamp(20px, 4vw, 24px) clamp(12px, 3vw, 16px);
  }

  .container {
    max-width: 100%;
  }

  .games-section {
    grid-template-columns: 1fr;
  }

  .game-icon {
    margin-bottom: clamp(12px, 2vw, 16px);
  }

  .game-description {
    margin-bottom: clamp(20px, 3vw, 24px);
  }
}

@media (max-width: 480px) {
  body {
    padding: clamp(16px, 3vw, 20px) clamp(10px, 2vw, 12px);
  }

  header {
    padding: 0 clamp(10px, 2vw, 20px);
  }

  .main-title {
    margin-bottom: clamp(12px, 2vw, 16px);
  }

  .subtitle {
    margin-bottom: clamp(8px, 1.5vw, 12px);
  }
}

@media (max-width: 360px) {
  .game-card {
    padding: clamp(16px, 3vw, 20px);
  }
}

/* Landscape orientation for mobile */
@media (max-height: 600px) and (orientation: landscape) {
  body {
    padding: 16px 20px;
  }

  .container {
    gap: 24px;
  }

  .game-card {
    padding: 20px;
  }
}

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

/* Selection color */
::selection {
  background: rgba(99, 102, 241, 0.3);
  color: var(--text-primary);
}
