/* ===== Macaron Dream Theme - 马卡龙可爱风 ===== */

/* ===== Keyframes Animations ===== */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(10deg); }
}
@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes fall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(255,158,205,0.3); }
  50% { box-shadow: 0 0 40px rgba(255,158,205,0.6); }
}
@keyframes bubble {
  0% { transform: translateY(0) scale(1); opacity: 0.7; }
  100% { transform: translateY(-100px) scale(0); opacity: 0; }
}
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Nunito', 'Quicksand', -apple-system, sans-serif;
  background: linear-gradient(135deg, #FFF5F8 0%, #F0F4FF 50%, #FFF9E6 100%);
  background-attachment: fixed;
  color: #5D4E60;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(255,158,205,0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(168,216,255,0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(201,184,255,0.08) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ===== Floating Decorations ===== */
.decoration-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.floating-star, .floating-heart, .floating-cloud {
  position: absolute;
  pointer-events: none;
}
.floating-star {
  width: 20px;
  height: 20px;
  background: #FFE5A0;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: fall linear infinite;
  opacity: 0.6;
}
.floating-heart {
  width: 18px;
  height: 18px;
  background: #FF9ECD;
  transform: rotate(-45deg);
  animation: fall linear infinite;
  opacity: 0.5;
}
.floating-heart::before,
.floating-heart::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: #FF9ECD;
  border-radius: 50%;
}
.floating-heart::before { top: -9px; left: 0; }
.floating-heart::after { left: 9px; top: 0; }
.floating-cloud {
  width: 40px;
  height: 24px;
  background: rgba(168,216,255,0.4);
  border-radius: 20px;
  animation: float 8s ease-in-out infinite;
}
.floating-cloud::before,
.floating-cloud::after {
  content: '';
  position: absolute;
  background: rgba(168,216,255,0.4);
  border-radius: 50%;
}
.floating-cloud::before { width: 20px; height: 20px; top: -8px; left: 6px; }
.floating-cloud::after { width: 16px; height: 16px; top: -4px; right: 8px; }

/* ===== Container ===== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  position: relative;
  z-index: 2;
}
@media (max-width: 576px) {
  .container { padding: 0 16px; }
}

/* ===== Header ===== */
.site-header {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,158,205,0.2);
  padding: 16px 0;
  z-index: 100;
}
/* 首页隐藏页眉 */
body.index-page .site-header {
  display: none;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: #5D4E60;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.3s ease;
}
.logo:hover {
  transform: scale(1.05);
  animation: wiggle 0.5s ease;
}
.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #FF9ECD 0%, #A8D8FF 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(255,158,205,0.3);
  animation: pulse-glow 2s ease-in-out infinite;
  position: relative;
}
.logo-icon::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 8px;
  background: rgba(255,255,255,0.6);
  border-radius: 50%;
  top: 10px;
  left: 10px;
  transform: rotate(-30deg);
}
.logo span { 
  background: linear-gradient(135deg, #FF9ECD, #A8D8FF, #C9B8FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Game Grid (Home) ===== */
.game-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
  padding: 32px 0;
}
@media (max-width: 1200px) { .game-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 992px)  { .game-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px)  { .game-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (max-width: 576px)  { .game-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 24px 0; } }

/* ===== Game Card ===== */
.game-card {
  background: rgba(255,255,255,0.9);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(255,158,205,0.12);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  border: 2px solid transparent;
}
.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 28px;
  padding: 2px;
  background: linear-gradient(135deg, #FF9ECD, #A8D8FF, #C9B8FF, #FFE5A0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.game-card:hover::before {
  opacity: 1;
}
.game-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 16px 48px rgba(255,158,205,0.25);
}
.game-card-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: linear-gradient(135deg, #FFF5F8, #F0F4FF);
  position: relative;
}
.game-card-thumb::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  background: #FFE5A0;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
  transition: all 0.3s ease;
}
.game-card:hover .game-card-thumb::after {
  opacity: 0.8;
  transform: translate(-50%, -50%) scale(1);
  animation: sparkle 0.6s ease-in-out;
}
.game-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.game-card:hover .game-card-thumb img { transform: scale(1.06); }
.game-card-title {
  padding: 16px;
  font-size: 1rem;
  font-weight: 700;
  color: #5D4E60;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,249,230,0.9));
}
@media (max-width: 768px) {
  .game-card-title { padding: 14px; font-size: 0.95rem; }
}
@media (max-width: 576px) {
  .game-card-title { padding: 12px; font-size: 0.9rem; }
}

/* ===== Ad Slot ===== */
.ad-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
}
.ad-row > div {
  background: rgba(255,255,255,0.7);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

/* ===== Detail Page ===== */
.detail-wrap {
  display: flex;
  gap: 28px;
  padding: 28px 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: rgba(255,255,255,0.9);
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/9;
  box-shadow: 0 8px 32px rgba(255,158,205,0.15);
}
.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;
}
.game-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,245,248,0.95), rgba(240,244,255,0.95));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  transition: opacity 0.3s;
  z-index: 3;
}
.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;
}
.play-btn {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, #FF9ECD 0%, #A8D8FF 100%);
  color: #ffffff;
  border: none;
  padding: 16px 48px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(255,158,205,0.4);
  font-family: inherit;
}
.play-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 2s infinite;
}
.play-btn:hover { 
  transform: scale(1.08);
  box-shadow: 0 12px 35px rgba(255,158,205,0.5);
}
.fullscreen-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: rgba(255,255,255,0.9);
  color: #5D4E60;
  border: none;
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  display: none;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.2s ease;
}
.fullscreen-btn:hover {
  background: #FF9ECD;
  color: #fff;
}
.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.5rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: #5D4E60;
  background: linear-gradient(135deg, #FF9ECD, #A8D8FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.detail-desc {
  font-size: 1rem;
  color: #7A6B7D;
  line-height: 1.8;
  margin-bottom: 16px;
}
.tips-box {
  background: linear-gradient(135deg, rgba(255,229,160,0.2), rgba(168,216,255,0.2));
  border-left: 4px solid #FF9ECD;
  border-radius: 0 16px 16px 0;
  padding: 16px 20px;
  margin-top: 12px;
}
.tips-box h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #5D4E60;
  margin-bottom: 10px;
}
.tips-box ul {
  list-style: none;
  padding: 0;
}
.tips-box li {
  font-size: 0.9rem;
  color: #7A6B7D;
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
}
.tips-box li::before {
  content: '✿';
  position: absolute;
  left: 0;
  color: #FF9ECD;
  font-weight: 700;
}

/* Related Games */
.related-section {
  padding: 28px 0;
}
.related-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: #5D4E60;
  background: linear-gradient(135deg, #FF9ECD, #C9B8FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 992px) { .related-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .related-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }

/* ===== Footer ===== */
.site-footer {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,158,205,0.2);
  padding: 32px 0;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a {
  font-size: 0.9rem;
  color: #7A6B7D;
  transition: all 0.3s ease;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
}
.footer-links a:hover { 
  color: #FF9ECD;
  background: rgba(255,158,205,0.1);
}
.footer-copy {
  font-size: 0.85rem;
  color: #9A8B9D;
}

/* ===== Info Pages (Contact/Policy/About) ===== */
.info-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 16px;
  flex: 1;
}
.info-page h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 24px;
  color: #5D4E60;
  background: linear-gradient(135deg, #FF9ECD, #A8D8FF, #C9B8FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.info-page h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 28px 0 12px;
  color: #5D4E60;
}
.info-page p {
  font-size: 1rem;
  color: #7A6B7D;
  line-height: 1.8;
  margin-bottom: 12px;
}
.info-page a {
  color: #FF9ECD;
  font-weight: 600;
}
.info-page a:hover { 
  text-decoration: underline;
  color: #A8D8FF;
}
.info-page ul {
  list-style: none;
  padding: 0;
}
.info-page li {
  padding: 8px 0 8px 24px;
  position: relative;
  color: #7A6B7D;
  font-size: 1rem;
  line-height: 1.7;
}
.info-page li::before {
  content: '✿';
  position: absolute;
  left: 4px;
  color: #FF9ECD;
  font-weight: 700;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(255,245,248,0.5); }
::-webkit-scrollbar-thumb { 
  background: linear-gradient(180deg, #FF9ECD, #A8D8FF); 
  border-radius: 10px; 
}
::-webkit-scrollbar-thumb:hover { 
  background: linear-gradient(180deg, #FFB8D9, #B8E8FF); 
}

/* ===== Selection ===== */
::selection {
  background: rgba(255,158,205,0.3);
  color: #5D4E60;
}
