/* Reset básico */
* {
  box-sizing: border-box;
  margin: 0; padding: 0;
  font-family: 'Comic Sans MS', cursive, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #a6c1ee 0%, #fbc2eb 100%);
  color: #222;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header {
  width: 100%;
  max-width: 720px;
  background: #fff8f0cc;
  padding: 0.6rem 1rem 0.3rem;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  position: sticky;
  top: 0;
  z-index: 200;
}

.header-top h1 {
  font-size: 1.7rem;
  color: #2c3e50;
  flex-grow: 1;
  min-width: 160px;
  line-height: 1.2;
}

.header-top .slogan {
  font-style: italic;
  font-weight: 500;
  font-size: 0.9rem;
  color: #7f8c8d;
  min-width: 160px;
  text-align: center;
  line-height: 1.1;
}

#graca-counter {
  font-weight: 600;
  font-size: 1rem;
  color: #e67e22;
  min-width: 120px;
  text-align: right;
  user-select: text;
  letter-spacing: 1px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.main-menu {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.menu-btn {
  background: linear-gradient(145deg, #f9e2e7, #ffd6dc);
  border: 2px solid #f3a6b3;
  border-radius: 1.3rem;
  padding: 0.8rem 1.3rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: #b34252;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(243, 166, 179, 0.7);
  transition: all 0.3s ease;
  user-select: none;
}

.menu-btn:hover,
.menu-btn:focus {
  background: #ff9aa2;
  border-color: #ff4d6d;
  color: #fff;
  outline: none;
  box-shadow: 0 8px 20px #ff4d6daa;
}

.menu-btn.active {
  background: #ff4d6d;
  border-color: #ff1a3d;
  color: #fff;
  box-shadow: 0 10px 28px #ff1a3dcc;
}

main {
  width: 100%;
  max-width: 720px;
  padding: 1rem 1rem 3rem 1rem;
  min-height: 60vh;
  user-select: none;
}

.submenu {
  display: none;
  animation: fadeIn 0.5s ease forwards;
  font-size: 1.15rem;
  padding: 1rem;
  background: #fff9f6dd;
  border-radius: 1rem;
  box-shadow: 0 6px 14px rgb(243 166 179 / 0.3);
  color: #333;
}

.submenu.ativo {
  display: block;
}

.submenu button {
  background: linear-gradient(145deg, #f9e2e7, #ffd6dc);
  border: 2px solid #f3a6b3;
  border-radius: 1rem;
  padding: 0.7rem 1.3rem;
  margin: 0.5rem 0.4rem 0 0;
  font-weight: 700;
  font-size: 1.1rem;
  color: #b34252;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(243, 166, 179, 0.7);
  transition: all 0.3s ease;
  user-select: none;
}

.submenu button:hover,
.submenu button:focus {
  background: #ff9aa2;
  border-color: #ff4d6d;
  color: #fff;
  outline: none;
  box-shadow: 0 8px 20px #ff4d6daa;
}

/* Fade in keyframe */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Canvas particulas */
#particulas {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 50;
  background: transparent;
}

/* Grid de joguinhos (NOVO) */
.joguinhos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.game-card {
  background: linear-gradient(145deg, #ffecd2, #fcb69f);
  border-radius: 20px;
  border: 2px solid #ffb347;
  box-shadow: 0 8px 15px rgba(255, 179, 71, 0.6);
  color: #6b2d00;
  font-weight: 700;
  font-size: 1.6rem;
  cursor: pointer;
  user-select: none;
  padding: 1.4rem 0.6rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card span {
  font-size: 0.95rem;
  margin-top: 0.5rem;
  color: #4e2600;
}

.game-card:hover {
  transform: translateY(-6px) scale(1.04);
  box-shadow: 0 10px 22px rgba(255, 179, 71, 0.9);
}

/* Animação sutil */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 179, 71, 0.6); }
  50% { box-shadow: 0 0 20px 10px rgba(255, 179, 71, 0.9); }
}
.joguinhos-grid .game-card:first-child {
  animation: pulse 3s infinite ease-in-out;
}

/* Mobile */
@media (max-width: 600px) {
  .joguinhos-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.8rem;
  }

  .game-card {
    font-size: 1.3rem;
    padding: 1rem 0.4rem;
    border-radius: 16px;
  }

  .game-card span {
    font-size: 0.85rem;
  }
}


/* Animação de pulso */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 179, 71, 0.6);
  }
  50% {
    box-shadow: 0 0 20px 8px rgba(255, 179, 71, 0.9);
  }
}

.joguinhos-grid .game-card:nth-child(1) {
  animation: pulse 2.5s infinite ease-in-out;
}

/* Responsivo */
@media (max-width: 600px) {
  .header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .header-top h1 {
    font-size: 1.4rem;
    min-width: 100%;
    text-align: left;
  }

  .header-top .slogan {
    font-size: 0.85rem;
    text-align: left;
    min-width: 100%;
  }

  #graca-counter {
    font-size: 0.95rem;
    text-align: left;
    min-width: 100%;
    margin-top: 0.2rem;
  }

  .menu-btn {
    font-size: 0.95rem;
    padding: 0.5rem 0.9rem;
  }

  .game-card {
    font-size: 1.3rem;
    padding: 1rem 0;
    border-radius: 16px;
  }

  .game-card span {
    font-size: 0.9rem;
  }

  main {
    padding: 0.8rem 0.6rem 1.5rem 0.6rem;
  }
}
footer {
  background: linear-gradient(to right, #d1e9ff, #f0f8ff);
  text-align: center;
  padding: 20px;
  font-family: 'Comic Sans MS', cursive, sans-serif;
  color: #4b4b4b;
  border-top: 2px solid #a0d2eb;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  animation: fadeInFooter 2s ease-in-out;
  position: relative;
  bottom: 0;
  width: 100%;
}

footer p {
  margin: 8px 0;
  font-size: 1rem;
  animation: floatText 5s infinite ease-in-out;
}

@keyframes fadeInFooter {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes floatText {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
}
#anuncios {
  background: linear-gradient(to bottom, #fffdf5, #fff7db);
  padding: 40px 20px;
  text-align: center;
}

#anuncios h2 {
  font-size: 1.8rem;
  color: #444;
  margin-bottom: 24px;
  font-weight: bold;
}

.carrossel-container {
  position: relative;
  max-width: 320px;
  margin: 0 auto;
  overflow: hidden;
}

.carrossel-anuncios {
  display: flex;
  transition: transform 0.4s ease;
  will-change: transform;
}

.anuncio-card {
  min-width: 100%;
  background: white;
  border-radius: 16px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
  margin: 0 8px;
  flex-shrink: 0;
  text-align: center;
}

.anuncio-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.anuncio-card img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: 16px 16px 0 0;
}

.anuncio-card h3 {
  font-size: 1.1rem;
  margin: 10px 0 5px;
  color: #333;
}

.anuncio-card p {
  font-size: 0.9rem;
  color: #666;
  padding-bottom: 12px;
}

.btn-carrossel {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #ffd700;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.4rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  color: #333;
  transition: background-color 0.3s ease;
  user-select: none;
  z-index: 10;
}

.btn-carrossel:hover {
  background: #ffca00;
}

#prevBtn {
  left: 5px;
}

#nextBtn {
  right: 5px;
}

/* Versão desktop: mostra 3 cards e remove botões */
@media (min-width: 1024px) {
  .carrossel-container {
    max-width: 1400px;  /* container largo o suficiente */
    margin: 0 auto;
  }

  .carrossel-anuncios {
    justify-content: center;  /* centraliza os cards */
    transform: none !important;
    overflow: visible;
  }

  .anuncio-card {
    min-width: 260px;  /* largura fixa para cada card */
    max-width: 260px;
    margin: 0 12px;
  }

  .btn-carrossel {
    display: none;
  }
}
