/* ============ MEGA UPGRADE 2026 ============ */
/* Modern effects: Glass borders, Parallax, 3D tilt, Skeleton loaders, Stream Live cursor */

/* ===== ANIMATED GLASS BORDERS ===== */
@keyframes glass-border-rotate {
  0% { --angle: 0deg; }
  100% { --angle: 360deg; }
}

@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.game-card {
  position: relative;
  overflow: hidden;
  will-change: transform;
  transform: translateZ(0);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: inherit;
  background: conic-gradient(from var(--angle, 0deg), transparent 40%, rgba(232,183,48,0.4) 50%, transparent 60%);
  animation: glass-border-rotate 4s linear infinite;
  opacity: 0;
  transition: opacity 0.4s ease;
}

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

/* ===== 3D TILT EFFECT ON HOVER ===== */
.game-card:hover {
  transform: perspective(800px) rotateY(var(--rx, 0deg)) rotateX(var(--ry, 0deg)) scale(1.03);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 30px rgba(232,183,48,0.1);
}

/* ===== SKELETON LOADERS ===== */
@keyframes skeleton-shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200px 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 8px;
}

.skeleton-card {
  background: rgba(22,16,58,0.5);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.05);
  overflow: hidden;
}

.skeleton-card .skeleton-image {
  width: 100%;
  height: 160px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200px 100%;
  animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-card .skeleton-title {
  height: 20px;
  width: 70%;
  margin: 16px;
  border-radius: 4px;
}

.skeleton-card .skeleton-desc {
  height: 14px;
  width: 90%;
  margin: 0 16px 16px;
  border-radius: 4px;
}

.skeleton-card .skeleton-tags {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
}

.skeleton-card .skeleton-tag {
  height: 24px;
  width: 60px;
  border-radius: 12px;
}

/* ===== PARALLAX SPACE BACKGROUND ===== */
.hero-section {
  position: relative;
  overflow: hidden;
}

.hero-bg {
  transition: transform 0.1s linear;
  will-change: transform;
}

/* ===== STREAM LIVE CURSOR (Style 9) ===== */
.cursor-stream-dot {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 15px rgba(239,68,68,0.8), 0 0 30px rgba(239,68,68,0.4);
  pointer-events: none;
  z-index: 99996;
  animation: stream-pulse 1.2s infinite;
  transform: translate(-50%, -50%);
}

@keyframes stream-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(1.4); opacity: 0.7; }
}

.cursor-stream-label {
  position: fixed;
  pointer-events: none;
  z-index: 99995;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.5);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: bold;
  color: #ef4444;
  letter-spacing: 1px;
  text-transform: uppercase;
  transform: translate(-50%, 12px);
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

/* ===== CURSOR REPLAY ANIMATION ===== */
@keyframes cursor-preview-bounce {
  0% { transform: translate(-50%,-50%) scale(0.3); opacity: 0; }
  40% { transform: translate(-50%,-50%) scale(1.2); opacity: 1; }
  60% { transform: translate(-50%,-50%) scale(0.9); }
  80% { transform: translate(-50%,-50%) scale(1.05); }
  100% { transform: translate(-50%,-50%) scale(1); opacity: 1; }
}

.cursor-replay {
  animation: cursor-preview-bounce 0.5s ease-out !important;
}

/* ===== DARK/LIGHT MODE ===== */
body.light-mode {
  background: #f0f0f5 !important;
  color: #1a1a2e !important;
}

body.light-mode .glass-nav {
  background: rgba(255,255,255,0.85) !important;
  border-bottom-color: rgba(0,0,0,0.1) !important;
}

body.light-mode .glass-card,
body.light-mode .glass-card-strong {
  background: rgba(255,255,255,0.8) !important;
  border-color: rgba(0,0,0,0.1) !important;
  color: #1a1a2e !important;
}

body.light-mode .game-card {
  background: rgba(255,255,255,0.9) !important;
  border-color: rgba(0,0,0,0.08) !important;
  color: #1a1a2e !important;
}

body.light-mode .game-card .game-title {
  color: #1a1a2e !important;
}

body.light-mode .game-card .game-desc {
  color: #555 !important;
}

body.light-mode .nav-btn,
body.light-mode .glass-btn {
  color: #1a1a2e !important;
}

body.light-mode .stat-card {
  background: rgba(255,255,255,0.7) !important;
  border-color: rgba(0,0,0,0.08) !important;
}

body.light-mode .text-gray-300,
body.light-mode .text-gray-400 {
  color: #555 !important;
}

body.light-mode .text-gray-500,
body.light-mode .text-gray-600 {
  color: #777 !important;
}

body.light-mode .site-footer {
  background: rgba(0,0,0,0.03) !important;
}

body.light-mode .admin-sidebar {
  background: rgba(255,255,255,0.95) !important;
}

body.light-mode .admin-sidebar .admin-nav-btn {
  color: #333 !important;
}

body.light-mode .admin-content-area {
  background: rgba(245,245,250,0.95) !important;
}

body.light-mode .glass-input {
  background: rgba(0,0,0,0.05) !important;
  color: #1a1a2e !important;
  border-color: rgba(0,0,0,0.15) !important;
}

body.light-mode .section-header h2 {
  color: #1a1a2e !important;
}

body.light-mode .hero-section {
  background: linear-gradient(135deg, #e8e4f0 0%, #d4d0e0 50%, #f0edf5 100%) !important;
}

body.light-mode .loading-screen {
  background: linear-gradient(135deg, #f0f0f5, #e0e0ea) !important;
}

body.light-mode .loading-title,
body.light-mode .loading-subtitle {
  color: #1a1a2e !important;
}

/* ===== OPTIMIZED TRANSITIONS ===== */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Reduce paint for cursor elements */
#cursor-main, #cursor-dot, #cursor-trail {
  will-change: left, top, transform;
  contain: layout style;
}

/* Hardware accelerate animated elements */
.animate-slide-up,
.animate-fade-in,
.animate-scale-in {
  will-change: transform, opacity;
  backface-visibility: hidden;
}

/* Reduce repaints on hover */
.game-card,
.stat-card,
.hero-badge,
.about-platform-link {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* ===== ADMIN KEYBOARD SHORTCUTS HINT ===== */
.admin-nav-btn .shortcut-hint {
  display: none;
  font-size: 10px;
  opacity: 0.5;
  margin-right: 8px;
  background: rgba(255,255,255,0.1);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: monospace;
}

@media (min-width: 768px) {
  .admin-nav-btn .shortcut-hint {
    display: inline;
  }
}

/* ===== IMPROVED GAME IMAGE LOADING ===== */
.game-image img {
  transition: opacity 0.3s ease;
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.game-image img[src=''] {
  opacity: 0;
}

/* ===== FIX: Prevent layout shift ===== */
.game-card .game-image {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: rgba(22,16,58,0.5);
}

/* ===== PERFORMANCE: Limit animation on reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .game-card::before { display: none; }
  .hero-bg { transform: none !important; }
}
