/* Mini Arcade - Main Styles */
:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --secondary: #22c55e;
  --accent: #f59e0b;
  --danger: #ef4444;
  --bg-primary: #87CEEB;
  --bg-secondary: #98D8E8;
  --white: #ffffff;
  --gray-100: #f8fafc;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-600: #475569;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

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

html, body {
  height: 100%;
  font-family: ui-rounded, system-ui, -apple-system, 'Segoe UI', Roboto, Cantarell, Arial, sans-serif;
  color: var(--gray-800);
  line-height: 1.6;
}

body {
  background: 
    url('../images/background.jpg') center/cover no-repeat fixed,
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Glass morphism effect */
.glass {
  background: linear-gradient(180deg, rgba(255,255,255,.25), rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.2);
  box-shadow: 
    inset 0 1px 0 rgba(255,255,255,.3), 
    var(--shadow-xl);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 0;
}

.nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 800;
}

.logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-1px);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 0 6rem;
  color: var(--white);
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  margin-bottom: 1.5rem;
  text-shadow: 0 4px 8px rgba(0,0,0,0.3);
  background: linear-gradient(135deg, var(--white), #e0f2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.95;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(0,0,0,.15));
  background-color: var(--secondary);
  color: var(--white);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: var(--shadow-lg);
  transition: all 0.2s ease;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

/* Games Section */
.games {
  padding: 4rem 0;
  background: rgba(255,255,255,0.05);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 3rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.game-card {
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.game-card:hover {
  transform: translateY(-8px);
}

.game-preview {
  height: 250px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--white);
}

.game-preview::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.1) 100%);
}

.game-info {
  padding: 1.5rem;
  color: var(--white);
}

.game-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.game-description {
  opacity: 0.9;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.game-tag {
  padding: 0.25rem 0.75rem;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
}

.play-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(0,0,0,.15));
  background-color: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.play-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Coming Soon Cards */
.coming-soon {
  opacity: 0.7;
  pointer-events: none;
}

.coming-soon .game-preview {
  background: linear-gradient(135deg, var(--gray-600), var(--gray-800));
}

.coming-soon-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--white);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 10;
}

/* Footer */
.footer {
  padding: 3rem 0 2rem;
  text-align: center;
  color: var(--white);
  margin-top: 4rem;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-text {
  opacity: 0.8;
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-link {
  color: var(--white);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.footer-link:hover {
  opacity: 1;
}

/* Responsive Design */

/* Mobile First Approach - Small devices (landscape phones, 576px and up) */
@media (max-width: 575px) {
  .nav {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 1rem;
  }
  
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  
  .nav-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }
  
  .logo {
    font-size: 1.25rem;
  }
  
  .logo-icon {
    font-size: 1.5rem;
  }
  
  .hero {
    padding: 1.5rem 0 3rem;
  }
  
  .hero-title {
    font-size: 2rem;
    line-height: 1.1;
  }
  
  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .hero-cta {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }
  
  .games-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .game-card {
    margin: 0 0.5rem;
  }
  
  .game-preview {
    height: 200px;
    font-size: 3rem;
  }
  
  .game-info {
    padding: 1rem;
  }
  
  .game-title {
    font-size: 1.25rem;
  }
  
  .game-description {
    font-size: 0.9rem;
    line-height: 1.4;
  }
  
  .play-button {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
  
  .section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
  }
  
  .container {
    padding: 0 1rem;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .footer-text {
    font-size: 0.9rem;
  }
}

/* Medium devices (tablets, 576px to 768px) */
@media (min-width: 576px) and (max-width: 768px) {
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .nav-links {
    gap: 1rem;
    flex-wrap: wrap;
  }
  
  .hero {
    padding: 2rem 0 4rem;
  }
  
  .games-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .game-preview {
    height: 220px;
  }
  
  .container {
    padding: 0 1.5rem;
  }
}

/* Large tablets and small desktops (768px to 992px) */
@media (min-width: 768px) and (max-width: 992px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .hero-title {
    font-size: 3rem;
  }
}

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

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Game card hover effects */
.game-card:hover .game-preview {
  transform: scale(1.02);
}

.game-card:hover .play-button {
  background-color: var(--secondary);
}

/* Mobile Touch Optimizations */

/* Touch-friendly button sizing */
.btn, .play-button, .nav-link {
  min-height: 44px; /* Apple's recommended minimum touch target size */
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation; /* Disable double-tap zoom */
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1); /* Better tap feedback */
}

/* Improved touch interactions */
.game-card {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

/* Better mobile scrolling */
body {
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  scroll-behavior: smooth;
}

/* Prevent zoom on input focus (if we add forms later) */
input, select, textarea {
  font-size: 16px; /* Prevents zoom on iOS */
}

/* Mobile-specific hover states */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .game-card:hover {
    transform: none;
  }
  
  .game-card:hover .game-preview {
    transform: none;
  }
  
  .nav-link:hover {
    background: none;
    transform: none;
  }
  
  .hero-cta:hover {
    transform: none;
  }
  
  .play-button:hover {
    transform: none;
  }
}

/* Active states for touch feedback */
.btn:active,
.play-button:active,
.nav-link:active,
.game-card:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

/* Better mobile typography */
@media (max-width: 575px) {
  /* Ensure text is readable on small screens */
  html {
    font-size: 14px; /* Slightly smaller base font size on mobile */
  }
  
  /* Better line heights for mobile reading */
  body {
    line-height: 1.5;
  }
  
  /* Improve button spacing on mobile */
  .btn {
    margin: 0.25rem;
  }
  
  /* Better mobile navigation */
  .nav {
    position: sticky;
    top: 0;
    background: rgba(79, 70, 229, 0.95);
    backdrop-filter: blur(20px);
    z-index: 1000;
  }
  
  /* Optimize hero section for mobile viewport */
  .hero {
    min-height: 50vh;
    display: flex;
    align-items: center;
  }
  
  /* Better mobile card layout */
  .game-card {
    box-shadow: var(--shadow-lg);
    border-radius: 16px;
  }
  
  /* Improve mobile about section */
  .games[style*="background: rgba(255,255,255,0.1)"] .container > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    padding: 1rem 0 2rem;
    min-height: 40vh;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 1rem;
  }
  
  .section-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
  }
}

/* High-DPI screen optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Sharper borders and shadows on retina displays */
  .glass {
    border-width: 0.5px;
  }
  
  .game-card {
    border: 0.5px solid rgba(255,255,255,0.1);
  }
}

/* Utility classes */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }

/* Mobile-specific utilities */
@media (max-width: 575px) {
  .mobile-hidden { display: none !important; }
  .mobile-full-width { width: 100% !important; }
  .mobile-text-center { text-align: center !important; }
  .mobile-mb-2 { margin-bottom: 0.5rem !important; }
  .mobile-px-1 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
}
