/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-6);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  white-space: nowrap;
  user-select: none;
  line-height: 1.5;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.4);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--gray-700);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--white);
}
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(253, 121, 168, 0.4);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--gray-900);
  font-weight: var(--font-bold);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(249, 202, 36, 0.4);
}

.btn-sm { padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }
.btn-lg { padding: var(--space-3) var(--space-8); font-size: var(--text-lg); }
.btn-xl { padding: var(--space-4) var(--space-10); font-size: var(--text-xl); }
.btn-icon { padding: var(--space-2); aspect-ratio: 1; }
.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ===== GAME CARD ===== */
.game-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  border: 1px solid transparent;
}

.game-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-lg), 0 0 25px rgba(108, 92, 231, 0.2);
  border-color: var(--primary);
}

.game-card:active {
  transform: translateY(-2px) scale(0.99);
}

.game-card__image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-tertiary);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.game-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.game-card:hover .game-card__image img {
  transform: scale(1.08);
}

.game-card__play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(2px);
}

.game-card:hover .game-card__play-overlay {
  opacity: 1;
}

.game-card__play-btn {
  width: 52px;
  height: 52px;
  background: var(--primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(108, 92, 231, 0.5);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-card:hover .game-card__play-btn {
  transform: scale(1.15);
}

.game-card__play-btn::after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 9px 0 9px 16px;
  border-color: transparent transparent transparent var(--white);
  margin-left: 3px;
}

.game-card__info {
  padding: var(--space-3);
}

.game-card__title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card__category {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.game-card__badges {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  display: flex;
  gap: var(--space-1);
  z-index: 2;
}

/* ===== GAME CARD META ROW ===== */
.game-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.game-card__meta-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Rating stars in game card */
.game-card__rating {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}

.game-card__star {
  font-size: 11px;
  color: var(--gray-600);
  line-height: 1;
}

.game-card__star.filled {
  color: var(--gold);
}

.game-card__star.half {
  color: var(--gold);
  opacity: 0.6;
}

.game-card__rating-num {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 3px;
  font-weight: var(--font-semibold);
}

/* Play count */
.game-card__plays {
  font-size: 10px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

/* Difficulty badges */
.badge-difficulty {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: var(--font-bold);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

.badge-easy {
  background: rgba(0, 184, 148, 0.2);
  color: #55efc4;
}

.badge-medium {
  background: rgba(253, 203, 110, 0.2);
  color: #ffeaa7;
}

.badge-hard {
  background: rgba(214, 48, 49, 0.2);
  color: #ff7675;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: var(--font-bold);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.3;
  backdrop-filter: blur(4px);
}

.badge-new {
  background: rgba(0, 184, 148, 0.9);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(0, 184, 148, 0.3);
}

.badge-hot {
  background: rgba(214, 48, 49, 0.9);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(214, 48, 49, 0.3);
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(214, 48, 49, 0.3); }
  50% { box-shadow: 0 2px 14px rgba(214, 48, 49, 0.6); }
}

.badge-featured {
  background: rgba(249, 202, 36, 0.9);
  color: var(--gray-900);
  box-shadow: 0 2px 8px rgba(249, 202, 36, 0.3);
}

.badge-category {
  background: rgba(108, 92, 231, 0.9);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

/* ===== MODAL ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.95);
  transition: transform var(--transition-spring);
  box-shadow: var(--shadow-xl);
}

.modal-backdrop.active .modal {
  transform: translateY(0) scale(1);
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.modal__title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
}

.modal__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  transition: all var(--transition-fast);
  font-size: var(--text-xl);
}

.modal__close:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + var(--space-4));
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.toast {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 280px;
  max-width: 400px;
  animation: slideInRight 0.3s var(--transition-spring);
  border-left: 3px solid var(--primary);
}

.toast-success { border-left-color: var(--success); }
.toast-warning { border-left-color: var(--warning); }
.toast-error { border-left-color: var(--danger); }

.toast__icon { font-size: var(--text-xl); }
.toast__message { font-size: var(--text-sm); flex: 1; }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== COIN DISPLAY ===== */
.coin-display {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: linear-gradient(135deg, rgba(249, 202, 36, 0.15), rgba(240, 147, 43, 0.15));
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid rgba(249, 202, 36, 0.3);
}

.coin-icon {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: var(--font-bold);
  color: var(--gray-900);
}

.coin-amount {
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--gold);
}

/* ===== SEARCH INPUT ===== */
.search-input-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: var(--space-2) var(--space-4);
  padding-left: 40px;
  background: var(--bg-card);
  border: 1px solid var(--gray-700);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: all var(--transition-base);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: var(--text-sm);
  pointer-events: none;
}

/* ===== CATEGORY TAG ===== */
.category-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--gray-700);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: all var(--transition-base);
  cursor: pointer;
}

.category-tag:hover,
.category-tag.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.category-tag__count {
  font-size: var(--text-xs);
  opacity: 0.7;
}

/* ===== LOADING ===== */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-700);
  border-top-color: var(--primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== AD CONTAINER ===== */
.ad-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px dashed var(--gray-700);
  border-radius: var(--radius-lg);
  min-height: 90px;
  padding: var(--space-2);
  overflow: hidden;
}

.ad-container--banner { min-height: 90px; }
.ad-container--rectangle { min-height: 250px; max-width: 300px; }
.ad-container--leaderboard { min-height: 90px; max-width: 728px; }

.ad-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ===== RATING STARS ===== */
.rating {
  display: inline-flex;
  gap: 2px;
}

.rating__star {
  color: var(--gray-600);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.rating__star.filled {
  color: var(--gold);
}

.rating__star:hover {
  color: var(--gold-light);
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-card);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width var(--transition-slow);
}
