/* ===== Cartoon Party Theme - 卡通休闲Q版派对风 ===== */

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Fredoka', 'Comic Sans MS', cursive, sans-serif;
  background: #FFF9E6;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(255,217,61,0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,107,157,0.2) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(107,203,119,0.25) 0%, transparent 50%);
  color: #333333;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ===== Container ===== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* ===== Header - 彩虹渐变导航 ===== */
.site-header {
  background: linear-gradient(90deg, #FFD93D 0%, #6BCB77 25%, #4D96FF 50%, #FF6B9D 75%, #C77DFF 100%);
  border-bottom: none;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(255,107,157,0.3);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 1.6rem;
  font-weight: 700;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.15);
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.logo:hover {
  transform: scale(1.08) rotate(-2deg);
}
.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #FF6B9D 0%, #FFD93D 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(255,107,157,0.4);
  animation: float 3s ease-in-out infinite;
}
.logo span { color: #FFFFFF; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* ===== Hero Section - 精选区域（第一行独立样式） ===== */
.hero-section {
  padding: 32px 0 24px;
  position: relative;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: -20px;
  right: -20px;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,107,157,0.08) 0%, rgba(255,217,61,0.12) 50%, rgba(107,203,119,0.08) 100%);
  border-radius: 28px;
  z-index: -1;
}
.hero-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #333333;
  text-align: center;
  background: linear-gradient(135deg, #FF6B9D, #FFD93D, #6BCB77);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}
.hero-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}
/* 精选区卡片特殊样式 */
.hero-grid .game-card {
  border-radius: 22px;
  box-shadow: 0 10px 0 #FF6B9D, 0 16px 32px rgba(255,107,157,0.35);
  transform: scale(1);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.hero-grid .game-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 5px 0 #FF6B9D, 0 12px 40px rgba(255,107,157,0.45);
}
.hero-grid .game-card::after {
  content: '🔥';
  opacity: 1 !important;
  font-size: 1.1rem;
}
.hero-grid .game-card-thumb {
  aspect-ratio: 1/1;
}
.hero-grid .game-card-title {
  background: linear-gradient(180deg, #FFF0F5 0%, #FFE5EC 100%);
  font-weight: 600;
}

/* 响应式：精选区域网格 */
@media (max-width: 1024px) { .hero-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { 
  .hero-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .hero-section { padding: 24px 0 16px; }
  .hero-title { font-size: 1.4rem; }
}
@media (max-width: 480px)  { .hero-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

/* ===== Games Section - 全部游戏区域 ===== */
.games-section {
  padding: 8px 0 32px;
}
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #333333;
  position: relative;
  display: inline-block;
  padding-left: 16px;
}
.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 70%;
  background: linear-gradient(180deg, #FFD93D, #6BCB77);
  border-radius: 3px;
}
@media (max-width: 768px) {
  .section-title { font-size: 1.25rem; }
}

/* ===== Game Grid (Home) - 糖果网格 ===== */
.game-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  padding:5px 0;
}
@media (max-width: 1024px) { .game-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px)  { .game-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 576px)  { .game-grid { grid-template-columns: repeat(2, 1fr); gap: 5px; } }

/* ===== Game Card - 软萌卡片 ===== */
.game-card {
  background: #FFFFFF;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 0 #FFD93D, 0 12px 24px rgba(255,107,157,0.3);
  transition: all 0.35s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  cursor: pointer;
  position: relative;
}
.game-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #FF6B9D, #FFD93D, #6BCB77, #4D96FF, #C77DFF);
  border-radius: 22px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.game-card:hover::before {
  opacity: 1;
}
.game-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 4px 0 #FFD93D, 0 8px 32px rgba(255,107,157,0.5);
}
.game-card-thumb {
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: linear-gradient(135deg, #FFE5EC 0%, #E0F7FA 50%, #F0FBE2 100%);
  position: relative;
}
.game-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.game-card:hover .game-card-thumb img { transform: scale(1.08); }
.game-card-title {
  padding: 14px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #444444;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF9E6 100%);
}

/* ===== Ad Slot ===== */
.ad-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
}

/* ===== Detail Page ===== */
.detail-wrap {
  display: flex;
  gap: 28px;
  padding: 32px 0;
  flex: 1;
}
.detail-main {
  flex: 7;
  min-width: 0;
}
.detail-sidebar {
  flex: 3;
  min-width: 280px;
  max-width: 360px;
}
@media (max-width: 900px) {
  .detail-wrap { flex-direction: column; }
  .detail-sidebar { max-width: 100%; min-width: 0; }
}

/* Game Frame Area - 圆润游戏框 */
.game-frame-wrap {
  background: #FFFFFF;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/9;
  box-shadow: 0 10px 0 #FFD93D, 0 16px 48px rgba(255,107,157,0.25);
}
.game-frame-wrap:fullscreen,
.game-frame-wrap:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  aspect-ratio: unset;
  border-radius: 0;
}
.game-frame-wrap.mobile-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  z-index: 9999;
  aspect-ratio: unset;
  border-radius: 0;
}
.game-frame-wrap.mobile-fullscreen .fullscreen-btn {
  display: block;
  z-index: 10;
}
.game-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  position: relative;
  z-index: 1;
  border-radius: 24px;
}
.game-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,217,61,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 3;
  border-radius: 24px;
}
.game-overlay.hidden { opacity: 0; pointer-events: none; }
.game-overlay-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 24px;
}
.play-btn {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, #FF6B9D 0%, #FF8E53 100%);
  color: #FFFFFF;
  border: none;
  padding: 18px 36px;
  font-size: 1.15rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 6px 0 #E91E63, 0 10px 20px rgba(255,107,157,0.4);
  letter-spacing: 0.5px;
}
.play-btn:hover {
  transform: scale(1.08) translateY(-3px);
  box-shadow: 0 8px 0 #E91E63, 0 14px 28px rgba(255,107,157,0.5);
  animation: pulse 1.5s infinite;
}
.play-btn:active {
  transform: scale(1.02) translateY(0);
  box-shadow: 0 3px 0 #E91E63, 0 6px 12px rgba(255,107,157,0.4);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 6px 0 #E91E63, 0 10px 20px rgba(255,107,157,0.4), 0 0 0 0 rgba(255,107,157,0.4); }
  50% { box-shadow: 0 6px 0 #E91E63, 0 10px 20px rgba(255,107,157,0.4), 0 0 0 20px rgba(255,107,157,0); }
}

.fullscreen-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  background: rgba(107,203,119,0.95);
  color: #FFFFFF;
  border: none;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  display: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}
.fullscreen-btn:hover {
  background: rgba(82,182,97,1);
  transform: scale(1.05);
}
.game-frame-wrap.playing .fullscreen-btn { display: block; }
.game-frame-wrap.playing .game-overlay { display: none; }
.game-frame-wrap.playing .game-overlay-thumb { display: none; }

/* Sidebar - 软萌侧边栏 */
.detail-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: #333333;
  text-shadow: 1px 1px 2px rgba(255,107,157,0.2);
}
.detail-desc {
  font-size: 1rem;
  color: #555555;
  line-height: 1.8;
  margin-bottom: 20px;
}
.tips-box {
  background: linear-gradient(135deg, #FFF9E6 0%, #E8F5E9 100%);
  border-left: 5px solid #6BCB77;
  border-radius: 16px;
  padding: 20px;
  margin-top: 16px;
  box-shadow: 0 4px 16px rgba(107,203,119,0.15);
}
.tips-box h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #FF6B9D;
  margin-bottom: 12px;
}
.tips-box ul {
  list-style: none;
  padding: 0;
}
.tips-box li {
  font-size: 0.92rem;
  color: #666666;
  padding: 6px 0;
  padding-left: 22px;
  position: relative;
  line-height: 1.6;
}
.tips-box li::before {
  content: '🌟';
  position: absolute;
  left: 0;
  font-size: 0.85rem;
}

/* Related Games */
.related-section {
  padding: 32px 0;
}
.related-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #333333;
  position: relative;
  display: inline-block;
}
.related-section h2::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 60%;
  height: 4px;
  background: linear-gradient(90deg, #FF6B9D, #FFD93D);
  border-radius: 2px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 768px) { .related-grid { grid-template-columns: repeat(2, 1fr); } }

/* ===== Footer - 渐变页脚 ===== */
.site-footer {
  background: linear-gradient(180deg, #FFE5EC 0%, #E0F7FA 100%);
  border-top: none;
  padding: 40px 0;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.footer-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a {
  font-size: 0.92rem;
  color: #666666;
  transition: all 0.3s ease;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 20px;
}
.footer-links a:hover {
  color: #FF6B9D;
  background: rgba(255,107,157,0.1);
  transform: translateY(-2px);
}
.footer-copy {
  font-size: 0.85rem;
  color: #999999;
  margin-top: 8px;
}

/* ===== Info Pages (Contact/Policy/About) ===== */
.info-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 20px;
  flex: 1;
  background: #FFFFFF;
  border-radius: 24px;
  margin-top: 32px;
  margin-bottom: 32px;
  box-shadow: 0 8px 0 #FFD93D, 0 16px 32px rgba(255,107,157,0.15);
}
.info-page h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 28px;
  color: #333333;
  background: linear-gradient(135deg, #FF6B9D, #4D96FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.info-page h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 32px 0 16px;
  color: #FF6B9D;
  position: relative;
  padding-left: 16px;
}
.info-page h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 70%;
  background: linear-gradient(180deg, #FFD93D, #6BCB77);
  border-radius: 3px;
}
.info-page p {
  font-size: 1rem;
  color: #555555;
  line-height: 1.9;
  margin-bottom: 16px;
}
.info-page a {
  color: #FF6B9D;
  font-weight: 600;
  transition: all 0.3s ease;
}
.info-page a:hover {
  color: #FF4081;
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: 4px;
}
.info-page ul {
  list-style: none;
  padding: 0;
}
.info-page li {
  padding: 8px 0 8px 28px;
  position: relative;
  color: #555555;
  font-size: 1rem;
  line-height: 1.8;
}
.info-page li::before {
  content: '✨';
  position: absolute;
  left: 4px;
  font-size: 0.9rem;
}

/* ===== Scrollbar - 圆润糖果色滚动条 ===== */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track {
  background: #FFF0F5;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #FF6B9D, #FFD93D);
  border-radius: 10px;
  border: 2px solid #FFF0F5;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #FF4081, #FFC107);
}

/* ===== Cartoon Decorations & Animations ===== */

/* 彩虹光斑背景动画 */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(255,217,61,0.15) 0%, transparent 30%),
    radial-gradient(circle at 70% 60%, rgba(255,107,157,0.12) 0%, transparent 35%),
    radial-gradient(circle at 40% 80%, rgba(107,203,119,0.1) 0%, transparent 30%),
    radial-gradient(circle at 85% 20%, rgba(77,150,255,0.1) 0%, transparent 25%);
  animation: bgFloat 20s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes bgFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(2%, 1%) rotate(1deg); }
  66% { transform: translate(-1%, 2%) rotate(-1deg); }
}

/* 卡通装饰元素 - 可选的星星点缀 */
.game-card::after {
  content: '⭐';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1rem;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.game-card:hover::after {
  opacity: 1;
  transform: scale(1.2) rotate(15deg);
}

/* 活泼的链接下划线效果 */
a {
  position: relative;
}
.footer-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #FF6B9D, #FFD93D);
  transition: all 0.3s ease;
  border-radius: 2px;
  transform: translateX(-50%);
}
.footer-links a:hover::after {
  width: 80%;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .site-header { padding: 12px 0; }
  .logo { font-size: 1.3rem; }
  .logo-icon { width: 34px; height: 34px; font-size: 18px; }
  .detail-title { font-size: 1.4rem; }
  .info-page { margin: 20px 16px; padding: 32px 20px; border-radius: 20px; }
  .info-page h1 { font-size: 1.7rem; }
  .play-btn { padding: 14px 28px; font-size: 1rem; }
  .game-frame-wrap { border-radius: 16px; }
  .game-overlay { border-radius: 16px; }
  .game-frame-wrap iframe { border-radius: 16px; }
  .game-overlay-thumb { border-radius: 16px; }
}
