/* Marilia Kids — Cantinho dos jogos */
.games-wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px 90px; }
.games-box {
  border-radius: 40px; padding: 48px; color: var(--ink);
  background: linear-gradient(135deg, #FFF3C4 0%, #FFD6E7 45%, #CFE6FF 100%);
  box-shadow: 0 6px 0 rgba(124, 77, 255, .15), 0 30px 60px rgba(124, 77, 255, .15);
}
.games-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.games-head h2 { margin: 6px 0 0; font-family: 'Fredoka', sans-serif; font-size: 42px; letter-spacing: -.5px; }
.games-head p { margin: 8px 0 0; font-size: 17px; color: #5E4F48; max-width: 520px; }
.eyebrow { color: #C2410C; font-weight: 800; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; }
.free-tag { display: inline-flex; align-items: center; gap: 8px; background: #fff; border-radius: 999px; padding: 8px 16px; font-weight: 800; font-size: 14px; color: #15803D; box-shadow: 0 4px 0 rgba(21, 128, 61, .15); }

.tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.tab {
  font: inherit; font-weight: 800; font-size: 16px; display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 16px; border: 2px solid transparent; background: rgba(255, 255, 255, .7); color: var(--ink); cursor: pointer;
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1), background .2s;
}
.tab:hover { transform: translateY(-3px) rotate(-1deg); background: #fff; }
.tab[aria-selected="true"] { background: var(--ink); color: #fff; }
.panel { background: #fff; border-radius: 28px; padding: 28px; }
.panel[hidden] { display: none; }
.hud { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; font-weight: 800; }
.hud-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.pill { background: #FFF1D6; border-radius: 999px; padding: 8px 16px; font-variant-numeric: tabular-nums; }
.gbtn {
  font: inherit; font-weight: 800; font-size: 16px; border: 0; border-radius: 14px; padding: 12px 22px; cursor: pointer;
  background: var(--orange); color: var(--ink); transition: transform .2s cubic-bezier(.3, 1.6, .5, 1), box-shadow .2s;
}
.gbtn:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 10px 22px rgba(255, 122, 26, .45); }
.gbtn:active { transform: scale(.95); }
.gbtn.alt { background: #fff; border: 2px solid var(--ink); }
.hint { margin: 14px 0 0; color: #6B5C55; font-size: 15px; }

/* memória */
.memory { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 560px; margin: 0 auto; }
.mcard { position: relative; aspect-ratio: 1 / 1; border: 0; padding: 0; background: none; cursor: pointer; perspective: 600px; font: inherit; }
.mface {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 20px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .45s cubic-bezier(.3, 1.3, .5, 1);
}
.mfront { background: linear-gradient(135deg, #FF7A1A, #FF3D81); font-size: 30px; color: #fff; box-shadow: 0 5px 0 rgba(190, 24, 93, .35); }
.mback { background: #fff; border: 3px solid #E9D5FF; font-size: clamp(32px, 7vw, 52px); transform: rotateY(180deg); }
.mcard.open .mfront, .mcard.done .mfront { transform: rotateY(-180deg); }
.mcard.open .mback, .mcard.done .mback { transform: rotateY(0); }
.mcard.done .mback { background: #DCFCE7; border-color: #16A34A; }
.mcard:hover:not(.open):not(.done) .mfront { transform: translateY(-4px) rotate(-2deg); }
.mcard:disabled { cursor: default; }

/* estrelas */
.arena {
  position: relative; height: 340px; border-radius: 22px; overflow: hidden; touch-action: manipulation;
  background: radial-gradient(circle at 20% 20%, #5B2EFF 0%, #2B1A7A 60%, #160F45 100%); color: #fff;
}
.arena-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 20px; font-weight: 800; font-size: 20px; }
.star-btn {
  position: absolute; width: 56px; height: 56px; border: 0; background: none; padding: 0; cursor: pointer; font-size: 44px; line-height: 1;
  animation: starIn .25s cubic-bezier(.3, 1.6, .5, 1) both; filter: drop-shadow(0 0 10px #FFD83D);
}
.star-btn:hover { transform: scale(1.2); }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); } to { transform: scale(1) rotate(0); } }

/* pintura */
.paint { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; }
.tools { display: flex; flex-direction: column; gap: 12px; }
.swatches { display: grid; grid-template-columns: repeat(4, 40px); gap: 8px; }
.sw { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #E5D5C8; cursor: pointer; transition: transform .15s; padding: 0; }
.sw:hover { transform: scale(1.15); }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 4px var(--ink); transform: scale(1.1); }
.sizes { display: flex; gap: 8px; }
.sz { width: 40px; height: 40px; border-radius: 12px; border: 2px solid #E5D5C8; background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.sz i { display: block; background: var(--ink); border-radius: 50%; }
.sz[aria-pressed="true"] { border-color: var(--ink); background: #FFF1D6; }
.canvas-wrap { border-radius: 20px; overflow: hidden; border: 3px dashed #C4B5FD; background: #fff; line-height: 0; }
#paint-canvas { width: 100%; height: auto; touch-action: none; cursor: crosshair; display: block; }

@media (max-width: 820px) {
  .games-box { padding: 28px 18px; border-radius: 28px; }
  .games-head h2 { font-size: 34px; }
  .panel { padding: 16px; }
  .paint { grid-template-columns: 1fr; }
  .tools { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .swatches { grid-template-columns: repeat(8, 34px); gap: 6px; }
  .sw { width: 34px; height: 34px; }
  .arena { height: 300px; }
}
@media (prefers-reduced-motion: reduce) {
  .mface, .star-btn { transition: none; animation: none; }
}
