/* Reset and Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Global Dark Mode */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
  color: #c9d1d9;
  line-height: 1.6;
  min-height: 100vh;
}

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

/* Header Styles */
.main-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding: 2rem 0;
  position: relative;
}

h1 {
  color: #58a6ff;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 10px rgba(88, 166, 255, 0.3);
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: #8b949e;
  font-weight: 400;
  max-width: 600px;
  margin: 0 auto;
}

/* Back Link */
.back-link {
  position: absolute;
  top: 0;
  left: 0;
  color: #58a6ff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  background: rgba(56, 139, 253, 0.1);
  border: 1px solid rgba(56, 139, 253, 0.2);
  border-radius: 50px;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.back-link:hover {
  background: rgba(56, 139, 253, 0.2);
  border-color: rgba(56, 139, 253, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(56, 139, 253, 0.3);
}

/* Navigation Grid */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.nav-card {
  background: linear-gradient(135deg, #161b22 0%, #1c2128 100%);
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(56, 139, 253, 0.1);
  backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.nav-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(88, 166, 255, 0.1), transparent);
  transition: left 0.5s;
}

.nav-card:hover::before {
  left: 100%;
}

.nav-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 8px 20px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-color: rgba(56, 139, 253, 0.3);
}

.card-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  display: block;
  text-align: center;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.card-title {
  color: #f0f6fc;
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
}

.card-description {
  color: #8b949e;
  font-size: 1.125rem;
  line-height: 1.6;
  text-align: center;
  margin-bottom: 1.5rem;
}

.card-features {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.feature-tag {
  background: rgba(56, 139, 253, 0.15);
  color: #58a6ff;
  padding: 0.375rem 0.875rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid rgba(56, 139, 253, 0.2);
}

/* Benefits Grid */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.benefit-item {
  text-align: center;
  padding: 1.5rem 1rem;
  background: rgba(13, 17, 23, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(56, 139, 253, 0.1);
  transition: all 0.2s ease;
}

.benefit-item:hover {
  background: rgba(56, 139, 253, 0.1);
  border-color: rgba(56, 139, 253, 0.2);
  transform: translateY(-4px);
}

.benefit-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.benefit-item h3 {
  color: #f0f6fc;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.benefit-item p {
  color: #8b949e;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Games Grid */
.games-grid {
  display: grid;
  gap: 2rem;
  margin: 2rem 0;
}

.game-card {
  margin-bottom: 0;
}

/* Coming Soon */
.coming-soon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.coming-soon-item {
  text-align: center;
  padding: 2rem 1.5rem;
  background: rgba(13, 17, 23, 0.4);
  border-radius: 16px;
  border: 1px solid rgba(48, 54, 61, 0.8);
  position: relative;
  overflow: hidden;
}

.coming-soon-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ffa500, transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.coming-soon-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.coming-soon-item h3 {
  color: #f0f6fc;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.coming-soon-item p {
  color: #8b949e;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.status-badge {
  background: rgba(255, 165, 0, 0.15);
  color: #ffa500;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid rgba(255, 165, 0, 0.2);
}

/* Card Styles */
.card {
  background: linear-gradient(135deg, #161b22 0%, #1c2128 100%);
  padding: 2rem;
  margin-bottom: 2rem;
  border-radius: 16px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(56, 139, 253, 0.1);
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 12px 48px rgba(0, 0, 0, 0.5),
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card h2 {
  color: #f0f6fc;
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid rgba(56, 139, 253, 0.2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Notes List Styles */
.notes-grid {
  padding: 1rem 0;
}

.notes-list {
  list-style: none;
  counter-reset: note-counter;
  display: grid;
  gap: 1rem;
}

.notes-list li {
  counter-increment: note-counter;
  background: rgba(13, 17, 23, 0.6);
  border: 1px solid rgba(56, 139, 253, 0.15);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.notes-list li::before {
  content: counter(note-counter, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3.5rem;
  background: linear-gradient(135deg, #388bfd 0%, #1f6feb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: #fff;
  font-family: 'Courier New', monospace;
}

.notes-list li:hover {
  transform: translateX(8px);
  background: rgba(56, 139, 253, 0.1);
  border-color: rgba(56, 139, 253, 0.3);
  box-shadow: 0 4px 16px rgba(56, 139, 253, 0.2);
}

.notes-list a {
  display: block;
  text-decoration: none;
  color: #f0f6fc;
  font-weight: 500;
  font-size: 1.125rem;
  margin-left: 2rem;
  padding: 0.25rem 0;
  transition: color 0.2s ease;
  line-height: 1.4;
}

.notes-list a:hover {
  color: #58a6ff;
}

/* Game Description */
.game-description {
  color: #c9d1d9;
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

/* Command List */
.command-list {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}

.command-item {
  background: rgba(13, 17, 23, 0.8);
  border: 1px solid rgba(48, 54, 61, 0.8);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
}

.command-item:hover {
  background: rgba(13, 17, 23, 1);
  border-color: rgba(56, 139, 253, 0.3);
}

.command-item code {
  background: linear-gradient(135deg, #238636 0%, #2ea043 100%);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 200px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(35, 134, 54, 0.3);
}

.command-item span {
  color: #8b949e;
  font-size: 0.95rem;
}

/* Merge Wars Steps */
.merge-wars-steps {
  margin: 1.5rem 0;
}

.step-group h3 {
  color: #f0f6fc;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
}

.step-item {
  background: rgba(13, 17, 23, 0.6);
  border: 1px solid rgba(48, 54, 61, 0.8);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: all 0.2s ease;
}

.step-item:hover {
  background: rgba(56, 139, 253, 0.05);
  border-color: rgba(56, 139, 253, 0.2);
  transform: translateX(4px);
}

.step-number {
  background: linear-gradient(135deg, #388bfd 0%, #1f6feb 100%);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 4rem;
  text-align: center;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-content strong {
  color: #f0f6fc;
  display: block;
  margin-bottom: 0.5rem;
}

.step-content code {
  background: rgba(110, 118, 129, 0.2);
  color: #f0f6fc;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-block;
  margin-top: 0.5rem;
}

/* Download Section */
.download-section {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(48, 54, 61, 0.5);
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, #238636 0%, #2ea043 100%);
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.125rem;
  transition: all 0.2s ease;
  box-shadow: 
    0 4px 16px rgba(35, 134, 54, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.2);
  border: none;
  cursor: pointer;
}

.btn:hover {
  background: linear-gradient(135deg, #2ea043 0%, #238636 100%);
  transform: translateY(-2px);
  box-shadow: 
    0 8px 32px rgba(35, 134, 54, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.3);
  color: #fff;
}

.btn:active {
  transform: translateY(0);
}

.btn-war {
  background: linear-gradient(135deg, #da3633 0%, #f85149 100%);
  box-shadow: 
    0 4px 16px rgba(248, 81, 73, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-war:hover {
  background: linear-gradient(135deg, #f85149 0%, #da3633 100%);
  box-shadow: 
    0 8px 32px rgba(248, 81, 73, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-icon {
  font-size: 1.25rem;
}

/* Code Styles */
code {
  background: rgba(110, 118, 129, 0.2);
  color: #f0f6fc;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
  font-size: 0.875em;
  font-weight: 500;
}

.repo-link {
  color: #58a6ff !important;
  text-decoration: none;
  font-weight: 600;
  background: rgba(88, 166, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(88, 166, 255, 0.2);
  transition: all 0.2s ease;
}

.repo-link:hover {
  background: rgba(88, 166, 255, 0.2);
  border-color: rgba(88, 166, 255, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1.5rem 1rem;
  }

  .main-header {
    padding: 1.5rem 0;
  }

  .back-link {
    position: static;
    display: inline-block;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  
  .nav-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .nav-card {
    padding: 2rem 1.5rem;
  }

  .card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
  }

  .card-title {
    font-size: 1.75rem;
  }

  .card-description {
    font-size: 1rem;
  }

  .benefits-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
  }

  .benefit-item {
    padding: 1.25rem 0.75rem;
  }

  .coming-soon-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .card h2 {
    font-size: 1.5rem;
  }
  
  .notes-list li {
    padding: 1rem 1.25rem;
  }
  
  .notes-list li::before {
    width: 3rem;
  }
  
  .notes-list a {
    font-size: 1rem;
    margin-left: 1.5rem;
  }
  
  .command-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    text-align: left;
  }
  
  .command-item code {
    min-width: auto;
    width: 100%;
  }

  .step-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .step-number {
    min-width: auto;
    align-self: flex-start;
  }
  
  .btn {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 1rem 0.75rem;
  }
  
  .main-header {
    padding: 1rem 0;
    margin-bottom: 2rem;
  }

  .back-link {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 25px;
  }

  .nav-card {
    padding: 1.75rem 1.25rem;
    border-radius: 16px;
  }

  .card-icon {
    font-size: 2rem;
  }

  .card-title {
    font-size: 1.5rem;
  }

  .card-features {
    gap: 0.5rem;
  }

  .feature-tag {
    font-size: 0.8rem;
    padding: 0.25rem 0.625rem;
  }

  .benefits-grid {
    grid-template-columns: 1fr;
  }

  .benefit-item {
    padding: 1rem 0.75rem;
  }

  .benefit-icon {
    font-size: 2rem;
  }
  
  .card {
    padding: 1.25rem;
    border-radius: 12px;
  }
  
  .notes-list li {
    padding: 0.875rem 1rem;
  }
  
  .notes-list li::before {
    width: 2.5rem;
    font-size: 0.75rem;
  }
  
  .notes-list a {
    margin-left: 1.25rem;
    font-size: 0.95rem;
  }
  
  .game-description {
    font-size: 1rem;
  }
  
  .command-item {
    padding: 0.875rem 1rem;
  }
  
  .command-item code {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
  }

  .step-item {
    padding: 1rem;
  }

  .step-content code {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
  }
}

/* Loading Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeIn 0.6s ease-out;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }

.nav-card:nth-child(1) { animation-delay: 0.1s; }
.nav-card:nth-child(2) { animation-delay: 0.2s; }

/* Focus States for Accessibility */
.notes-list a:focus,
.btn:focus,
.nav-card:focus,
.back-link:focus {
  outline: 2px solid #58a6ff;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  body {
    background: #fff;
    color: #000;
  }
  
  .card, .nav-card {
    background: #fff;
    box-shadow: none;
    border: 1px solid #000;
  }

  .back-link {
    display: none;
  }
}