/* =========================================================
   Base da interface — temas Escuro e Claro
   Barra do topo, abas, navegação inferior e a Central de jogos.
   As cores vêm dos tokens `--ui-*` (tokens.css): o tema claro
   só troca os tokens. O Mundo Colorido tem ajustes próprios em
   theme-kids.css, carregado depois deste arquivo.
   ========================================================= */

/* ---------- Fundo: noite quase lisa, com a aurora bem discreta ---------- */
:root[data-theme='dark'] .aurora { background: #0a0e17; }
:root[data-theme='dark'] .aurora__blob { opacity: 0.12; }
:root[data-theme='dark'] .aurora__blob--teal { opacity: 0.08; }
:root[data-theme='light'] .aurora { background: linear-gradient(180deg, #f3f5fc 0%, #eef1fb 100%); }
:root[data-theme='light'] .aurora__blob { opacity: 0.18; }

/* ---------- Topo: carteira, status e sino ---------- */
:root:not([data-theme='kids']) .wallet,
:root:not([data-theme='kids']) .sync-chip,
:root:not([data-theme='kids']) .notification-button {
  min-height: 38px;
  border: 1px solid var(--ui-line-strong);
  background: var(--ui-pill);
  box-shadow: var(--ui-inset), var(--ui-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
:root:not([data-theme='kids']) .wallet::before,
:root:not([data-theme='kids']) .sync-chip::before { display: none; }
:root:not([data-theme='kids']) .wallet {
  gap: 8px;
  min-width: 92px;
  padding: 4px 16px 4px 10px;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
:root:not([data-theme='kids']) .wallet--common { color: var(--ui-accent); }
:root:not([data-theme='kids']) .sync-chip { gap: 8px; padding: 6px 16px; font-size: 0.95rem; color: var(--text-secondary); }
:root:not([data-theme='kids']) .notification-button { width: 42px; height: 42px; font-size: 1.15rem; }
:root:not([data-theme='kids']) .notification-button__badge { border-color: var(--ui-pill); }

/* ---------- Abas (Diversão / Aprender, loja) ---------- */
:root:not([data-theme='kids']) .tabs {
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--ui-line-strong);
  border-radius: var(--r-pill);
  background: var(--ui-pill);
  box-shadow: var(--ui-inset), var(--ui-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
:root:not([data-theme='kids']) .tabs::before { display: none; }
:root:not([data-theme='kids']) .tab {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  color: var(--text-secondary);
  font-size: 1.02rem;
  font-weight: 600;
}
:root:not([data-theme='kids']) .tab.is-active {
  border-color: var(--ui-tab-active-line);
  background: var(--ui-tab-active);
  color: var(--ui-title);
  font-weight: 700;
  box-shadow: 0 0 22px -6px rgba(94, 230, 160, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ---------- Navegação inferior ---------- */
:root:not([data-theme='kids']) .nav {
  gap: 2px;
  padding: 6px 8px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 26px;
  background: var(--ui-nav);
  box-shadow: 0 -6px 26px -18px rgba(0, 0, 0, 0.6), 0 18px 40px -18px rgba(0, 0, 0, 0.8), var(--ui-inset);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
:root[data-theme='light'] .nav { box-shadow: 0 16px 36px -20px rgba(52, 44, 140, 0.4), var(--ui-inset); }
:root:not([data-theme='kids']) .nav::before { display: none; }
:root:not([data-theme='kids']) .nav__item {
  position: relative;
  gap: 2px;
  padding: 6px 2px 8px;
  border-radius: 18px;
  color: var(--text-muted);
  font-weight: 600;
}
:root:not([data-theme='kids']) .nav__item span:first-child { font-size: 1.25rem; line-height: 1; filter: var(--ui-icon-idle); transition: filter var(--t-fast) linear; }
:root:not([data-theme='kids']) .nav__item span:nth-child(2) { font-size: clamp(0.7rem, 3vw, 0.86rem); }
:root:not([data-theme='kids']) .nav__item.is-active { color: var(--ui-title); background: var(--ui-nav-active); }
:root:not([data-theme='kids']) .nav__item.is-active span:first-child { filter: none; }
:root:not([data-theme='kids']) .nav__item:not(.nav__item--pet).is-active::after {
  content: '';
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 2px;
  height: 3px;
  border-radius: 3px;
  background: var(--ui-accent-grad);
  box-shadow: 0 0 10px rgba(94, 230, 160, 0.6);
}
:root:not([data-theme='kids']) .nav__dot { top: 6px; right: 24%; border: 2px solid var(--ui-pill); }

/* Pet: círculo que sobe da barra, com aro em gradiente verde → roxo.
   O miolo é vidro opaco na cor do tema: o círculo passa por cima do palco e,
   transparente, deixava o cenário do pet aparecer através dele. Os tokens
   `--pet-*` são repetidos no estado ativo, que senão herdaria o fundo
   translúcido de `.nav__item.is-active`. */
:root:not([data-theme='kids']) {
  --pet-glass:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 44%, rgba(255, 255, 255, 0) 58%),
    radial-gradient(circle at 50% 120%, rgba(94, 230, 160, 0.26) 0%, rgba(94, 230, 160, 0) 62%),
    radial-gradient(circle at 50% 28%, #27314f 0%, #161d2c 58%, #10151f 100%);
  --pet-ring: linear-gradient(145deg, #6ff0a4 0%, #47c8f0 50%, #a26bff 100%);
  --pet-glass-edge: inset 0 1.5px 1px rgba(255, 255, 255, 0.28), inset 0 -8px 14px -6px rgba(0, 0, 0, 0.45);
}
:root[data-theme='light'] {
  --pet-glass:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.35) 46%, rgba(255, 255, 255, 0) 60%),
    radial-gradient(circle at 50% 120%, rgba(79, 227, 154, 0.3) 0%, rgba(79, 227, 154, 0) 62%),
    radial-gradient(circle at 50% 28%, #ffffff 0%, #f1f3ff 60%, #e3e8fa 100%);
  --pet-ring: linear-gradient(145deg, #4fe39a 0%, #3bb8ea 50%, #9a62ff 100%);
  --pet-glass-edge: inset 0 1.5px 1px #ffffff, inset 0 -8px 14px -6px rgba(90, 80, 200, 0.18);
}
:root:not([data-theme='kids']) .nav__item--pet,
:root:not([data-theme='kids']) .nav__item--pet.is-active {
  background: var(--pet-glass) padding-box, var(--pet-ring) border-box;
}
:root:not([data-theme='kids']) .nav__item--pet {
  flex: 0 0 62px;
  align-self: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  min-height: 0;
  margin: -22px 4px 0;
  padding: 0;
  border: 2.5px solid transparent;
  border-radius: 50%;
  color: var(--ui-title);
  box-shadow: var(--pet-glass-edge), 0 0 22px -4px rgba(94, 230, 160, 0.55), 0 0 30px -8px rgba(162, 107, 255, 0.7), 0 10px 22px -10px rgba(0, 0, 0, 0.8);
}
:root[data-theme='light'] .nav__item--pet {
  box-shadow: var(--pet-glass-edge), 0 0 20px -6px rgba(61, 200, 140, 0.6), 0 10px 22px -12px rgba(90, 70, 200, 0.55);
}
:root:not([data-theme='kids']) .nav__item--pet span:first-child { font-size: 1.45rem; filter: none; }
:root:not([data-theme='kids']) .nav__item--pet span:nth-child(2) { font-size: 0.78rem; font-weight: 700; }
:root:not([data-theme='kids']) .nav__item--pet.is-active {
  border-color: transparent;
  box-shadow: var(--pet-glass-edge), 0 0 0 4px rgba(94, 230, 160, 0.16), 0 0 26px -2px rgba(94, 230, 160, 0.6), 0 0 34px -8px rgba(162, 107, 255, 0.8);
}

/* =========================================================
   Central de jogos
   ========================================================= */

.games-home { gap: 14px; }

/* ---------- Herói ---------- */
.games-hero {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  padding: 18px 16px 14px;
  border: 1.5px solid var(--ui-hero-line);
  border-radius: 28px;
  background: var(--ui-hero);
  box-shadow: var(--ui-hero-glow);
  isolation: isolate;
}
.games-hero__art {
  position: absolute;
  z-index: -1;
  right: -6px;
  bottom: 0;
  width: 50%;
  max-width: 240px;
  height: 74%;
  pointer-events: none;
}
.games-hero__art svg { width: 100%; height: 100%; display: block; }
.games-hero__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-2); }
.games-hero__eyebrow,
.game-card__category,
.featured-game__category {
  color: var(--ui-accent);
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.games-hero__eyebrow { display: block; padding-top: 2px; font-size: 0.62rem; }
.games-hero .online-connections { position: absolute; top: 10px; right: 10px; }
.games-hero h2 {
  max-width: 60%;
  margin: 8px 0 4px;
  color: var(--ui-title);
  font-size: clamp(1.25rem, 5.4vw, 1.5rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.games-hero p {
  max-width: 56%;
  margin: 0;
  color: var(--ui-hero-text);
  font-size: 0.8rem;
  line-height: 1.25;
}
.games-hero__stats {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 3px 12px;
  border: 1px solid var(--ui-line-strong);
  border-radius: var(--r-pill);
  background: var(--ui-hero-pill);
  color: var(--ui-hero-text);
  font-size: 0.76rem;
}
.games-hero__stats > span { display: inline-flex; align-items: center; gap: 5px; }
.games-hero__stats > span + span { padding-left: 12px; border-left: 1px solid var(--ui-line-strong); }
.games-hero__stats strong { color: var(--ui-title); font-family: var(--font-display); font-size: 0.86rem; }
.games-hero__stat-icon { font-size: 0.9rem; filter: grayscale(1) brightness(1.6); }
:root[data-theme='light'] .games-hero__stat-icon { filter: grayscale(1) brightness(0.6); }

/* Amigos on-line: pílula no canto do herói. */
.online-connections {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-height: 36px;
  padding: 4px 10px 4px 10px;
  border: 1px solid rgba(140, 150, 255, 0.45);
  border-radius: var(--r-pill);
  background: var(--ui-hero-pill);
  color: var(--ui-title);
  font: inherit;
  cursor: pointer;
  transition: border-color var(--t-fast) linear, transform var(--t-fast) var(--ease-liquid);
}
.online-connections:hover { border-color: var(--ui-accent); transform: translateY(-1px); }
.online-connections::after { content: '›'; margin-left: 2px; color: var(--text-secondary); font-size: 1.2rem; line-height: 1; }
.online-connections__people { font-size: 1.05rem; filter: grayscale(1) brightness(1.7); }
:root[data-theme='light'] .online-connections__people { filter: grayscale(1) brightness(0.55); }
.online-connections__copy { display: grid; text-align: left; line-height: 1.15; }
.online-connections__copy strong { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-display); font-size: 0.78rem; }
.online-connections__copy strong::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ui-accent);
  box-shadow: 0 0 8px var(--ui-accent);
}
.online-connections__copy > span { margin-top: 1px; color: var(--text-secondary); font-size: 0.66rem; }
.online-connections__session { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ui-accent-soft); animation: waiting-pulse 1.8s ease-in-out infinite; }
.online-connections.has-session { border-color: color-mix(in srgb, var(--ui-accent) 70%, transparent); box-shadow: 0 0 18px -4px color-mix(in srgb, var(--ui-accent) 50%, transparent); }

/* ---------- Títulos de seção ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-top: 4px; }
.section-head__title { margin: 0; color: var(--ui-title); font-size: 1.32rem; font-weight: 700; letter-spacing: -0.005em; scroll-margin-top: 90px; }
.section-head__link {
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--ui-accent);
  font: 700 0.86rem var(--font-display);
  cursor: pointer;
}
.section-head__link span { font-size: 1.1rem; }
.featured-block { display: grid; gap: 10px; }
/* "Destaque do dia": quando o próximo jogo entra no destaque. */
.section-head__title small.section-head__meta { display: block; margin-top: 2px; color: var(--text-secondary); font: 600 .72rem var(--font-body); letter-spacing: 0; }
.featured-game__art img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Filtro "On-line": lista só os jogos que dá para jogar com amigos ao vivo. */
.game-filter--online { border-color: color-mix(in srgb, var(--ui-accent) 55%, transparent) !important; }
.game-filter--online.is-active { box-shadow: 0 0 14px -4px var(--ui-accent); }

/* ---------- Cartão "Em destaque" ---------- */
.featured-game {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 10px;
  padding: 8px 10px 8px 8px;
  border: 1px solid var(--ui-line);
  border-radius: 22px;
  background: var(--ui-card);
  box-shadow: var(--ui-inset), var(--ui-shadow);
}
.featured-game__art {
  display: block;
  min-height: 108px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: #6e5cf6;
  cursor: pointer;
}
.featured-game__art svg { display: block; width: 100%; height: 100%; }
.featured-game__info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    'cat dot'
    'name name'
    'desc desc'
    'chips cta';
  align-content: start;
  column-gap: 6px;
  min-width: 0;
  padding: 4px 0 2px;
}
.featured-game__category {
  grid-area: cat;
  justify-self: start;
  align-self: center;
  padding: 2px 10px;
  border: 1px solid color-mix(in srgb, var(--ui-accent) 55%, transparent);
  border-radius: var(--r-pill);
  background: var(--ui-accent-soft);
  font-size: 0.6rem;
}
.featured-game__dot { grid-area: dot; justify-self: end; }
.featured-game__name { grid-area: name; margin: 4px 0 2px; color: var(--ui-title); font-size: 1rem; font-weight: 700; line-height: 1.15; }
.featured-game__desc { grid-area: desc; margin: 0 0 6px; color: var(--text-secondary); font-size: 0.72rem; line-height: 1.25; }
.featured-game__chips .coop-badge, .featured-game__chips .best-chip { padding-inline: 7px; font-size: 0.6rem; }
.featured-game__chips { grid-area: chips; display: flex; flex-direction: column; align-items: stretch; gap: 5px; min-width: 0; }
.featured-game__cta {
  grid-area: cta;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--ui-accent-grad);
  color: var(--ui-accent-ink);
  font: 700 0.95rem var(--font-display);
  box-shadow: 0 10px 22px -10px rgba(94, 230, 160, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-liquid), filter var(--t-fast) linear;
}
.featured-game__cta:hover { filter: brightness(1.06); }
.featured-game__cta:active { transform: scale(0.96); }
.featured-game__cta:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 3px; }
.featured-game__cta-icon { font-size: 0.9rem; }

/* Botão redondo de "play" (destaque e cartões). */
.play-dot {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0 0 0 2px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 50%;
  background: var(--ui-chip);
  color: var(--ui-title);
  font-size: 0.7rem;
  line-height: 1;
  box-shadow: var(--ui-inset);
  cursor: pointer;
}

/* ---------- Chips: modo on-line e recorde ---------- */
.coop-badge,
.best-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 22px;
  padding: 1px 8px;
  border: 1px solid var(--ui-line-strong);
  border-radius: var(--r-pill);
  background: var(--ui-chip);
  font: 600 0.64rem var(--font-display);
  white-space: nowrap;
}
.coop-badge { overflow: hidden; color: var(--ui-accent); text-overflow: ellipsis; }
.coop-badge--solo { color: var(--text-secondary); }
.coop-badge__icon { font-size: 0.8rem; filter: grayscale(1) brightness(1.7); }
:root[data-theme='light'] .game-stage {
  /* Os jogos desenham fundo escuro: dentro do palco, textos e ícones voltam ao claro. */
  --text-primary: #f4f6ff;
  --text-secondary: rgba(244, 246, 255, 0.78);
  --text-muted: rgba(244, 246, 255, 0.58);
  --glass-border: rgba(255, 255, 255, 0.28);
  color: var(--text-primary);
}
/* Cartões de vidro no palco (pausa, continuar): escuros, para o texto claro aparecer. */
:root[data-theme='light'] .game-stage .glass { background: rgba(20, 24, 46, 0.86); border-color: rgba(255, 255, 255, 0.18); }
:root[data-theme='light'] .coop-badge__icon { filter: grayscale(1) brightness(0.55); }
.best-chip { justify-content: center; overflow: hidden; color: var(--text-secondary); }
.best-chip strong { color: var(--ui-trophy); font-size: 0.76rem; font-weight: 700; }
.best-chip__label { overflow: hidden; margin-left: 6px; text-overflow: ellipsis; }
.best-chip--wide { justify-content: flex-start; }

/* ---------- Filtros ---------- */
.game-filters { display: flex; gap: 6px; overflow-x: auto; padding: 2px 1px 4px; scrollbar-width: none; }
.game-filters::-webkit-scrollbar { display: none; }
.game-filter {
  flex: 1 0 auto;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--ui-line-strong);
  border-radius: var(--r-pill);
  background: var(--ui-chip);
  color: var(--text-secondary);
  font: 500 0.8rem var(--font-display);
  cursor: pointer;
  transition: background var(--t-fast) linear, color var(--t-fast) linear;
}
.game-filter.is-active {
  border-color: transparent;
  background: var(--ui-accent-grad);
  color: var(--ui-accent-ink);
  font-weight: 700;
  box-shadow: 0 8px 18px -10px rgba(94, 230, 160, 0.9);
}

/* ---------- Grade de jogos ---------- */
.game-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.game-card {
  --tone: linear-gradient(145deg, #4fe3b8 0%, #3aa9e6 58%, #6c63f0 100%);
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  grid-template-areas:
    'badge body'
    'meta meta';
  align-items: start;
  justify-content: stretch;
  gap: 8px;
  min-height: 0;
  padding: 8px;
  border: 1px solid var(--ui-line);
  border-radius: 18px;
  background: var(--ui-card);
  box-shadow: var(--ui-inset), var(--ui-shadow);
  text-align: left;
  font-weight: 400;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.game-card:hover { border-color: var(--ui-line-strong); box-shadow: var(--ui-inset), var(--ui-shadow); }
.game-card[data-tone='sky'] { --tone: linear-gradient(145deg, #5ad8e6 0%, #3c8ef0 60%, #6a5cf0 100%); }
.game-card[data-tone='violet'] { --tone: linear-gradient(145deg, #9d74ff 0%, #6e4cf2 55%, #c35af0 100%); }
.game-card[data-tone='coral'] { --tone: linear-gradient(145deg, #ff9d8c 0%, #f5606e 60%, #e0457a 100%); }
.game-card[data-tone='lime'] { --tone: linear-gradient(145deg, #baf06c 0%, #3fcf8a 100%); }
.game-card[data-tone='amber'] { --tone: linear-gradient(145deg, #ffd66e 0%, #ff9a4a 100%); }

/* Aventuras (Alameda da Vila, Defesa da Fronteira): primeiro na lista, em
   linha inteira, com ilustração própria, selo e uma borda de aurora que brilha. */
.game-card--adventure {
  grid-column: 1 / -1;
  grid-template-columns: 112px minmax(0, 1fr);
  border: 1.5px solid transparent;
  background:
    linear-gradient(var(--ui-card), var(--ui-card)) padding-box,
    linear-gradient(120deg, #3ddc97, #7dd3fc, #a78bfa, #f0abfc, #3ddc97) border-box;
  background-size: 100% 100%, 300% 100%;
  animation: adventure-border 6s linear infinite;
  box-shadow: var(--ui-inset), 0 10px 26px -14px rgba(125, 211, 252, .55);
}
.game-card--adventure:hover { box-shadow: var(--ui-inset), 0 14px 32px -12px rgba(167, 139, 250, .6); }
.game-card--adventure .game-card__badge { width: 112px; height: 84px; border-radius: 14px; }

.game-card__badge--cover::before { display: none; }
.game-card__ribbon {
  display: inline-block; margin-left: 6px; vertical-align: 1px;
  padding: 1px 7px; border-radius: 999px;
  background: linear-gradient(135deg, #fde68a, #f59e0b); color: #3b2300;
  font: 800 .6rem var(--font-display); letter-spacing: .03em; text-transform: uppercase;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .3);
}
@keyframes adventure-border { to { background-position: 0 0, 300% 0; } }
@media (prefers-reduced-motion: reduce) { .game-card--adventure { animation: none; } }

.game-card__badge {
  grid-area: badge;
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  overflow: hidden;
  border-radius: 13px;
  background: var(--tone);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -6px 12px rgba(0, 0, 0, 0.12), 0 8px 16px -10px rgba(0, 0, 0, 0.7);
}
.game-card__badge::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 25% 18%, rgba(255, 255, 255, 0.45), transparent 45%);
  pointer-events: none;
}
.game-card__badge svg { position: relative; width: 40px; height: 40px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.22)); }
/* Ilustração das aventuras: ocupa o quadro inteiro, sem a sombra dos ícones. */
.game-card__art { position: absolute; inset: 0; display: block; }
.game-card__badge .game-card__art svg { width: 100%; height: 100%; display: block; filter: none; }
.game-card__art img { display: block; width: 100%; height: 100%; object-fit: cover; }
html[data-theme='kids'] .game-card__badge .game-card__art svg { width: 100%; height: 100%; }
.game-icon__emoji { position: relative; font-size: 1.8rem; line-height: 1; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.22)); }

.game-card__body { grid-area: body; display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 1px 22px 0 0; }
.game-card__category { font-size: 0.56rem; letter-spacing: 0.1em; }
.game-card__name { color: var(--ui-title); font-family: var(--font-display); font-size: 0.84rem; font-weight: 700; line-height: 1.15; }
.game-card__desc {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 400;
  line-height: 1.25;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.game-card__meta { grid-area: meta; display: flex; align-items: center; gap: 6px; min-width: 0; }
.game-card__meta .coop-badge { flex: 1 1 auto; padding-inline: 7px; font-size: 0.6rem; }
.game-card__meta .best-chip { flex: 0 0 auto; min-width: 40px; padding-inline: 7px; }
.game-card__meta .best-chip--wide { flex: 1 1 auto; }
.game-card__play { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; font-size: 0.55rem; }

/* ---------- Favoritos ---------- */
/* O cartão fica dentro de um invólucro só para a estrela viver ao lado dele. */
.game-entry { position: relative; min-width: 0; display: grid; }
.game-entry--adventure { grid-column: 1 / -1; }
.game-entry > .game-card { min-width: 0; }
.game-card.is-favorite { border-color: rgba(251, 191, 36, .55); }
.game-card.is-favorite:not(.game-card--adventure) { box-shadow: var(--ui-inset), 0 0 0 1px rgba(251, 191, 36, .25), var(--ui-shadow); }

.fav-star {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 32px; height: 32px; padding: 0; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(15, 12, 40, .55); backdrop-filter: blur(4px);
  color: rgba(255, 255, 255, .75); font-size: 1.05rem; line-height: 1;
  touch-action: manipulation;
}
.fav-star:hover { color: #fde68a; border-color: rgba(253, 230, 138, .7); }
.fav-star:active { transform: scale(.9); }
.fav-star.is-on { color: #3b2300; background: linear-gradient(135deg, #fde68a, #f59e0b); border-color: transparent; box-shadow: 0 3px 10px rgba(245, 158, 11, .45); }
.fav-star:focus-visible { outline: 2px solid #fde68a; outline-offset: 2px; }
/* A estrela fica no canto do cartão: o ▶ de jogar desce para não competir com ela. */
.game-entry .game-card__play { top: 44px; }
.game-entry .game-card--adventure .game-card__play { top: 44px; }

.favorites-block { display: grid; gap: 10px; }
.favorites-block__star { color: #fbbf24; }
.favorites-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fav-entry { position: relative; min-width: 0; display: grid; }
.fav-tile, .quick-resume__tile {
  --tone: linear-gradient(145deg, #4fe3b8 0%, #3aa9e6 58%, #6c63f0 100%);
  position: relative; display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 8px 38px 8px 8px; text-align: left; font-weight: 400;
  border: 1px solid rgba(251, 191, 36, .5); border-radius: 18px;
  background: linear-gradient(135deg, rgba(251, 191, 36, .12), transparent 60%), var(--ui-card);
  box-shadow: var(--ui-inset), var(--ui-shadow);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.fav-tile:hover { border-color: rgba(253, 230, 138, .85); }
.fav-tile[data-tone='sky'], .quick-resume__tile[data-tone='sky'] { --tone: linear-gradient(145deg, #5ad8e6 0%, #3c8ef0 60%, #6a5cf0 100%); }
.fav-tile[data-tone='violet'], .quick-resume__tile[data-tone='violet'] { --tone: linear-gradient(145deg, #9d74ff 0%, #6e4cf2 55%, #c35af0 100%); }
.fav-tile[data-tone='coral'], .quick-resume__tile[data-tone='coral'] { --tone: linear-gradient(145deg, #ff9d8c 0%, #f5606e 60%, #e0457a 100%); }
.fav-tile[data-tone='lime'], .quick-resume__tile[data-tone='lime'] { --tone: linear-gradient(145deg, #baf06c 0%, #3fcf8a 100%); }
.fav-tile[data-tone='amber'], .quick-resume__tile[data-tone='amber'] { --tone: linear-gradient(145deg, #ffd66e 0%, #ff9a4a 100%); }
.fav-tile__badge { flex: 0 0 auto; width: 48px; height: 48px; }
.fav-tile__body { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.fav-tile__name { color: var(--ui-title); font: 700 .84rem/1.12 var(--font-display, system-ui); overflow-wrap: anywhere; }
.fav-tile__best { color: var(--text-secondary); font-size: .72rem; }
.fav-star--tile { top: 50%; right: 6px; transform: translateY(-50%); width: 28px; height: 28px; font-size: .95rem; }
.fav-star--tile:active { transform: translateY(-50%) scale(.9); }

/* "Continuar jogando": o último jogo aberto, a um toque, no alto da lista. */
.quick-resume { display: grid; gap: 10px; }
.quick-resume__tile {
  padding-right: 12px; border-color: rgba(94, 234, 212, .55);
  background: linear-gradient(135deg, rgba(94, 234, 212, .14), transparent 62%), var(--ui-card);
}
.quick-resume__tile:hover { border-color: rgba(153, 246, 228, .9); }
.quick-resume__body { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.quick-resume__name { color: var(--ui-title); font: 700 .95rem/1.15 var(--font-display, system-ui); overflow-wrap: break-word; }
.quick-resume__meta { color: var(--text-secondary); font-size: .74rem; }
.quick-resume__play {
  flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--tone); color: #fff; font-size: .9rem; box-shadow: 0 6px 14px rgba(0, 0, 0, .18);
}

/* Telas estreitas: destaque empilhado e grade de uma coluna. */
@media (max-width: 380px) {
  .games-hero h2, .games-hero p { max-width: 70%; }
  .online-connections__copy > span { display: none; }
  .featured-game { grid-template-columns: 1fr; }
  .featured-game__art { aspect-ratio: 300 / 170; }
  .game-list { grid-template-columns: 1fr; }
  .favorites-grid { grid-template-columns: 1fr; }
}

/* Celulares estreitos: a barra do topo encolhe sem esmagar o status. */
@media (max-width: 400px) {
  :root:not([data-theme='kids']) .wallet { min-width: 0; padding-inline: 10px 12px; font-size: 1rem; }
  :root:not([data-theme='kids']) .sync-chip { padding-inline: 12px; }
  .featured-game__art { max-height: 140px; }
}
:root:not([data-theme='kids']) .sync-chip::after { flex-shrink: 0; }
