/* games.css - Premium 2026 Redesign from Scratch (Linear & Apple-style Dark UI) */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --font-primary: 'Outfit', sans-serif;

  /* Premium Color System */
  --bg-main: #030508;
  --bg-surface: rgba(13, 17, 26, 0.45);
  --bg-surface-hover: rgba(20, 26, 38, 0.65);
  --border-color: rgba(255, 255, 255, 0.05);
  --border-color-hover: rgba(255, 255, 255, 0.15);
  
  /* Text System */
  --text-title: #f8fafc;
  --text-body: #cbd5e1;
  --text-muted: #64748b;

  /* Accent Tones */
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-green: #10b981;
  
  /* Glowing drop-shadows */
  --glow-cyan: rgba(6, 182, 212, 0.15);
  --glow-purple: rgba(139, 92, 246, 0.15);

  /* Metallic Ranking Accents */
  --color-gold: #fbbf24;
  --color-silver: #e2e8f0;
  --color-bronze: #f97316;
  
  --glow-gold: rgba(251, 191, 36, 0.15);
  --glow-silver: rgba(226, 232, 240, 0.12);
  --glow-bronze: rgba(249, 115, 22, 0.12);
}

/* Global Styles */
body {
  margin: 0;
  padding: 0;
  background-color: transparent;
  color: var(--text-body);
  font-family: var(--font-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  box-sizing: border-box;
  position: relative;
}

/* Digital grid mesh overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background-image: 
    linear-gradient(0deg, transparent 24%, rgba(6, 182, 212, 0.008) 25%, rgba(6, 182, 212, 0.008) 26%, transparent 27%, transparent 74%, rgba(6, 182, 212, 0.008) 75%, rgba(6, 182, 212, 0.008) 76%, transparent 77%),
    linear-gradient(90deg, transparent 24%, rgba(6, 182, 212, 0.008) 25%, rgba(6, 182, 212, 0.008) 26%, transparent 27%, transparent 74%, rgba(6, 182, 212, 0.008) 75%, rgba(6, 182, 212, 0.008) 76%, transparent 77%);
  background-size: 56px 56px;
  pointer-events: none;
}

/* GPU Accelerated XMB Canvas Styling */
#xmb-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -10;
  pointer-events: none;
  filter: blur(5px);
  transform: scale(1.02) translate3d(0, 0, 0);
  will-change: transform;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  border: 2px solid var(--bg-main);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ==========================================
   STICKY NAV HEADER SYSTEM
   ========================================== */
.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 100;
  background: rgba(3, 5, 8, 0.65);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  box-sizing: border-box;
}

.header-left, .header-right {
  flex: 1;
  display: flex;
  align-items: center;
}

.header-left {
  justify-content: flex-start;
}

.header-right {
  justify-content: flex-end;
}

/* Header title section */
.header-title-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.header-title-section h1 {
  margin: 0;
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.stats-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 3px 10px;
  border-radius: 20px;
  margin-top: 4px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  letter-spacing: 0.02em;
}

.stats-badge span {
  color: var(--text-body);
}

/* Navigation Buttons */
/* Navigation Buttons & Segmented Tabs */
.back-btn {
  text-decoration: none;
  color: var(--text-body);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 18px;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  outline: none;
}

.icon-back {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.back-btn:hover {
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-title);
  background: rgba(255, 255, 255, 0.05);
}

.back-btn:hover .icon-back {
  transform: translateX(-3px);
}

.navigation-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 4px;
  border-radius: 9999px;
  position: relative;
  gap: 2px;
  z-index: 10;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 2;
  font-family: var(--font-primary);
  outline: none;
}

.tab-btn svg {
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.tab-btn:hover {
  color: var(--text-title);
}

.tab-btn:hover svg {
  opacity: 1;
}

.tab-btn.active {
  color: #ffffff;
}

.tab-btn.active svg {
  opacity: 1;
  color: var(--accent-cyan);
}

/* Sliding active pill indicator background */
.navigation-tabs::before {
  content: '';
  position: absolute;
  top: 4px;
  left: var(--active-left, 4px);
  width: var(--active-width, 80px);
  height: calc(100% - 8px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ==========================================
   CINEMATIC HERO BANNER SYSTEM
   ========================================== */
.hero-banner {
  width: 100%;
  max-width: 1200px;
  margin: 30px auto 20px auto;
  padding: 0 24px;
  box-sizing: border-box;
  perspective: 1000px;
  display: none; /* Controlled via JS based on active tab */
}

.hero-banner-inner {
  position: relative;
  width: 100%;
  height: 380px;
  border-radius: 28px;
  overflow: hidden;
  background-color: #05080c;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px 60px;
  box-sizing: border-box;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

/* Shine sweep on hover */
.hero-banner-inner::after {
  content: '';
  position: absolute;
  top: 0;
  left: -80%;
  width: 60%;
  height: 100%;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.06) 50%, transparent 60%);
  transform: skewX(-20deg);
  pointer-events: none;
  transition: left 0s;
  z-index: 10;
}

.hero-banner-inner:hover {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 40px rgba(99, 102, 241, 0.18);
}

.hero-banner-inner:hover::after {
  animation: heroBannerShine 0.6s ease forwards;
}

@keyframes heroBannerShine {
  from { left: -80%; }
  to   { left: 130%; }
}

/* Widescreen Double Background Layers for Crossfade */
.hero-bg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center 25%;
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 0.1s ease-out;
  opacity: 0;
  transform: scale(1.05);
  z-index: 0;
  pointer-events: none;
}

.hero-bg-layer.active {
  opacity: 0.28;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #030508 25%, rgba(3, 5, 8, 0.85) 50%, rgba(3, 5, 8, 0.2) 100%);
  z-index: 1;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 550px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  transform: translateZ(30px);
}

.hero-badge {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  padding: 4px 12px;
  border-radius: 9999px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

.hero-title {
  font-size: clamp(28px, 4.5vw, 42px);
  font-weight: 900;
  line-height: 1.15;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  opacity: 1;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-meta {
  display: flex;
  gap: 16px;
  align-items: center;
}

.hero-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-body);
}

.hero-meta-item svg {
  color: var(--accent-cyan);
}

.hero-tagline {
  font-size: 15px;
  color: var(--text-body);
  line-height: 1.5;
  margin: 0;
  opacity: 0.85;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.hero-btn {
  padding: 10px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  gap: 8px;
}

.hero-thumbnail {
  position: relative;
  z-index: 2;
  width: 170px;
  height: 255px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  transition: box-shadow 0.3s ease;
}

.hero-banner-inner:hover .hero-thumbnail {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 20px rgba(99, 102, 241, 0.15);
}

.hero-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================
   PRESTIGIOUS 3D PODIUM / THRONE ROOM
   ========================================== */
.throne-room {
  width: 100%;
  max-width: 1200px;
  margin: 40px auto 60px auto;
  display: none; /* Controlled via JS */
  flex-direction: column;
  padding: 0 24px;
  box-sizing: border-box;
}

.podium-wrapper {
  position: relative;
  width: 100%;
  background: radial-gradient(circle at 50% 100%, rgba(251, 191, 36, 0.03), transparent 75%),
              linear-gradient(180deg, rgba(255, 255, 255, 0.01) 0%, rgba(0, 0, 0, 0.2) 100%);
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  /* Update padding to remove the bottom 40px gap */
  padding: 30px 20px 0 20px;
  box-sizing: border-box;
  overflow: visible;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

/* Ambient Spotlight Beams */
.podium-spotlight {
  position: absolute;
  top: -10%;
  width: 160px;
  height: 600px;
  pointer-events: none;
  z-index: 0;
  transform-origin: top center;
  mix-blend-mode: screen;
  opacity: 0;
}

.spotlight-left {
  left: 15%;
  background: linear-gradient(180deg, rgba(226, 232, 240, 0.08) 0%, rgba(226, 232, 240, 0) 80%);
  transform: rotate(-15deg);
  animation: swingLeft 12s ease-in-out infinite alternate;
}

.spotlight-center {
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.1) 0%, rgba(251, 191, 36, 0) 80%);
  animation: pulseCenter 6s ease-in-out infinite alternate;
}

.spotlight-right {
  right: 15%;
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.08) 0%, rgba(249, 115, 22, 0) 80%);
  transform: rotate(15deg);
  animation: swingRight 12s ease-in-out infinite alternate;
}

@keyframes swingLeft {
  0% { transform: rotate(-18deg); }
  100% { transform: rotate(-8deg); }
}

@keyframes swingRight {
  0% { transform: rotate(8deg); }
  100% { transform: rotate(18deg); }
}

@keyframes pulseCenter {
  0% { opacity: 0.4; transform: translateX(-50%) scaleX(0.8); }
  100% { opacity: 0.9; transform: translateX(-50%) scaleX(1.1); }
}

.podium-columns {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.podium-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: none;
}

.podium-column.rank-1 {
  width: 200px;
}

.podium-column.rank-2,
.podium-column.rank-3 {
  width: 175px;
}

/* Winner Crown element above Rank 1 */
.winner-crown-wrapper {
  position: absolute;
  top: -45px;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transform: translateY(-10px) scale(0.8);
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.6));
}

.winner-crown {
  width: 32px;
  height: 32px;
  color: var(--color-gold);
  animation: crownBob 3s ease-in-out infinite alternate;
}

@keyframes crownBob {
  0% { transform: translateY(0) rotate(-3deg); }
  100% { transform: translateY(-6px) rotate(3deg); }
}

/* Pedestals */
.pedestal {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08),
              0 15px 45px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(100%);
  transform-origin: bottom center;
}

.gold-pedestal {
  height: 180px; /* Increased from 140px */
  border-color: rgba(251, 191, 36, 0.2);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.08) 0%, rgba(3, 5, 8, 0.6) 100%);
}

.silver-pedestal {
  height: 135px; /* Increased from 95px */
  border-color: rgba(226, 232, 240, 0.12);
  background: linear-gradient(180deg, rgba(226, 232, 240, 0.05) 0%, rgba(3, 5, 8, 0.6) 100%);
}

.bronze-pedestal {
  height: 105px; /* Increased from 65px */
  border-color: rgba(249, 115, 22, 0.12);
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.05) 0%, rgba(3, 5, 8, 0.6) 100%);
}

.pedestal-number {
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
  margin-top: 10px;
  font-family: var(--font-primary);
}

.gold-pedestal .pedestal-number {
  color: var(--color-gold);
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

.silver-pedestal .pedestal-number {
  color: var(--color-silver);
  text-shadow: 0 0 15px rgba(226, 232, 240, 0.25);
}

.bronze-pedestal .pedestal-number {
  color: var(--color-bronze);
  text-shadow: 0 0 15px rgba(249, 115, 22, 0.25);
}

.pedestal-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-top: 2px;
}

.pedestal-glow {
  position: absolute;
  bottom: 0;
  width: 120%;
  height: 50%;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  filter: blur(15px);
  opacity: 0;
}

.gold-pedestal .pedestal-glow {
  background: radial-gradient(circle, rgba(251, 191, 36, 0.25) 0%, transparent 70%);
}

.silver-pedestal .pedestal-glow {
  background: radial-gradient(circle, rgba(226, 232, 240, 0.15) 0%, transparent 70%);
}

.bronze-pedestal .pedestal-glow {
  background: radial-gradient(circle, rgba(249, 115, 22, 0.15) 0%, transparent 70%);
}

/* Floating sparkles inside Gold Pedestal area */
.gold-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.gold-particles span {
  position: absolute;
  bottom: -10px;
  width: 4px;
  height: 4px;
  background: #fbbf24;
  border-radius: 50%;
  opacity: 0;
  filter: drop-shadow(0 0 4px #fbbf24);
}

/* Staggered Floating Sparkles (animated via JS classes when lighting activates) */
.throne-room.lit-up .gold-particles span {
  animation: floatUp 4s linear infinite;
}

.gold-particles .p1 { left: 20%; animation-delay: 0s; animation-duration: 3.5s; }
.gold-particles .p2 { left: 45%; animation-delay: 1.2s; animation-duration: 4.5s; }
.gold-particles .p3 { left: 70%; animation-delay: 0.6s; animation-duration: 3.8s; }
.gold-particles .p4 { left: 85%; animation-delay: 2.2s; animation-duration: 4.2s; }
.gold-particles .p5 { left: 30%; animation-delay: 1.8s; animation-duration: 4.0s; }

@keyframes floatUp {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  15% { opacity: 0.9; }
  85% { opacity: 0.9; }
  100% { transform: translateY(-130px) scale(0); opacity: 0; }
}

/* Throne Cards Redesign */
.throne-card {
  width: 100%;
  background: linear-gradient(180deg, rgba(13, 17, 26, 0.5) 0%, rgba(6, 8, 12, 0.85) 100%);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  z-index: 2;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  margin-bottom: -6px; /* Sits perfectly on the pedestal */
  opacity: 0;
  transform: translateY(30px) scale(0.9);
}

.throne-card.gold-rank {
  border-color: rgba(251, 191, 36, 0.2);
}

.throne-card.silver-rank {
  border-color: rgba(226, 232, 240, 0.15);
}

.throne-card.bronze-rank {
  border-color: rgba(249, 115, 22, 0.15);
}

/* Hover effects */
.throne-card:hover {
  transform: translateY(-8px) scale(1.02);
  z-index: 5;
}

.throne-card.gold-rank:hover {
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 25px rgba(251, 191, 36, 0.2);
}

.throne-card.silver-rank:hover {
  border-color: rgba(226, 232, 240, 0.4);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(226, 232, 240, 0.15);
}

.throne-card.bronze-rank:hover {
  border-color: rgba(249, 115, 22, 0.4);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(249, 115, 22, 0.15);
}

.throne-cover-wrapper {
  position: relative;
  width: calc(100% - 16px);
  aspect-ratio: 2/3;
  overflow: hidden;
  background-color: #0b0c10;
  border-radius: 14px;
  margin: 8px 8px 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.throne-cover-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.throne-card:hover .throne-cover-wrapper img {
  transform: scale(1.04);
}

.throne-rank-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  font-weight: 800;
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 9999px;
  z-index: 5;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.gold-rank .throne-rank-badge {
  background: rgba(251, 191, 36, 0.15);
  color: var(--color-gold);
  border-color: rgba(251, 191, 36, 0.3);
}

.silver-rank .throne-rank-badge {
  background: rgba(226, 232, 240, 0.1);
  color: var(--color-silver);
  border-color: rgba(226, 232, 240, 0.2);
}

.bronze-rank .throne-rank-badge {
  background: rgba(249, 115, 22, 0.1);
  color: var(--color-bronze);
  border-color: rgba(249, 115, 22, 0.25);
}

.throne-card-details {
  padding: 16px;
  background: rgba(6, 8, 12, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.02);
}

.throne-card-details h2 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: var(--text-title);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Playtime & Progress */
.throne-playtime-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.throne-playtime {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-body);
}

.throne-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 99px;
  overflow: hidden;
}

.throne-progress-fill {
  height: 100%;
  border-radius: 99px;
}

.gold-rank .throne-progress-fill { background: var(--color-gold); }
.silver-rank .throne-progress-fill { background: var(--color-silver); }
.bronze-rank .throne-progress-fill { background: var(--color-bronze); }

/* Custom Metadata Presentation Grid */
.throne-meta-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 12px;
}

.throne-meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 6px 2px;
  border-radius: 8px;
}

.throne-meta-item svg {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.meta-value {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-title);
  line-height: 1;
}

.meta-value.text-accent {
  color: var(--accent-cyan);
}

.gold-rank .meta-value.text-accent {
  color: var(--color-gold);
}

.meta-label {
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

/* Staged Ceremony Timing (CSS animations triggered via delay on load) */
@keyframes pedestalRise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes goldCardPopIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1.05); /* Dominant size */
  }
}

@keyframes spotlightReveal {
  to {
    opacity: 1;
  }
}

@keyframes glowFadeIn {
  to {
    opacity: 1;
  }
}

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

/* Ceremony animations mapping */
.pedestal {
  animation: pedestalRise 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.2s;
}

.rank-3 .throne-card {
  animation: cardPopIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: 1.0s;
}

.rank-2 .throne-card {
  animation: cardPopIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: 1.4s;
}

.rank-1 .throne-card {
  animation: goldCardPopIn 1.0s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: 1.8s;
}

.winner-crown-wrapper {
  animation: crownReveal 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: 2.2s;
}

.podium-spotlight {
  animation: spotlightReveal 1.5s ease both;
  animation-delay: 2.2s;
}

.pedestal-glow {
  animation: glowFadeIn 1.5s ease both;
  animation-delay: 2.4s;
}

/* Golden Winner Shine sweep sweep */
@keyframes goldShineSweep {
  0% { left: -150%; }
  40% { left: 150%; }
  100% { left: 150%; }
}

.throne-card.gold-rank::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(251, 191, 36, 0.15), transparent);
  transform: skewX(-25deg);
  pointer-events: none;
  animation: goldShineSweep 5s ease-in-out infinite;
  animation-delay: 3s;
}

/* Gold card pulsing glow */
@keyframes goldGlowPulse {
  0% {
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5), 0 0 15px rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.2);
  }
  50% {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(251, 191, 36, 0.35);
    border-color: rgba(251, 191, 36, 0.5);
  }
  100% {
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5), 0 0 15px rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.2);
  }
}

.throne-room.lit-up .throne-card.gold-rank {
  opacity: 1;
  transform: translateY(0) scale(1.05);
  animation: goldGlowPulse 4s ease-in-out infinite alternate;
}

/* ==========================================
   GAME GRID & CARDS
   ========================================== */
.game-list {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
  width: 100%;
}

.game-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.01) 100%);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Card sheen sweep overlay on hover */
.game-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.05), transparent);
  transform: skewX(-25deg);
  transition: none;
  pointer-events: none;
}

.game-card:hover::after {
  left: 125%;
  transition: all 0.75s ease-in-out;
}

.game-card:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

/* Specific glows for favorites */
.game-card:has(.fav-badge):hover {
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(139, 92, 246, 0.15);
}

.game-card:has(.rank-badge):hover {
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(6, 182, 212, 0.15);
}

/* Nested Cover Image Layout */
.game-card .cover-wrapper {
  position: relative;
  width: calc(100% - 16px);
  aspect-ratio: 2/3;
  overflow: hidden;
  background-color: #0b0c10;
  border-radius: 14px;
  margin: 8px 8px 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.game-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.game-card-details {
  padding: 16px;
  background: rgba(6, 8, 12, 0.15);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}

.game-card-details h2 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: var(--text-title);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 35px;
}

.game-card-details .playtime {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin: 0;
  letter-spacing: 0.01em;
  transition: color 0.3s ease;
}

.game-card:hover .playtime {
  color: var(--accent-cyan);
}

.game-card:has(.fav-badge):hover .playtime {
  color: var(--accent-purple);
}

/* Shimmer Loading Skeleton */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer-loader {
  background: linear-gradient(90deg, #090b11 25%, #151a26 37%, #090b11 63%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
}

/* Badges for grid items */
.rank-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(3, 5, 8, 0.7);
  color: var(--accent-cyan);
  font-weight: 800;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 9999px;
  z-index: 5;
  border: 1px solid rgba(6, 182, 212, 0.3);
  backdrop-filter: blur(4px);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.1);
  letter-spacing: 0.02em;
}

.fav-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(3, 5, 8, 0.7);
  color: var(--accent-purple);
  font-weight: 800;
  font-size: 10px;
  padding: 4px 9px;
  border-radius: 9999px;
  z-index: 5;
  border: 1px solid rgba(139, 92, 246, 0.3);
  backdrop-filter: blur(4px);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.1);
}

#loading {
  margin: 60px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}

.no-results {
  text-align: center;
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 80px;
  font-weight: 500;
}

/* ==========================================
   COLLAPSIBLE DRAWER ACCORDIONS (DETAILS/SUMMARY)
   ========================================== */
details.franchise-section {
  width: 100%;
  margin-bottom: 24px;
  border-radius: 20px;
  background: rgba(13, 17, 26, 0.2);
  border: 1px solid var(--border-color);
  padding: 18px 24px;
  box-sizing: border-box;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

details.franchise-section[open] {
  background: rgba(13, 17, 26, 0.4);
  border-color: rgba(255, 255, 255, 0.1);
}

summary.franchise-header {
  font-size: 18px;
  color: var(--text-title);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  outline: none;
  user-select: none;
}

summary.franchise-header::-webkit-details-marker {
  display: none;
}

details.franchise-section[open] summary.franchise-header {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 20px;
}

summary.franchise-header:hover {
  color: var(--accent-cyan);
}

.franchise-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.franchise-header-content::before {
  content: '✦';
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 5px var(--accent-cyan));
  font-size: 14px;
}

.franchise-name {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.franchise-count {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-weight: 600;
}

.dropdown-arrow {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

details[open] .dropdown-arrow {
  transform: rotate(180deg);
  color: var(--accent-cyan);
}

details .franchise-grid {
  opacity: 0;
  transform: translateY(-8px);
}

details[open] .franchise-grid {
  animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDown {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   DETAILS MODAL
   ========================================== */
dialog {
  border: none;
  border-radius: 28px;
  background: rgba(10, 13, 20, 0.97);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.9), 0 0 40px rgba(255, 255, 255, 0.02);
  color: var(--text-body);
  padding: 0;
  max-width: 90vw;
  outline: none;
  font-family: var(--font-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative; /* so close-btn absolute positioning is relative to dialog */
  
  opacity: 0;
  transform: scale(0.97);
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.35s;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  transition-behavior: allow-discrete;
}

dialog[open] {
  opacity: 1;
  transform: scale(1);
}

@starting-style {
  dialog[open] {
    opacity: 0;
    transform: scale(0.97);
  }
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0);
  transition: display 0.35s allow-discrete, overlay 0.35s allow-discrete, background-color 0.35s ease;
  backdrop-filter: blur(0px);
  pointer-events: none; /* never block clicks on the dialog content */
}

dialog[open]::backdrop {
  background-color: rgba(2, 3, 5, 0.85);
  backdrop-filter: blur(16px);
  pointer-events: auto; /* allow backdrop clicks to close modal via JS */
}

@starting-style {
  dialog[open]::backdrop {
    background-color: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
  }
}

#game-detail-dialog {
  width: min(650px, 92%);
}

.modal-content {
  padding: 32px;
}

.close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-body);
  font-size: 20px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100; /* high enough to beat any stacking context inside modal */
  line-height: 0;
  pointer-events: auto;
}

.close-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
  transform: rotate(90deg);
}

.modal-body {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.modal-cover-wrapper {
  flex-shrink: 0;
  width: 180px;
  height: 270px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-cover-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-details {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.modal-header-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding-right: 48px;
}

.modal-details h2 {
  font-size: clamp(20px, 3.5vw, 26px);
  margin: 0;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-title);
  letter-spacing: -0.02em;
}

.favorite-badge {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
}

.stat-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.01);
  padding: 14px 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent-green);
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-btn {
  flex: 1;
  padding: 12px 20px;
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
}

.steam-btn {
  background: linear-gradient(135deg, #107cbb, #034b75);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 124, 187, 0.2);
}

.steam-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 124, 187, 0.35);
}

#modal-review-link.review-btn {
  width: auto;
  margin-top: 0;
  flex-grow: 1;
}

#modal-review-link.review-btn.active {
  background: linear-gradient(135deg, #4f46e5, var(--accent-purple));
  color: white;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

#modal-review-link.review-btn.active:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.35);
}

#modal-review-link.review-btn.disabled {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.02);
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================
   RESPONSIVE LAYOUT MEDIA QUERIES
   ========================================== */

@media (max-width: 900px) {
  /* Keep podium columns side-by-side but reduce scale, gaps and padding */
  .podium-wrapper {
    padding: 30px 8px 0 8px;
    border-radius: 20px;
  }
  .podium-columns {
    gap: 8px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
  }
  .podium-column {
    flex: 1;
  }
  .podium-column.rank-1 {
    width: 36%;
  }
  .podium-column.rank-2,
  .podium-column.rank-3 {
    width: 30%;
  }
  .throne-card-details h2 {
    font-size: 11px;
    margin-bottom: 6px;
  }
  .throne-playtime {
    font-size: 10px;
  }
  .throne-progress-bar {
    height: 3px;
  }
  .throne-meta-stats {
    padding-top: 6px;
    gap: 3px;
  }
  .throne-meta-item {
    padding: 4px 1px;
    border-radius: 4px;
  }
  .meta-value {
    font-size: 9px;
  }
  .meta-label {
    font-size: 6px;
  }
  .throne-rank-badge {
    padding: 2px 6px;
    font-size: 8px;
    top: 10px;
    left: 10px;
  }
  .winner-crown-wrapper {
    top: -35px;
  }
  .winner-crown {
    width: 24px;
    height: 24px;
  }
  .gold-pedestal { height: 105px; }
  .silver-pedestal { height: 75px; }
  .bronze-pedestal { height: 55px; }
  .pedestal-number {
    font-size: 32px;
    margin-top: 5px;
  }
  .pedestal-label {
    font-size: 8px;
  }

  .header-container {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }

  .header-left, .header-right {
    flex: none;
    width: 100%;
    justify-content: center;
  }

  .navigation-tabs {
    width: 100%;
    justify-content: center;
  }

  .tab-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
    font-size: 12px;
  }

  /* Hero banner on mobile */
  .hero-banner-inner {
    height: auto;
    flex-direction: column-reverse;
    padding: 24px;
    gap: 16px;
    align-items: center;
    text-align: center;
  }
  .hero-content {
    align-items: center;
    max-width: 100%;
  }
  .hero-title {
    font-size: 24px;
  }
  .hero-thumbnail {
    width: 110px;
    height: 165px;
    transform: none !important;
  }
  .hero-overlay {
    background: linear-gradient(180deg, rgba(3, 5, 8, 0.4) 0%, #030508 100%);
  }
}

@media (max-width: 480px) {
  .podium-columns {
    gap: 6px;
  }
  .throne-meta-stats {
    display: none; /* Hide meta stats on extremely small screens */
  }
  .pedestal-number {
    font-size: 24px;
  }
  .gold-pedestal { height: 80px; }
  .silver-pedestal { height: 55px; }
  .bronze-pedestal { height: 40px; }
  .throne-rank-badge span {
    display: none; /* Hide text, just show icon to save space */
  }
  .throne-rank-badge {
    padding: 4px;
  }
}

@media (max-width: 680px) {
  .modal-body {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
  }
  
  .modal-cover-wrapper {
    width: 140px;
    height: 210px;
  }
  
  .modal-header-row {
    flex-direction: column;
    align-items: center;
    padding-right: 0;
  }
  
  .modal-actions {
    flex-direction: column;
    width: 100%;
  }
}

/* ==========================================
   CONTENT AREA TRANSITIONS & CUSTOM DIALOGS
   ========================================== */
.content-area {
  width: 100%;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease;
  will-change: opacity, transform, filter;
}

.content-area.exiting {
  opacity: 0;
  filter: blur(4px);
}

.content-area.exiting.slide-left {
  transform: translateX(-40px) scale(0.98);
}

.content-area.exiting.slide-right {
  transform: translateX(40px) scale(0.98);
}

.content-area.entering {
  animation: tabEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tabEntrance {
  from {
    opacity: 0;
    filter: blur(4px);
    transform: translateX(var(--slide-dir, 40px)) scale(0.98);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateX(0) scale(1);
  }
}

/* Collection modal animations */
dialog#collection-dialog[open] {
  animation: collectionModalEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes collectionModalEnter {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(40px);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

dialog#collection-dialog.exiting {
  animation: dialogExit 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dialogExit {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.85) translateY(40px);
    filter: blur(8px);
  }
}

/* ==========================================
   SCROLL-DRIVEN & TRANSITION ANIMATIONS
   ========================================== */

/* Native CSS Scroll animations for browsers that support it */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    .game-card, .collection-container {
      animation: revealUp auto linear backwards;
      animation-timeline: view();
      animation-range: entry 5% cover 25%;
    }
  }
}

/* Fallback transitions using JS IntersectionObserver toggled .in-view class */
@supports not ((animation-timeline: view()) and (animation-range: entry)) {
  .game-card, .collection-container {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  }
  
  .game-card.in-view, .throne-card.in-view, .collection-container.in-view {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================
   STAGGERED CARD ENTRANCES
   ========================================== */
@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Global staggered card entrance — throne-cards skip this (they use ceremony keyframes instead) */
.game-card, .collection-container {
  animation: cardEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--card-index, 0) * 30ms);
}

/* ==========================================
   SKELETON SHIMMER LOADERS
   ========================================== */
.game-card.skeleton {
  pointer-events: none;
  background: rgba(13, 17, 26, 0.2);
  border-color: rgba(255, 255, 255, 0.03);
}

.game-card.skeleton .cover-wrapper {
  background: rgba(255, 255, 255, 0.01);
}

.skeleton-line {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.02) 25%, rgba(255, 255, 255, 0.06) 37%, rgba(255, 255, 255, 0.02) 63%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 4px;
}

.skeleton-line.title-line {
  height: 14px;
  width: 75%;
  margin-bottom: 10px;
}

.skeleton-line.playtime-line {
  height: 10px;
  width: 40%;
}

/* ==========================================
   COLLECTION CARDS & STACKS
   ========================================== */
.collection-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.collection-cover-stack {
  position: relative;
  width: calc(100% - 16px);
  aspect-ratio: 2/3;
  margin: 8px 8px 0 8px;
}

.collection-cover-stack .cover-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.03);
  z-index: 3;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  background-color: #0b0c10;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.collection-cover-stack img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Overlapping preview thumbnails */
.collection-previews {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.preview-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  background-color: #0b0c10;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.preview-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail-1 {
  z-index: 2;
  transform: translate(10px, -6px) rotate(4deg) scale(0.93);
  opacity: 0.65;
}

.thumbnail-2 {
  z-index: 1;
  transform: translate(-10px, -6px) rotate(-4deg) scale(0.93);
  opacity: 0.65;
}

/* Collection card hover micro-animations */
.collection-card:hover {
  transform: translateY(-8px) scale(1.01);
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(139, 92, 246, 0.15);
}

.collection-card:hover .collection-cover-stack .cover-wrapper {
  transform: scale(1.02);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.collection-card:hover .thumbnail-1 {
  transform: translate(16px, -10px) rotate(7deg) scale(0.95);
  opacity: 0.85;
}

.collection-card:hover .thumbnail-2 {
  transform: translate(-16px, -10px) rotate(-7deg) scale(0.95);
  opacity: 0.85;
}

/* Badges & Details */
.collection-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-purple) 100%);
  color: white;
  font-weight: 800;
  font-size: 9px;
  padding: 4px 10px;
  border-radius: 9999px;
  z-index: 6;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.collection-card-details {
  padding: 16px;
  background: rgba(6, 8, 12, 0.15);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}

.collection-card-details h2 {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 6px 0;
  color: var(--text-title);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collection-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin: 0;
}

.collection-card:hover .collection-count {
  color: var(--accent-purple);
}

/* ==========================================
   FAVORITES COLLECTIONS LIST & ACCORDIONS
   ========================================== */
.favorites-collections-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.collection-section {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.collection-section:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.collection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.01);
  transition: background 0.3s ease;
}

.collection-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.collection-header .header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.collection-header .header-arrow {
  display: inline-block;
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.collection-section.active .header-arrow {
  transform: rotate(90deg);
  color: var(--accent-purple);
}

.collection-header .collection-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-title);
  margin: 0;
  letter-spacing: -0.01em;
}

.collection-header .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.collection-stats-badge {
  font-size: 11px;
  font-weight: 700;
  color: #c084fc;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.15);
  padding: 3px 10px;
  border-radius: 9999px;
  text-transform: uppercase;
}

.collection-playtime-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 3px 10px;
  border-radius: 9999px;
}

.collection-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  opacity: 0;
}

.collection-section.active .collection-body {
  grid-template-rows: 1fr;
  opacity: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.collection-body-inner {
  overflow: hidden;
  padding: 0 24px;
  transition: padding 0.4s ease;
}

.collection-section.active .collection-body-inner {
  padding: 24px;
}

/* Globally prevent scroll chaining/overscrolling behind open dialogs/overlays */
dialog, .modal-content, .collection-modal-body, .modal-body {
  overscroll-behavior: contain;
}

/* ==========================================
   COLLECTION EXPAND MODAL
   ========================================== */
#collection-dialog {
  width: min(900px, 94%);
  max-height: 85vh;
}

#collection-dialog .modal-content {
  padding: 36px;
}

.collection-modal-header {
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 16px;
}

.collection-modal-header h2 {
  font-size: clamp(22px, 3.5vw, 28px);
  font-weight: 800;
  color: var(--text-title);
  margin: 0;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 40%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.collection-count-badge {
  font-size: 11px;
  font-weight: 700;
  color: #c084fc;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  padding: 3px 12px;
  border-radius: 9999px;
  text-transform: uppercase;
}

.collection-modal-body {
  overflow-y: auto;
  max-height: 55vh;
  padding-right: 8px;
}

.collection-modal-body::-webkit-scrollbar {
  width: 6px;
}
.collection-modal-body::-webkit-scrollbar-track {
  background: transparent;
}
.collection-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}

/* CROSS-FADE VIEW TRANSITIONS */
::view-transition-old(root) {
  animation: 120ms cubic-bezier(0.4, 0, 1, 1) both fade-out;
}
::view-transition-new(root) {
  animation: 220ms cubic-bezier(0, 0, 0.2, 1) both fade-in;
}

@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* ==========================================
   AGE WARNING OVERLAY STYLING
   ========================================== */
#age-warning {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 5, 8, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 24px;
  box-sizing: border-box;
}

.warning-box {
  background: rgba(20, 24, 33, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 40px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 
              0 0 80px rgba(239, 68, 68, 0.05);
  text-align: center;
  box-sizing: border-box;
  animation: warningBoxEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes warningBoxEntrance {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.warning-box h2 {
  font-size: 24px;
  font-weight: 900;
  color: #ef4444;
  margin: 0 0 24px 0;
  letter-spacing: 0.05em;
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.warning-box p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-body, #a0aec0);
  margin: 0 0 20px 0;
}

.warning-box ul {
  text-align: left;
  margin: 20px auto;
  padding-left: 24px;
  max-width: 380px;
  color: var(--text-body, #a0aec0);
  font-size: 14px;
  line-height: 1.8;
}

.warning-box li {
  margin-bottom: 8px;
  position: relative;
  list-style-type: none;
  padding-left: 12px;
}

.warning-box li::before {
  content: "•";
  color: #ef4444;
  font-weight: bold;
  display: inline-block;
  width: 1em;
  margin-left: -1em;
  position: absolute;
}

.warning-buttons {
  display: flex;
  gap: 16px;
  margin-top: 32px;
}

.warning-buttons button {
  flex: 1;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

#accept-warning {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

#accept-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
  filter: brightness(1.1);
}

#accept-warning:active {
  transform: translateY(0);
}

#reject-warning {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted, #718096);
}

#reject-warning:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.1);
}

#reject-warning:active {
  transform: translateY(0);
}