/* Neon Blocks Index Styles (Based on Chess Index) */

:root {
  --primary-gradient: linear-gradient(135deg, #00f2ea 0%, #ff0050 100%);
  /* Cyberpunk Cyan-Pink */
  --dark-bg: #050510;
  --card-bg: rgba(255, 255, 255, 0.05);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --border-color: rgba(0, 242, 234, 0.2);
  --glow-color: rgba(0, 242, 234, 0.5);
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--dark-bg);
  background-image: url('/images/neon_blocks-bg.svg');
  background-size: 200px 200px;
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
}

.game-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.game-header {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
}

.back-button {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 15px var(--glow-color);
  transform: translateY(-50%) translateX(-5px);
}

.game-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(0, 242, 234, 0.3);
}

.header-controls {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

/* Main Content */
.game-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.game-card {
  background: var(--card-bg);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  padding: 40px;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.game-card:hover {
  border-color: #ff0050;
  transform: translateY(-5px);
  box-shadow: 0 0 30px rgba(255, 0, 80, 0.2);
}

.card-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.game-card h2,
.game-card h3 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.card-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
  line-height: 1.6;
}

.primary-button {
  padding: 15px 40px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  background: var(--primary-gradient);
  color: white;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.primary-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 25px rgba(0, 242, 234, 0.6);
}

.primary-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Game Rules */
.game-rules {
  background: var(--card-bg);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  padding: 30px;
  backdrop-filter: blur(10px);
}

.game-rules h3 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.game-rules ul {
  list-style: none;
  padding: 0;
}

.game-rules li {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-left: 30px;
  position: relative;
}

.game-rules li::before {
  content: '►';
  position: absolute;
  left: 0;
  color: #00f2ea;
  font-size: 1rem;
}

/* Mode Selection */
.mode-selection h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 30px;
  color: var(--text-primary);
}

.mode-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 20px;
}

/* Difficulty Selector */
.difficulty-selector {
  margin: 20px 0;
  text-align: left;
}

.difficulty-selector label {
  display: block;
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
}

.difficulty-options {
  display: flex;
  gap: 5px;
  width: 100%;
}

.difficulty-option {
  flex: 1;
  padding: 8px 4px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.difficulty-option:hover {
  border-color: #00f2ea;
  background: rgba(0, 242, 234, 0.1);
}

.difficulty-option.selected {
  border-color: #ff0050;
  background: rgba(255, 0, 80, 0.2);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 0 10px rgba(255, 0, 80, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
  .game-container {
    padding: 10px;
  }

  .game-header {
    margin-bottom: 20px;
  }

  .game-header h1 {
    font-size: 1.8rem;
    margin-top: 10px;
  }

  /* Retain Back button visibility and flow */
  .back-button {
    position: relative;
    transform: none;
    margin-bottom: 15px;
    display: inline-flex;
    width: auto;
  }

  .header-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    transform: none;
  }

  .mode-cards {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .game-card {
    padding: 20px;
    /* Reduce padding significantly */
  }

  .card-icon {
    font-size: 3rem;
    margin-bottom: 10px;
  }

  .game-card h2 {
    font-size: 1.5rem;
  }

  .card-description {
    font-size: 1rem;
    margin-bottom: 20px;
  }

  .primary-button {
    width: 100%;
    /* Full width on mobile */
    padding: 12px 0;
    font-size: 1rem;
    justify-content: center;
  }

  /* Difficulty Selector Mobile */
  .difficulty-selector label {
    font-size: 0.9rem;
  }

  .difficulty-options {
    gap: 3px;
  }

  .difficulty-option {
    padding: 10px 2px;
    font-size: 0.8rem;
    text-align: center;
  }

  /* Rules Mobile */
  .game-rules {
    padding: 15px;
  }

  .game-rules h3 {
    font-size: 1.2rem;
  }

  .game-rules li {
    font-size: 0.9rem;
    padding-left: 20px;
  }
}