/* Layout Fix — Sticky Footer */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
}

/* Background — Ultimate smooth light pastel rainbow */
body {
  font-family: "Comic Sans MS", Arial, sans-serif;
  color: #222;
  background: linear-gradient(
    270deg,
    #FFE4E1, #FFD1DC, #FFCCE5,
    #FFDAB9, #FFE4B5, #FFEFD5,
    #FFFFD1, #FFFACD, #FFF5BA,
    #B2F7EF, #D4F1BE, #E0FFE0,
    #C1E1FF, #ADD8E6, #B0E0E6,
    #E4C1F9, #F0EAFF, #E6E6FA,
    #FFFFFF, #F5F5F5, #FAFAFA
  );
  background-size: 10000% 500%;
  animation: gradientFlow 80s linear infinite;
}

@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Header — thinner version, flush edges */
header {
  background: #4ec8ff;
  color: white;
  padding: 15px 0;
  margin: 0;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  width: 100%;
}

header h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: 2px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
  margin: 0;
  font-size: 1rem;
}

/* --- NEW 3-COLUMN SIDE AD LAYOUT SYSTEM --- */
.page-layout {
  display: flex;
  flex: 1;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  gap: 20px;
  padding: 20px;
  box-sizing: border-box;
}

main {
  flex: 1; /* Pushes to fill center completely */
  padding: 0;
}

/* Sidebar Containers */
.side-ad {
  width: 160px;
  min-width: 160px;
  height: 600px;
  margin-top: 80px; /* Aligns visually with the grid section */
}

/* Placeholder Styling */
.ad-placeholder {
  background-color: rgba(255, 255, 255, 0.6);
  color: #777;
  border: 2px dashed #4ec8ff;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: Arial, sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  writing-mode: vertical-rl; /* Rotates the text nicely down the banner */
  text-orientation: mixed;
  width: 100%;
  height: 100%;
}

/* --- MOBILE RESPONSIVENESS FIX --- */
/* If the screen width is 1100px or narrower, completely hide the side ads */
@media (max-width: 1100px) {
  .side-ad {
    display: none !important;
  }
  .page-layout {
    padding: 10px;
  }
}

/* --- GAME GRID & CARDS --- */
.section-title {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 30px;
  color: #222;
  text-shadow: 1px 1px 3px rgba(255,255,255,0.7);
}

.game-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
}

.game-card {
  padding: 25px 10px;
  border-radius: 20px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: bold;
  color: #333;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 3px solid transparent;
  background-image: linear-gradient(45deg, #ff6f61, #ffcc00, #66bb6a, #42a5f5, #ab47bc);
  background-origin: border-box;
  background-clip: border-box;
  text-decoration: none;
  display: block;
}

.game-card:hover {
  transform: scale(1.12) rotate(1deg);
  box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

/* Footer — flush edges */
footer {
  background: #4ec8ff;
  color: white;
  padding: 20px 0;
  margin: 0;
  width: 100%;
  text-align: center;
  font-size: 1.1rem;
  letter-spacing: 1px;
  box-shadow: 0 -3px 10px rgba(0,0,0,0.2);
  margin-top: auto;
}