/* ==========================================================================
   GAMES ARCADE & INTERACTIVE HUB STYLES (games.css)
   Vibrant, playful, kid-appealing, interactive styling for FJ Family Games
   ========================================================================== */

/* Hero Banner */
.games-hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 50% 16%, #28545b 0%, #17363f 100%);
  color: #ffffff;
  padding: clamp(60px, 9vw, 110px) 20px clamp(50px, 7vw, 90px);
  text-align: center;
  border-bottom: 3px solid var(--gold);
}

.games-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.12) 0%, transparent 60%);
  pointer-events: none;
  animation: hero-glow 10s infinite alternate ease-in-out;
}

@keyframes hero-glow {
  0% { transform: translate(-5%, -5%) scale(0.9); }
  100% { transform: translate(5%, 5%) scale(1.1); }
}

.games-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 860px;
  margin: 0 auto;
}

.games-hero .eyebrow {
  color: var(--gold-bright);
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.35);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

.games-hero h1 {
  color: #ffffff;
  font-size: clamp(2.6rem, 5.8vw, 4.4rem);
  margin-bottom: 18px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.games-hero h1 .highlight {
  background: linear-gradient(135deg, var(--gold-bright), #fb923c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.games-hero p {
  color: #e2e8f0;
  font-size: clamp(1.08rem, 2vw, 1.25rem);
  max-width: 640px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.games-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 34px;
}

.hero-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(6px);
  transition: transform 0.2s ease, background 0.2s ease;
}

.hero-pill:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.18);
}

.games-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

/* Featured Games Grid */
.games-showcase-section {
  padding: clamp(50px, 7vw, 90px) 20px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
  margin-top: 40px;
}

.game-card {
  background: #ffffff;
  border: 2px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.game-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(217, 119, 6, 0.18);
  border-color: var(--gold-light);
}

/* Authentic Game Scene Headers with Full Graphics */
.game-card-header {
  position: relative;
  height: 220px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  padding: 12px 16px;
  border-bottom: 2px solid var(--rule);
}

.game-card-header-saints2 {
  background: radial-gradient(circle at 50% 30%, #312e81, #1e1b4b);
}

.game-card-header-catechism {
  background: radial-gradient(circle at 50% 30%, #1e3a8a, #0f172a);
}

.game-card-header-crux1 {
  background: radial-gradient(circle at 50% 30%, #7c2d12, #1c1917);
}

.game-card-header-maze {
  background: radial-gradient(circle at 50% 30%, #065f46, #022c22);
}

.game-scene-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
}

.game-hero-figure {
  max-height: 195px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
}

.game-card:hover .game-hero-figure {
  transform: scale(1.06) translateY(-4px);
}

.game-companion-figure {
  max-height: 155px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.45));
  opacity: 0.95;
  transition: transform 0.35s ease;
  z-index: 1;
}

.game-card:hover .game-companion-figure {
  transform: scale(1.04);
}

.game-card-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
}

.game-card-body {
  padding: 28px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.game-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.game-card h3 {
  font-size: 1.55rem;
  margin: 0;
}

.game-card-desc {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 20px;
  flex: 1;
}

.game-features-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.feature-chip {
  background: var(--paper-soft);
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.game-card-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.game-doc-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.55rem 0.8rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.game-doc-link:hover { color: var(--terracotta); }

.game-card-actions .btn {
  flex: 1;
}

/* Mini-Game Widget: Daily Saint & Virtue Quest */
.quest-section {
  background: linear-gradient(135deg, #fef3c7, #fed7aa);
  border: 2px solid var(--gold-light);
  border-radius: var(--radius-lg);
  padding: clamp(36px, 6vw, 60px) 24px;
  margin: 50px auto;
  max-width: var(--maxw);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.quest-section::after {
  content: '✨';
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 4rem;
  opacity: 0.18;
  pointer-events: none;
}

.quest-inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.quest-card-display {
  background: #ffffff;
  border: 2px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  margin: 28px auto;
  max-width: 520px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.quest-saint-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  overflow: hidden;
  margin-bottom: 14px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.quest-saint-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.quest-virtue-badge {
  background: var(--gold-bright);
  color: #1e293b;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
  display: inline-block;
}

.quest-task-text {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.quest-scripture {
  font-size: 0.88rem;
  font-style: italic;
  color: var(--ink-light);
  margin-bottom: 18px;
}

.quest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* Family Trophy Shelf */
.trophy-section {
  background: #ffffff;
  border: 2px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: clamp(36px, 6vw, 60px) 24px;
  margin: 50px auto;
  max-width: var(--maxw);
  box-shadow: var(--shadow-sm);
}

.trophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 18px;
  margin-top: 30px;
}

.trophy-badge-card {
  border-radius: var(--radius-md);
  padding: 20px 14px;
  text-align: center;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.trophy-badge-card.unlocked {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 2px solid var(--gold);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.2);
}

.trophy-badge-card.locked {
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  opacity: 0.6;
}

.trophy-badge-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.trophy-badge-name {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--ink);
  margin-bottom: 4px;
}

.trophy-badge-status {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
}

.trophy-badge-card.locked .trophy-badge-status {
  color: #94a3b8;
}

/* Living Saint Roster / Hero Gallery */
.roster-section {
  padding: clamp(60px, 8vw, 100px) 20px;
}

.roster-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 36px;
  background: #ffffff;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--rule);
  box-shadow: var(--shadow-sm);
}

.roster-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  background: transparent;
  border: 1.5px solid var(--rule);
  color: var(--ink-soft);
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  border-color: var(--gold);
  color: var(--ink);
}

.filter-btn.active {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.roster-search {
  position: relative;
  min-width: 240px;
}

.roster-search input {
  width: 100%;
  padding: 8px 16px 8px 36px;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.roster-search input:focus {
  border-color: var(--gold);
}

.roster-search::before {
  content: '🔍';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  pointer-events: none;
}

.saints-living-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.saint-living-card {
  background: #ffffff;
  border: 2px solid var(--rule);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
}

.saint-living-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--gold);
  box-shadow: var(--shadow-md), 0 0 16px rgba(245, 158, 11, 0.25);
}

.saint-living-frame {
  aspect-ratio: 1/1;
  background: radial-gradient(circle, #f8fafc 0%, #e2e8f0 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.saint-living-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s ease;
}

.saint-living-card:hover .saint-living-frame img {
  transform: scale(1.08);
}

.saint-type-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  backdrop-filter: blur(4px);
  text-transform: uppercase;
  z-index: 2;
}

.saint-living-info {
  padding: 16px;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.saint-living-info h4 {
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.saint-living-info .saint-patron {
  color: var(--terracotta);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.saint-living-info .saint-power-tag {
  background: var(--paper-soft);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  display: inline-block;
}

/* Modal / Codex Popup */
.codex-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.codex-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.codex-card {
  background: #ffffff;
  border: 3px solid var(--gold);
  border-radius: var(--radius-lg);
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  position: relative;
  padding: 32px 28px;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.codex-modal.active .codex-card {
  transform: scale(1);
}

.codex-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: var(--paper-soft);
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.codex-close-btn:hover {
  background: var(--terracotta);
  color: #fff;
  transform: rotate(90deg);
}

/* Hero Showcase Frame inside Codex */
.codex-hero-showcase {
  background: radial-gradient(circle at 50% 40%, #1e293b, #0f172a);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 200px;
  border: 2px solid var(--gold-light);
}

.codex-full-art {
  max-height: 210px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.6));
}

.codex-face-thumb {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.codex-face-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.codex-header {
  text-align: center;
  margin-bottom: 20px;
}

.codex-header h3 {
  font-size: 1.75rem;
  margin-bottom: 6px;
}

.codex-patron {
  color: var(--terracotta);
  font-weight: 800;
  font-size: 0.95rem;
}

.codex-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: var(--paper);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.codex-stat-box h5 {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 2px;
}

.codex-stat-box p {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  margin: 0;
}

.codex-bio {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 20px;
}

.codex-quote {
  border-left: 3px solid var(--gold);
  padding-left: 14px;
  font-style: italic;
  color: var(--ink);
  font-size: 0.94rem;
  margin-bottom: 20px;
}

.codex-voice-btn {
  background: var(--gold-subtle);
  border: 1.5px solid var(--gold);
  color: var(--ink);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  margin-bottom: 20px;
}

.codex-voice-btn:hover {
  background: var(--gold);
  color: #fff;
  transform: scale(1.04);
}

/* Confetti Canvas */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10000;
}

/* Mobile Adjustments */
@media (max-width: 640px) {
  .games-grid {
    grid-template-columns: 1fr;
  }
  .saints-living-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .roster-controls {
    flex-direction: column;
    align-items: stretch;
  }
}
