/* Keep this file for non-Tailwind additions only. */
:root {
  color-scheme: dark;
}

/* 缅文字体支持 */
html[lang="my"] {
  font-family: 'Myanmar Text', 'Myanmar Sans', 'Noto Sans Myanmar', 'Padauk', sans-serif;
}

/* 移动端滚动优化 - 禁用弹性滚动和晃动 */
@media (max-width: 768px) {
  html, body {
    overscroll-behavior-y: contain; /* 禁用滚动链式反应 */
    overscroll-behavior-x: none; /* 禁用横向弹性 */
    touch-action: pan-y; /* 只允许垂直滚动 */
  }
  
  body {
    position: fixed;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* iOS 平滑滚动 */
  }
  
  /* 主应用容器优化 */
  #root,
  [data-name="root"],
  .min-h-screen {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  
  /* 禁用 iOS 的缩放行为 */
  * {
    touch-action: manipulation;
  }
  
  /* ✅ 移动端性能优化：减少动画效果，降低 GPU 负载 */
  .animate-pulse,
  .animate-bounce,
  .animate-spin {
    animation: none !important;
  }
  
  /* 减少过渡动画时长 */
  .transition-all,
  .transition-opacity,
  .transition-transform {
    transition-duration: 150ms !important;
  }
  
  /* 禁用复杂的背景渐变动画 */
  .bg-gradient-animate {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
    animation: none !important;
  }
}

/* 桌面端保持正常滚动 */
@media (min-width: 769px) {
  html, body {
    height: 100%;
    overflow: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}

@keyframes floatUp {
  0% { transform: translateY(10px); opacity: 0; }
  100% { transform: translateY(0px); opacity: 1; }
}

.float-in {
  animation: floatUp 420ms ease-out both;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(34,211,238,.22), 0 0 18px rgba(34,211,238,.12); }
  50% { box-shadow: 0 0 0 1px rgba(255,61,206,.22), 0 0 26px rgba(255,61,206,.14); }
}

.pulse-glow {
  animation: pulseGlow 2.2s ease-in-out infinite;
}

/* 翻页动画效果 */
@keyframes slidePage {
  from { opacity: 0.5; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slidePageReverse {
  from { opacity: 0.5; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadePage {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-transition-enter {
  animation: fadePage 0.4s ease-out both;
}

.page-transition-slide-right {
  animation: slidePage 0.4s ease-out both;
}

.page-transition-slide-left {
  animation: slidePageReverse 0.4s ease-out both;
}

/* 按钮点击动画 */
@keyframes buttonClick {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.button-click {
  animation: buttonClick 0.2s ease-out;
}

/* 惯性滚动效果 */
.momentum-scroll {
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 页面指示器动画 */
@keyframes pageIndicatorGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.3); }
  50% { box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.5); }
}

.page-indicator-glow {
  animation: pageIndicatorGlow 1.5s infinite;
}

/* 触摸反馈效果 */
.touch-feedback {
  transition: all 0.15s ease;
}

.touch-feedback:active {
  transform: scale(0.97);
  opacity: 0.8;
}

/* 卡片逐项动画 */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation-name: fadeInUp;
  animation-duration: 0.4s;
  animation-fill-mode: both;
  animation-timing-function: ease-out;
}

/* 翻页视觉反馈 */
@keyframes pagePeek {
  0% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-15px);
    opacity: 0.7;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.page-peek {
  animation: pagePeek 0.5s ease-out;
}

/* 滑动指示器动画 */
@keyframes swipeIndicatorPulse {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.2);
  }
}

.swipe-indicator {
  animation: swipeIndicatorPulse 1.5s ease-in-out infinite;
}

/* 页面切换渐变背景 */
@keyframes pageGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.page-gradient {
  background: linear-gradient(135deg, rgba(6, 6, 11, 0.8) 0%, rgba(109, 40, 217, 0.2) 50%, rgba(34, 211, 238, 0.2) 100%);
  background-size: 200% 200%;
  animation: pageGradient 3s ease-in-out infinite;
}

/* 连续滚动效果 */
.continuous-scroll-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
}

.continuous-scroll-content {
  display: flex;
  flex-wrap: nowrap;
  will-change: transform;
  backface-visibility: hidden; /* 提升性能 */
  transform: translateZ(0);
}

/* 页面边缘渐变遮罩 */
.scroll-edge-mask {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  pointer-events: none;
  z-index: 10;
}

.scroll-edge-mask-left {
  left: 0;
  background: linear-gradient(90deg, rgba(6, 6, 11, 0.9) 0%, rgba(6, 6, 11, 0) 100%);
}

.scroll-edge-mask-right {
  right: 0;
  background: linear-gradient(270deg, rgba(6, 6, 11, 0.9) 0%, rgba(6, 6, 11, 0) 100%);
}

/* 连体页面效果 */
.adjacent-page {
  opacity: 0.3;
  filter: blur(1px);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.adjacent-page:hover {
  opacity: 0.5;
  filter: blur(0.5px);
}

/* 滚动指示器 */
.scroll-indicator {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 20;
}

.scroll-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.scroll-dot.active {
  background: rgba(34, 211, 238, 0.8);
  transform: scale(1.2);
}

.scroll-dot.adjacent {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(0.8);
}

/* 游戏卡片高度变量 */
:root {
  --game-card-height: 180px; /* 游戏卡片的预估高度 */
}

/* 响应式游戏卡片高度 */
@media (max-width: 640px) {
  :root {
    --game-card-height: 160px;
  }
}

@media (min-width: 1024px) {
  :root {
    --game-card-height: 200px;
  }
}