:root {
  --bg: #07111f;
  --bg-soft: #0e1b2f;
  --surface: rgba(18, 34, 56, 0.9);
  --surface-solid: #132642;
  --surface-hover: #1b3457;
  --text: #f5f8ff;
  --muted: #abc0dc;
  --line: rgba(173, 205, 245, 0.18);
  --primary: #67d6ff;
  --primary-strong: #2db3e9;
  --accent: #ffbd59;
  --success: #62dc97;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

:root[data-theme='light'] {
  --bg: #f4f8ff;
  --bg-soft: #e8f2ff;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-solid: #ffffff;
  --surface-hover: #f4f9ff;
  --text: #13243b;
  --muted: #55708f;
  --line: rgba(38, 81, 125, 0.16);
  --primary: #087eb3;
  --primary-strong: #056d9d;
  --accent: #dc8611;
  --success: #078c4d;
  --shadow: 0 16px 40px rgba(36, 77, 120, 0.15);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% -5%, rgba(69, 166, 255, 0.26), transparent 30rem),
    radial-gradient(circle at 95% 15%, rgba(156, 93, 255, 0.2), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, input { font: inherit; }

a { color: inherit; }

.skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 100;
  padding: .75rem 1rem;
  border-radius: .6rem;
  background: var(--text);
  color: var(--bg);
}

.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.header-inner,
.container {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.header-inner {
  min-height: 4.8rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: .02em;
}

.brand img {
  width: 2.3rem;
  height: 2.3rem;
  object-fit: cover;
  border-radius: .7rem;
  box-shadow: 0 7px 16px rgba(49, 157, 225, .28);
}

.brand span { font-size: 1.03rem; }

.menu-toggle,
.icon-button,
.favorite-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background-color .2s ease;
}

.menu-toggle:hover,
.icon-button:hover,
.favorite-button:hover { transform: translateY(-1px); border-color: var(--primary); }

.menu-toggle {
  display: none;
  padding: .52rem .65rem;
  border-radius: .6rem;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-left: auto;
}

.primary-nav a {
  padding: .55rem .72rem;
  border-radius: .55rem;
  color: var(--muted);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 750;
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
  background: var(--surface);
  color: var(--text);
}

.header-actions { display: flex; gap: .45rem; align-items: center; }

.favorite-button,
.icon-button {
  min-height: 2.35rem;
  border-radius: .65rem;
  padding: .42rem .65rem;
}

.favorite-button { display: inline-flex; align-items: center; gap: .25rem; font-size: .86rem; white-space: nowrap; text-decoration: none; }
.favorite-button.is-active { border-color: #ff6688; background: rgba(255, 102, 136, .14); color: var(--text); }

.icon-button { width: 2.35rem; padding: .35rem; font-size: 1.06rem; }

.hero { padding: clamp(3.8rem, 8vw, 7rem) 0 3.5rem; }

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 6vw, 5rem);
  border: 1px solid var(--line);
  border-radius: 1.7rem;
  background:
    linear-gradient(115deg, rgba(13, 31, 53, .96), rgba(23, 54, 90, .78)),
    url('../img/fundo.png') center / cover;
  box-shadow: var(--shadow);
}

:root[data-theme='light'] .hero-panel {
  background:
    linear-gradient(115deg, rgba(242, 249, 255, .96), rgba(207, 232, 255, .85)),
    url('../img/fundo.png') center / cover;
}

.hero-panel::after {
  content: '';
  position: absolute;
  width: 21rem;
  height: 21rem;
  right: -8rem;
  bottom: -12rem;
  border: 2.5rem solid rgba(103, 214, 255, .15);
  border-radius: 50%;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 .85rem;
  color: var(--primary);
  font-size: .8rem;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.hero h1,
.section-heading h2 { margin: 0; letter-spacing: -.04em; }

.hero h1 {
  max-width: 10ch;
  font-size: clamp(2.85rem, 8vw, 5.75rem);
  line-height: .93;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 40rem;
  margin: 1.15rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.16rem);
}

.hero-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.65rem; }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.8rem;
  padding: .7rem 1rem;
  border: 1px solid transparent;
  border-radius: .75rem;
  font-weight: 850;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.button:hover { transform: translateY(-2px); }

.button-primary { background: var(--primary); color: #052339; box-shadow: 0 10px 25px rgba(49, 176, 233, .25); }
.button-primary:hover { background: var(--primary-strong); }
.button-secondary { border-color: var(--line); background: var(--surface); color: var(--text); }

.search-section { padding-bottom: 1rem; }
.search-section + .curated-section { padding-top: 1.4rem; }

.search-box {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .35rem .45rem .35rem 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(103, 214, 255, .12), var(--shadow); }
.search-box span { font-size: 1.15rem; }
.search-box input { width: 100%; border: 0; outline: 0; padding: .7rem 0; background: transparent; color: var(--text); }
.search-box input::placeholder { color: var(--muted); opacity: .85; }
.search-status { min-height: 1.25rem; margin: .6rem .3rem 0; color: var(--muted); font-size: .82rem; }

.content-section { padding: 3.7rem 0 0; }
.content-section:last-of-type { padding-bottom: 4rem; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.section-heading h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.section-heading p { max-width: 37rem; margin: 0; color: var(--muted); font-size: .93rem; text-align: right; }
.section-heading-with-action { align-items: center; }
.section-heading-copy { min-width: 0; }
.section-heading-copy p { margin-top: .3rem; text-align: left; }
.section-heading-with-action .catalog-reset { flex: 0 0 auto; }

.category-list {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: .65rem;
}

.category-chip {
  display: flex;
  min-height: 4.7rem;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: .22rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background-color .2s ease;
}

.category-chip:hover,
.category-chip:focus-visible { transform: translateY(-3px); border-color: var(--primary); background: var(--surface-hover); }
.category-chip.is-selected,
.category-chip[aria-pressed='true'] { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 15%, var(--surface)); box-shadow: 0 0 0 3px rgba(103, 214, 255, .1); }
.category-chip span:last-child { font-size: .8rem; font-weight: 800; }

.game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.game-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.game-card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--primary) 70%, transparent); box-shadow: var(--shadow); }

.card-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #164a71, #633f96);
}

.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.game-card:hover .card-cover img { transform: scale(1.06); }

.cover-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: linear-gradient(135deg, #164a71, #633f96);
  color: white;
  font-size: 3rem;
}

.type-badge {
  position: absolute;
  top: .65rem;
  left: .65rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .5rem;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 99px;
  background: rgba(5, 18, 32, .78);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.type-badge::before { content: ''; width: .45rem; height: .45rem; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 .18rem rgba(98, 220, 151, .15); }

.exclusive-badge {
  position: absolute;
  bottom: .6rem;
  left: .6rem;
  max-width: calc(100% - 1.2rem);
  overflow: hidden;
  padding: .3rem .5rem;
  border: 1px solid rgba(255, 216, 95, .48);
  border-radius: 99px;
  background: rgba(32, 23, 6, .84);
  color: #fff3aa;
  font-size: .68rem;
  font-weight: 850;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-favorite {
  position: absolute;
  top: .55rem;
  right: .55rem;
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  background: rgba(5, 18, 32, .78);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
}

.card-favorite[aria-pressed='true'] { color: #ff6688; background: #fff; }

.card-body { display: flex; flex: 1; flex-direction: column; padding: 1rem; }
.card-body h3 { overflow: hidden; margin: 0; color: var(--text); font-size: 1.02rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { margin: .45rem 0 0; color: var(--muted); font-size: .83rem; font-weight: 700; }
.stars { margin: .6rem 0 1rem; color: var(--accent); font-size: .94rem; letter-spacing: .04em; }
.card-local-stats { margin: -.3rem 0 .8rem; color: var(--muted); font-size: .76rem; font-weight: 750; line-height: 1.35; }
.card-body .button { width: 100%; margin-top: auto; min-height: 2.45rem; padding: .55rem .75rem; font-size: .86rem; }

.catalog-summary { display: flex; align-items: center; justify-content: end; gap: .75rem; }
.catalog-summary p { margin: 0; color: var(--muted); font-size: .93rem; text-align: right; }

.catalog-reset {
  min-height: 2.35rem;
  padding: .45rem .7rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: .82rem;
  font-weight: 800;
}

.catalog-reset:hover { border-color: var(--primary); background: var(--surface-hover); }

.empty-state {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.35rem;
  border: 1px dashed var(--line);
  border-radius: .8rem;
  background: var(--surface);
  color: var(--muted);
}

.empty-state > span { font-size: 1.65rem; }
.empty-state strong { display: block; color: var(--text); }
.empty-state p { margin: .15rem 0 0; font-size: .9rem; }
.empty-state .button { flex: 0 0 auto; }

body.is-filtering .curated-section { display: none; }

.achievement-toast-region {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  width: min(22rem, calc(100% - 2rem));
  pointer-events: none;
}

.achievement-toast {
  display: grid;
  gap: .2rem;
  padding: .9rem 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: .9rem;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  color: var(--text);
  animation: achievement-toast-in .22s ease-out;
}

.achievement-toast strong { font-size: .88rem; }
.achievement-toast span { color: var(--muted); font-size: .8rem; }
.achievement-toast.is-leaving { opacity: 0; transform: translateY(.4rem); transition: opacity .2s ease, transform .2s ease; }

@keyframes achievement-toast-in {
  from { opacity: 0; transform: translateY(.5rem); }
  to { opacity: 1; transform: translateY(0); }
}

.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: min(1180px, calc(100% - 2rem)); min-height: 7rem; margin: 0 auto; }
.footer-inner p { margin: 0; color: var(--muted); font-size: .88rem; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: end; gap: 1rem; }
.footer-nav a { color: var(--text); font-size: .88rem; font-weight: 750; text-decoration: none; }
.footer-nav a:hover { color: var(--primary); }

.central-home-section { padding-top: 1rem; }
.central-home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.central-home-card { display: flex; flex-direction: column; min-width: 0; min-height: 13.5rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 1rem; background: linear-gradient(145deg, color-mix(in srgb, var(--surface-solid) 94%, transparent), color-mix(in srgb, var(--bg-soft) 80%, transparent)); color: var(--text); text-decoration: none; transition: transform .2s ease, border-color .2s ease, background-color .2s ease; }
.central-home-card:hover, .central-home-card:focus-visible { border-color: var(--primary); background: var(--surface-hover); transform: translateY(-3px); }
.central-home-icon { display: grid; width: 3rem; height: 3rem; place-items: center; border-radius: .85rem; background: color-mix(in srgb, var(--primary) 14%, var(--surface)); font-size: 1.45rem; }
.central-home-card strong { display: block; margin-top: 1rem; font-size: 1.08rem; }
.central-home-card > span:last-child { display: block; margin-top: .5rem; color: var(--muted); line-height: 1.5; }
.central-home-action { display: flex; justify-content: center; margin-top: 1rem; }

/* Reserva inerte para uma possível integração publicitária futura. Sem um provedor
   configurado, os slots não carregam conteúdo nem ocupam espaço no layout. */
.ad-slot { display: none; }

@media (max-width: 980px) {
  .category-list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .header-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; min-height: 4.3rem; gap: .55rem; }
  .brand { min-width: 0; }
  .menu-toggle { display: inline-flex; grid-column: 3; margin-left: 0; }
  .primary-nav { display: none; grid-column: 1 / -1; width: 100%; margin: 0 0 .75rem; padding: .45rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface); }
  .primary-nav.is-open { display: grid; grid-template-columns: repeat(2, 1fr); }
  .primary-nav a { padding: .7rem; }
  .header-actions { grid-column: 2; margin-left: 0; }
  .favorite-button { min-width: 2.35rem; font-size: 0; }
  .favorite-button .favorite-icon { font-size: 1rem; }
  .favorite-button .favorite-count { margin-left: .2rem; font-size: .76rem; }
  .hero { padding-top: 2.2rem; }
  .hero-panel { border-radius: 1.15rem; }
  .section-heading { align-items: start; flex-direction: column; }
  .section-heading p { max-width: 100%; overflow-wrap: anywhere; text-align: left; }
  .section-heading-with-action .catalog-reset { align-self: flex-start; }
  .catalog-summary { justify-content: start; }
}

@media (max-width: 620px) {
  .header-inner,
  .container,
  .footer-inner { width: calc(100% - 1.25rem); max-width: 1180px; }
  .hero-panel,
  .search-box { max-width: 100%; min-width: 0; }
  .hero-copy { overflow-wrap: anywhere; }
  .category-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .category-chip { min-height: 4.25rem; padding: .6rem; }
  .card-body { padding: .8rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .button { width: 100%; }
  .empty-state { align-items: start; flex-direction: column; }
  .empty-state .button { width: 100%; }
  .footer-inner { align-items: start; flex-direction: column; justify-content: center; padding: 1.2rem 0; }
  .footer-nav { justify-content: start; }
  .central-home-grid { grid-template-columns: 1fr; }
  .central-home-card { min-height: 0; }
  .central-home-action .button { width: 100%; }
}

@media (max-width: 390px) {
  .brand span { font-size: .94rem; }
  .header-actions { gap: .3rem; }
  .icon-button { width: 2.25rem; }
  .game-grid { grid-template-columns: 1fr; }
}
