/* ===== BUTTON COMPONENT ===== */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  z-index: -1;
  transition: var(--transition);
  opacity: 0;
}

.btn:hover::before {
  opacity: 1;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), #d61355);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 46, 99, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary-color), #06a09e);
  color: white;
  box-shadow: 0 4px 15px rgba(8, 217, 214, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

/* ===== LANGUAGE SWITCHER ===== */
.language-switcher {
  display: flex;
  align-items: center;
  position: relative;
  background: var(--card-bg);
  padding: 4px;
  border-radius: 30px;
  border: 2px solid rgba(255, 46, 99, 0.3);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  width: 100px;
  justify-content: space-between;
  overflow: hidden;
}

.lang-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: calc(50% - 6px);
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  box-shadow: 0 0 10px rgba(255, 46, 99, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

/* Position States for Pill */
.language-switcher.show-fr .lang-pill {
  left: 4px;
}

.language-switcher.show-en .lang-pill {
  left: calc(50% + 2px);
}

.lang-btn {
  flex: 1;
  padding: 6px 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: color 0.3s;
  text-transform: uppercase;
  z-index: 2;
  text-align: center;
}

.lang-btn.active {
  color: white;
  background: transparent;
  /* Override previous active style */
  box-shadow: none;
  /* Override previous active style */
}

.lang-btn:hover:not(.active) {
  color: var(--text-primary);
}

/* ===== GAME CARD COMPONENT ===== */
.game-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  border: 2px solid transparent;
  animation: cardAppear 0.6s ease-out backwards;
}

@keyframes cardAppear {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.game-card:hover:not(.disabled) {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--primary-color);
  box-shadow: 0 15px 40px rgba(255, 46, 99, 0.4),
    0 0 30px rgba(8, 217, 214, 0.2);
}

.game-card.disabled {
  filter: grayscale(1);
  opacity: 0.6;
  cursor: not-allowed;
}

.game-card.disabled .btn {
  pointer-events: none;
  opacity: 0.5;
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 46, 99, 0.1), rgba(8, 217, 214, 0.1));
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}

.game-card:hover::before {
  opacity: 1;
}

.game-banner {
  width: 100%;
  height: 200px;
  object-fit: cover;
  position: relative;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  overflow: hidden;
}

.game-banner::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, transparent 0%, rgba(26, 31, 58, 0.8) 100%);
}

.game-content {
  padding: 20px;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 10px;
}

.game-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.game-players {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 46, 99, 0.2);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-color);
  white-space: nowrap;
  border: 1px solid rgba(255, 46, 99, 0.3);
}

.game-description {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-footer {
  display: flex;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.game-footer .btn {
  flex: 1;
  justify-content: center;
  font-size: 13px;
  padding: 10px 16px;
}

/* ===== BADGE COMPONENT ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-new {
  background: linear-gradient(135deg, var(--accent-color), #ffa500);
  color: var(--dark-bg);
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 189, 57, 0.7);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(255, 189, 57, 0);
  }
}

.badge-popular {
  background: linear-gradient(135deg, var(--primary-color), #ff1744);
  color: white;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 80px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 24px;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.empty-state p {
  font-size: 16px;
  line-height: 1.6;
}

/* ===== ANIMATIONS DELAYS ===== */
.game-card:nth-child(1) {
  animation-delay: 0.1s;
}

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

.game-card:nth-child(3) {
  animation-delay: 0.3s;
}

.game-card:nth-child(4) {
  animation-delay: 0.4s;
}

.game-card:nth-child(5) {
  animation-delay: 0.5s;
}

.game-card:nth-child(6) {
  animation-delay: 0.6s;
}
/* ===== POPUP COMPONENT ===== */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 14, 39, 0.85); /* Dark background matching theme */
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.popup-box {
  background: rgba(30, 35, 60, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 30px;
  width: 90%;
  max-width: 600px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.popup-overlay.visible .popup-box {
  transform: scale(1);
}

.popup-title {
  font-size: 24px;
  margin-bottom: 15px;
  color: #fff;
}

.popup-content {
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 25px;
}

.popup-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

/* ===== SHEEP RULES STYLING ===== */
.sheep-rules-container {
  text-align: left;
  max-height: 70vh;
  overflow-y: auto;
  padding: 10px;
}

.sheep-rules-container .rules-section {
  margin-bottom: 25px;
}

.sheep-rules-container h4 {
  color: var(--primary-color);
  font-size: 1.3rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sheep-rules-container p {
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 10px;
}

.sheep-rules-container strong {
  color: #fff;
  font-weight: 600;
}

.rules-goal {
  background: linear-gradient(135deg, rgba(255, 46, 99, 0.15), rgba(214, 19, 85, 0.15));
  border-left: 4px solid var(--primary-color);
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 15px;
}

.rules-goal h4 {
  margin-top: 0;
}

.team-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.9rem;
  margin: 0 4px;
}

.team-blue-badge {
  background: linear-gradient(135deg, #1e88e5, #42a5f5);
  color: white;
}

.team-pink-badge {
  background: linear-gradient(135deg, #ff2e63, #d61355);
  color: white;
}

.card-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.card-type-box {
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.card-type-box:hover {
  transform: translateY(-3px);
}

.card-type-box.type-1 {
  background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%);
  border: 2px solid #2e7d32;
}

.card-type-box.type-2 {
  background: linear-gradient(135deg, #ffa000 0%, #ffca28 100%);
  border: 2px solid #ff6f00;
}

.card-type-box.type-3 {
  background: linear-gradient(135deg, #f4511e 0%, #ff7043 100%);
  border: 2px solid #d84315;
}

.card-type-box.type-speed {
  background: linear-gradient(135deg, #7b1fa2 0%, #ab47bc 100%);
  border: 2px solid #4a148c;
}

.card-type-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.card-type-value {
  font-size: 2rem;
  font-weight: 900;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.card-type-label {
  font-size: 1rem;
  font-weight: bold;
  color: white;
  text-transform: uppercase;
}

.card-type-box p {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0;
}

.rules-footer {
  background: rgba(255, 255, 255, 0.05);
  padding: 15px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.rules-footer p {
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.rules-final {
  margin-top: 15px;
  text-align: center;
  font-size: 1.1rem !important;
  font-weight: bold;
  color: var(--primary-color) !important;
}

/* Responsive adjustments for rules popup */
@media (max-width: 768px) {
  .card-type-grid {
    grid-template-columns: 1fr;
  }
  
  .popup-box {
    max-width: 95%;
    max-height: 90vh;
    padding: 20px;
  }
}

