/* ==========================================================================
   Portal Cards Shared Layout Rules
   ========================================================================== */

.games-section {
  position: relative;
  padding-top: 1.5rem;
  padding-bottom: 3.5rem;
}

.games-section .section-header {
  margin-bottom: 2rem;
}

.portal-card-container {
  max-width: 700px;
  margin: 0 auto;
}

/* Base structural container for game portals */
.portal-card {
  position: relative;
  border-radius: var(--border-radius-lg);
  padding: 4.5rem 2rem;
  text-align: center;
  border: 1px solid transparent; /* Overridden by specific games */
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.portal-content {
  position: relative;
  z-index: 2;
}

/* Base Typography for Portal Titles */
.portal-title {
  font-family: var(--font-title);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.portal-caption {
  font-size: 1.15rem;
  color: var(--text-primary);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 2.75rem;
  font-weight: 600;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

.portal-btn-wrapper {
  display: flex;
  justify-content: center;
}

/* Base Button styles */
.portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 3.25rem;
  font-family: var(--font-title);
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: 2px solid transparent;
  border-radius: var(--border-radius-pill);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, background-color 0.2s ease;
  min-height: 52px; /* Touch target optimized */
}

/* Base Corner Art Layout */
.portal-card .corner-art {
  position: absolute;
  width: 220px;
  height: 220px;
  opacity: 0.6;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.portal-card:hover .corner-art {
  opacity: 0.9;
}

.portal-card .corner-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Mobile Adjustments for Corner Art */
@media (max-width: 640px) {
  .portal-card .corner-art {
    width: 140px;
    height: 140px;
  }
}

.portal-btn:hover,
.portal-btn:focus-visible {
  transform: translateY(-2px);
}

/* Reduced Motion Override for Battery & Accessibility */
@media (prefers-reduced-motion: reduce) {
  .portal-card:hover,
  .portal-btn:hover {
    transform: none;
  }
}

/* Mobile Adjustments */
@media (max-width: 640px) {
  .portal-card {
    padding: 3rem 1.5rem;
  }
  
  .portal-caption {
    margin-bottom: 2.25rem;
  }
  
  .portal-btn {
    width: 100%;
  }
}

/* ==========================================================================
   Casual Companion Games Section Layout
   ========================================================================== */

.casual-games-section {
  margin-top: 5rem;
  padding-top: 4rem;
  border-top: 1px solid var(--border-color);
}

.casual-games-section .subheader-title {
  font-family: var(--font-title);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.casual-games-section .subheader-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

.portal-badge-wrapper {
  margin-bottom: 0.85rem;
}

.portal-game-description {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 2.25rem auto 0;
  max-width: 500px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

/* Mobile Adjustments for game descriptions */
@media (max-width: 640px) {
  .portal-game-description {
    font-size: 0.9rem;
    margin-top: 1.75rem;
  }
}

/* ==========================================================================
   Enjoyed Counter Badges
   ========================================================================== */

.enjoyed-counter {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
  transition: opacity var(--transition-normal);
  cursor: help;
  position: absolute;
  left: 0;
  width: 100%;
  text-align: center;
  bottom: -3rem;
}

@media (max-width: 640px) {
  .enjoyed-counter {
    bottom: -2rem;
  }
}

.enjoyed-counter:hover {
  opacity: 1;
}

.enjoyed-counter .count {
  font-weight: 700;
  color: var(--text-primary);
}

