* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
}

/* 顶部iframe区域 */
.game-iframe-container {
  width: 100%;
  height: 60vh;
  min-height: 300px;
  background: #000;
  position: relative;
  overflow: hidden;
}

.game-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.game-iframe.loaded {
  display: block;
  opacity: 1;
}

/* 游戏信息显示 */
.game-info-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  z-index: 2;
  position: relative;
}

.game-icon {
  width: 120px;
  height: 120px;
  border-radius: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.game-icon:hover {
  transform: scale(1.05);
}

.game-name {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-subtitle {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 30px;
}

.iframe-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* Play按钮作为进度条样式 */
.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  color: white;
  border: none;
  padding: 20px 40px;
  font-size: 24px;
  font-weight: bold;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  z-index: 10;
  display: flex !important;
  align-items: center;
  gap: 10px;
  width: 300px;
  height: 60px;
  justify-content: center;
  overflow: hidden;
}

.play-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.3s ease;
  border-radius: 50px;
}

.play-button.loading::before {
  left: 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.play-button:hover {
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.play-button:active {
  transform: translate(-50%, -50%) scale(0.95);
}

.play-button.loading {
  cursor: not-allowed;
  opacity: 0.8;
}

/* 确保按钮始终可见 */
#playButton {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 999 !important;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4) !important;
  color: white !important;
  border: 2px solid white !important;
}

.play-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.progress-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 10px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

/* 全屏按钮 */
.fullscreen-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  z-index: 10;
  transition: background 0.3s ease;
}

.fullscreen-btn:hover {
  background: rgba(0, 0, 0, 0.9);
}

/* 全屏模式 */
.game-iframe-container.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  background: #000;
}

.game-iframe-container.fullscreen.playing .game-iframe {
  display: block !important;
  opacity: 1;
}

.game-iframe-container.fullscreen .iframe-placeholder {
  display: none;
}

/* 隐藏iframe时的样式 */
.game-iframe-container:not(.fullscreen):not(.playing) .game-iframe {
  display: none !important;
}

.game-iframe-container:not(.fullscreen) .iframe-placeholder {
  display: flex;
}

/* 游戏准备就绪时的样式 */
.game-iframe-container.game-ready .iframe-placeholder {
  display: flex;
}

.game-iframe-container.game-ready:not(.playing) .game-iframe {
  display: none !important;
}

/* 正在播放游戏时的样式 */
.game-iframe-container.playing .game-iframe {
  display: block !important;
}

.game-iframe-container.playing .iframe-placeholder {
  display: none !important;
}

/* 确保Play按钮在游戏准备就绪时仍然可见 */
.game-iframe-container.game-ready .play-button {
  display: flex !important;
  visibility: visible !important;
}

/* 广告区域 */
.ad-container {
  width: 100%;
  background: #fff;
  text-align: center;
}

.ad-unit {
  width: 100%;
  max-width: 400px;
  height: 150px;
  background: #f0f0f0;
  border: 2px dashed #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  color: #666;
  font-size: 16px;
  border-radius: 8px;
}

/* Google AdSense 样式 */
.adsbygoogle {
  width: 100%;
  /* max-width: 400px; */
  /* height: 150px; */
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
}

/* 游戏列表区域 */
.games-section {
  padding: 20px;
  background: #fff;
  position: relative;
  overflow: hidden;
}

/* 不规则背景图形 */
.games-section::before {
  content: '';
  position: absolute;
  top: -50px;
  left: -50px;
  width: 200px;
  height: 200px;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  animation: float1 6s ease-in-out infinite;
  opacity: 0.1;
  z-index: 1;
}

.games-section::after {
  content: '';
  position: absolute;
  bottom: -80px;
  right: -80px;
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  animation: float2 8s ease-in-out infinite;
  opacity: 0.08;
  z-index: 1;
}

/* 额外的装饰图形 */
.games-section .decoration-1 {
  position: absolute;
  top: 20%;
  right: 10%;
  width: 120px;
  height: 120px;
  background: linear-gradient(45deg, #ff9a9e, #fecfef);
  border-radius: 40% 60% 60% 40% / 60% 30% 70% 40%;
  animation: float3 7s ease-in-out infinite;
  opacity: 0.06;
  z-index: 1;
}

.games-section .decoration-2 {
  position: absolute;
  bottom: 30%;
  left: 5%;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #a8edea, #fed6e3);
  border-radius: 50% 20% 50% 20% / 20% 50% 20% 50%;
  animation: float4 5s ease-in-out infinite;
  opacity: 0.05;
  z-index: 1;
}

.games-section .decoration-3 {
  position: absolute;
  top: 60%;
  left: 20%;
  width: 60px;
  height: 60px;
  background: linear-gradient(45deg, #ffecd2, #fcb69f);
  border-radius: 30% 70% 50% 50% / 50% 50% 50% 50%;
  animation: float5 9s ease-in-out infinite;
  opacity: 0.04;
  z-index: 1;
}

/* 浮动动画 */
@keyframes float1 {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  }
  25% {
    transform: translate(20px, -20px) rotate(90deg);
    border-radius: 50% 50% 30% 70% / 50% 30% 50% 70%;
  }
  50% {
    transform: translate(-10px, 10px) rotate(180deg);
    border-radius: 70% 30% 50% 50% / 30% 50% 70% 50%;
  }
  75% {
    transform: translate(15px, 5px) rotate(270deg);
    border-radius: 40% 60% 60% 40% / 60% 40% 40% 60%;
  }
}

@keyframes float2 {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  33% {
    transform: translate(-30px, 20px) rotate(120deg);
    border-radius: 40% 60% 50% 50% / 50% 50% 60% 40%;
  }
  66% {
    transform: translate(20px, -15px) rotate(240deg);
    border-radius: 50% 50% 40% 60% / 40% 60% 50% 50%;
  }
}

@keyframes float3 {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    border-radius: 40% 60% 60% 40% / 60% 30% 70% 40%;
  }
  50% {
    transform: translate(-15px, 10px) rotate(180deg) scale(1.1);
    border-radius: 60% 40% 40% 60% / 40% 60% 40% 60%;
  }
}

@keyframes float4 {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    border-radius: 50% 20% 50% 20% / 20% 50% 20% 50%;
  }
  50% {
    transform: translate(10px, -20px) rotate(180deg) scale(0.9);
    border-radius: 20% 50% 20% 50% / 50% 20% 50% 20%;
  }
}

@keyframes float5 {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    border-radius: 30% 70% 50% 50% / 50% 50% 50% 50%;
  }
  25% {
    transform: translate(5px, 15px) rotate(90deg) scale(1.2);
    border-radius: 50% 50% 30% 70% / 50% 30% 50% 70%;
  }
  50% {
    transform: translate(-10px, 5px) rotate(180deg) scale(0.8);
    border-radius: 70% 30% 50% 50% / 30% 50% 70% 50%;
  }
  75% {
    transform: translate(15px, -10px) rotate(270deg) scale(1.1);
    border-radius: 40% 60% 60% 40% / 60% 40% 40% 60%;
  }
}

.section-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #333;
  text-align: center;
  position: relative;
  z-index: 2;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
  position: relative;
  z-index: 2;
}

.game-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.game-image {
  width: 100%;
  height: 120px;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  font-weight: bold;
}

.game-info {
  padding: 12px;
}

.game-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #333;
}

.game-category {
  font-size: 12px;
  color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .game-iframe-container {
    height: 50vh;
    min-height: 250px;
  }
  
  .game-icon {
    width: 100px;
    height: 100px;
  }
  
  .game-name {
    font-size: 28px;
  }
  
  .game-subtitle {
    font-size: 14px;
  }
  
        .play-button {
          padding: 15px 30px;
          font-size: 20px;
          width: 250px;
          height: 50px;
        }
  
  .ad-unit {
    height: 120px;
    max-width: 350px;
    font-size: 14px;
  }
  
  .adsbygoogle {
    /* height: 120px; */
    /* max-width: 350px; */
  }
  
  .ad-container {
    padding: 25px 15px;
  }
  
  .games-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
  }
  
  .game-image {
    height: 100px;
  }
  
  .section-title {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .game-iframe-container {
    height: 40vh;
    min-height: 200px;
  }
  
  .game-icon {
    width: 80px;
    height: 80px;
  }
  
  .game-name {
    font-size: 24px;
  }
  
  .game-subtitle {
    font-size: 12px;
  }
  
        .play-button {
          padding: 12px 24px;
          font-size: 18px;
          width: 200px;
          height: 45px;
        }
  
  .ad-unit {
    height: 100px;
    max-width: 300px;
    font-size: 13px;
  }
  
  .adsbygoogle {
    /* height: 100px; */
    /* max-width: 300px; */
  }
  
  .ad-container {
    padding: 20px 10px;
  }
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  /* height: 20px; */
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  /* border-radius: 50%; */
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 游戏控制区域 */
.games-controls {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-box input {
  width: 100%;
  padding: 12px 40px 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 25px;
  font-size: 14px;
  background: white;
  transition: border-color 0.3s ease;
}

.search-box input:focus {
  outline: none;
  border-color: #4CAF50;
}

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  fill: #999;
}

.category-filter select {
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 25px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.category-filter select:focus {
  outline: none;
  border-color: #4CAF50;
}

/* 游戏统计信息 */
.games-stats {
  margin-bottom: 20px;
  text-align: center;
}

.games-stats span {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
}

/* 增强的游戏卡片样式 */
.game-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.game-image {
  position: relative;
  height: 150px;
  overflow: hidden;
}

.game-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.game-rating {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.rating-stars {
  color: #FFD700;
}

.rating-number {
  font-weight: bold;
}

.game-info {
  padding: 15px;
}

.game-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 5px;
  color: #333;
}

.game-category {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-description {
  font-size: 13px;
  color: #666;
  margin-bottom: 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 500;
}

/* 加载更多按钮 */
.load-more-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 30px;
  width: 100%;
}

.load-more-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.load-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.load-more-btn:active {
  transform: translateY(0);
}

/* 响应式设计增强 */
@media (max-width: 768px) {
  .games-controls {
    flex-direction: column;
    gap: 15px;
  }
  
  .search-box {
    min-width: 100%;
  }
  
  .game-image {
    height: 120px;
  }
  
  .game-description {
    -webkit-line-clamp: 1;
  }
}

@media (max-width: 480px) {
  /* 移动端样式优化 */
}
