@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --bg: #f6f5ff;
  --surface: #ffffff;
  --surface-2: #efedfa;
  --text: #241c45;
  --muted: #6e668c;
  --purple: #6c4dff;
  --pink: #e95b8b;
  --cyan: #18bda6;
  --green: #02a98f;
  --yellow: #f6a900;
  --radius: 22px;
  --shadow: 0 13px 32px #3f2a7b18;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background:
    radial-gradient(circle at 6% 0, #dbd5ff 0, transparent 27rem),
    radial-gradient(circle at 96% 8%, #cef7ee 0, transparent 30rem), var(--bg);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  line-height: 1.5;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
.container {
  width: min(1180px, calc(100% - 32px));
  margin: auto;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #ffffffdf;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid #e1ddf1;
}
.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 900;
  font-size: 1.32rem;
  letter-spacing: -0.8px;
}
.logo-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  border-radius: 11px;
  background: linear-gradient(135deg, #7d64ff, #5c42ee);
  box-shadow: 0 5px 0 #4430bb39;
}
.nav {
  display: flex;
  gap: 20px;
  color: var(--muted);
  font-size: 0.92rem;
}
.nav a:hover,
.nav a:focus {
  color: var(--purple);
}
.header-action {
  margin-left: auto;
}
.btn {
  border: 0;
  border-radius: 12px;
  color: #fff;
  font-weight: 800;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--purple), #6d45e9);
  box-shadow: 0 8px 20px #7045d14c;
  transition:
    transform 0.2s,
    filter 0.2s;
}
.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}
.btn.secondary {
  background: #ffffff12;
  box-shadow: none;
  border: 1px solid #ffffff1e;
}
.btn.large {
  padding: 14px 23px;
  font-size: 1rem;
}
.hero {
  padding: 76px 0 56px;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 36px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.eyebrow:before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(2.45rem, 6vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -0.065em;
  margin: 13px 0 18px;
  max-width: 740px;
}
.gradient-text {
  background: linear-gradient(100deg, var(--cyan), #a78bfa 48%, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  color: var(--muted);
  max-width: 610px;
  font-size: 1.08rem;
}
.search {
  position: relative;
  margin-top: 27px;
  max-width: 610px;
}
.search input {
  width: 100%;
  border: 1px solid #ffffff22;
  border-radius: 15px;
  color: #fff;
  background: #0c1124;
  padding: 16px 18px 16px 46px;
  outline: none;
  box-shadow: var(--shadow);
}
.search input:focus {
  border-color: var(--cyan);
}
.search:before {
  content: '⌕';
  position: absolute;
  left: 17px;
  top: 8px;
  color: var(--muted);
  font-size: 1.6rem;
}
.hero-art {
  position: relative;
  min-height: 280px;
  display: grid;
  place-items: center;
}
.floating-card {
  position: absolute;
  background: linear-gradient(145deg, #ffffff1d, #ffffff09);
  border: 1px solid #ffffff24;
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  font-size: 2rem;
  animation: float 4s ease-in-out infinite;
}
.floating-card:nth-child(1) {
  padding: 26px;
  transform: translate(-75px, -65px) rotate(-8deg);
}
.floating-card:nth-child(2) {
  padding: 28px;
  transform: translate(85px, -8px) rotate(8deg);
  animation-delay: -1.3s;
}
.floating-card:nth-child(3) {
  padding: 21px;
  transform: translate(-20px, 88px) rotate(4deg);
  animation-delay: -2.2s;
}
@keyframes float {
  50% {
    margin-top: -12px;
  }
}
.section {
  padding: 29px 0 43px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 17px;
}
.section-heading h2 {
  font-size: 1.45rem;
  letter-spacing: -0.035em;
  margin: 0;
}
.section-heading a {
  color: var(--cyan);
  font-size: 0.9rem;
  font-weight: 700;
}
.games-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 17px;
}
.game-card {
  background: linear-gradient(155deg, #ffffff12, #ffffff06);
  border: 1px solid #ffffff15;
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
  transition:
    transform 0.22s,
    border-color 0.22s,
    box-shadow 0.22s;
}
.game-card:hover {
  transform: translateY(-6px);
  border-color: #ffffff3c;
  box-shadow: var(--shadow);
}
.game-cover {
  height: 142px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  font-size: 3.4rem;
}
.game-cover:after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, #fff4, transparent 35%),
    linear-gradient(135deg, #ffffff08, transparent);
}
.cover-snake {
  background: linear-gradient(135deg, #139b67, #146a5a);
}
.cover-memory {
  background: linear-gradient(135deg, #e8338e, #713fd2);
}
.cover-rps {
  background: linear-gradient(135deg, #fd9746, #e3437c);
}
.cover-pong {
  background: linear-gradient(135deg, #0b799d, #3447aa);
}
.cover-2048 {
  background: linear-gradient(135deg, #a76024, #da9b42);
}
.cover-quiz {
  background: linear-gradient(135deg, #5740cc, #942bd0);
}
.cover-breakout {
  background: linear-gradient(135deg, #cd3d55, #ee843d);
}
.cover-reaction {
  background: linear-gradient(135deg, #19aa94, #1770af);
}
.game-card-body {
  padding: 14px 15px 16px;
}
.game-card h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}
.game-card p {
  font-size: 0.84rem;
  color: var(--muted);
  margin: 0;
}
.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tag {
  border: 1px solid #ffffff20;
  background: #ffffff0c;
  border-radius: 100px;
  padding: 8px 14px;
  color: #d9ddf5;
  font-size: 0.85rem;
  font-weight: 700;
  transition: 0.2s;
}
.tag:hover {
  border-color: var(--cyan);
  color: #fff;
}
.category-section {
  padding-top: 12px;
}
.site-footer {
  margin-top: 25px;
  padding: 35px 0;
  background: #050710;
  border-top: 1px solid #ffffff10;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.88rem;
}
.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.game-page {
  padding: 38px 0 68px;
}
.breadcrumbs {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 22px;
}
.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 285px;
  gap: 24px;
}
.game-main {
  min-width: 0;
}
.game-title {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.055em;
  margin-bottom: 8px;
}
.game-description {
  color: var(--muted);
  margin-bottom: 21px;
}
.game-shell {
  background: #0a0f20;
  border: 1px solid #ffffff1d;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.game-stage {
  min-height: 430px;
  display: grid;
  place-items: center;
  padding: 18px;
  position: relative;
}
.game-sidebar {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.stat-panel,
.info-panel {
  background: #ffffff0b;
  border: 1px solid #ffffff14;
  border-radius: 16px;
  padding: 17px;
}
.stat-panel h2,
.info-panel h2 {
  font-size: 1rem;
  margin-bottom: 12px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.stat {
  background: #00000027;
  padding: 12px;
  border-radius: 12px;
}
.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
}
.stat strong {
  font-size: 1.2rem;
}
.instructions {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
  padding-left: 18px;
}
.instructions li + li {
  margin-top: 7px;
}
.game-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 15px 18px;
  border-top: 1px solid #ffffff12;
}
.touch-controls {
  display: none;
  gap: 9px;
  justify-content: center;
  padding: 0 15px 17px;
}
.touch-controls button {
  width: 56px;
  height: 48px;
  padding: 0;
  background: #ffffff13;
  border: 1px solid #ffffff24;
  border-radius: 12px;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 900;
}
.touch-grid {
  grid-template-columns: repeat(3, 56px);
  justify-content: center;
}
.touch-grid button:nth-child(1) {
  grid-column: 2;
}
.touch-grid button:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}
.touch-grid button:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
}
.touch-grid button:nth-child(4) {
  grid-column: 3;
  grid-row: 2;
}
.game-canvas {
  max-width: 100%;
  background: #050913;
  border-radius: 12px;
  touch-action: none;
}
.overlay {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: #080b18d9;
  text-align: center;
  padding: 20px;
}
.overlay.visible {
  display: grid;
}
.overlay-box h2 {
  font-size: 2rem;
  margin-bottom: 7px;
}
.overlay-box p {
  color: var(--muted);
}
.board {
  max-width: 100%;
  touch-action: manipulation;
}
.memory-board {
  width: min(410px, 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.memory-card {
  aspect-ratio: 1;
  border: 0;
  border-radius: 13px;
  background: #292f57;
  color: transparent;
  font-size: 1.7rem;
  transition:
    transform 0.25s,
    background 0.25s;
}
.memory-card.flipped,
.memory-card.matched {
  background: #fff;
  color: #19203f;
  transform: rotateY(180deg);
}
.memory-card.matched {
  background: #6ee7b7;
}
.rps-board {
  text-align: center;
  width: min(500px, 100%);
}
.rps-choices {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 25px;
}
.choice-btn {
  width: 100px;
  height: 92px;
  border: 1px solid #ffffff28;
  border-radius: 17px;
  background: #ffffff11;
  color: #fff;
  font-size: 2.4rem;
  transition: 0.2s;
}
.choice-btn:hover {
  background: #ffffff24;
  transform: translateY(-3px);
}
.versus {
  font-size: clamp(2rem, 7vw, 4rem);
  font-weight: 900;
  margin: 10px;
}
.rps-result {
  min-height: 30px;
  color: var(--cyan);
  font-weight: 800;
}
.game-2048 {
  width: min(410px, 100%);
  aspect-ratio: 1;
  background: #b77b51;
  border: 8px solid #b77b51;
  border-radius: 13px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  touch-action: none;
}
.tile {
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: clamp(1.2rem, 6vw, 2rem);
  background: #cfab8b;
  color: #fff;
}
.tile[data-v='2'] {
  background: #eee4da;
  color: #5b4436;
}
.tile[data-v='4'] {
  background: #ede0c8;
  color: #5b4436;
}
.tile[data-v='8'] {
  background: #f2b179;
}
.tile[data-v='16'] {
  background: #f59563;
}
.tile[data-v='32'] {
  background: #f67c5f;
}
.tile[data-v='64'] {
  background: #f65e3b;
}
.tile[data-v='128'] {
  background: #edcf72;
  font-size: 1.6rem;
}
.tile[data-v='256'],
.tile[data-v='512'] {
  background: #edcc61;
  font-size: 1.6rem;
}
.tile[data-v='1024'],
.tile[data-v='2048'] {
  background: #edc53f;
  font-size: 1.35rem;
}
.quiz-board {
  width: min(610px, 100%);
}
.quiz-progress {
  font-size: 0.82rem;
  color: var(--cyan);
  font-weight: 800;
}
.quiz-question {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 13px 0 18px;
}
.answers {
  display: grid;
  gap: 10px;
}
.answer {
  padding: 14px;
  text-align: left;
  color: #f7f8ff;
  background: #ffffff10;
  border: 1px solid #ffffff20;
  border-radius: 12px;
  font-weight: 700;
}
.answer:hover {
  background: #ffffff1e;
}
.answer.correct {
  background: #1d9c61;
}
.answer.wrong {
  background: #c43c58;
}
.reaction-board {
  width: min(560px, 100%);
  text-align: center;
}
.reaction-zone {
  height: 250px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: #e44755;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 900;
  user-select: none;
  cursor: pointer;
  transition: background 0.15s;
}
.reaction-zone.waiting {
  background: #e4a53d;
}
.reaction-zone.ready {
  background: #25b979;
}
.reaction-zone.too-soon {
  background: #9d3a59;
}
.game-message {
  color: var(--muted);
  text-align: center;
}
.hidden {
  display: none !important;
}
@media (max-width: 850px) {
  .games-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .game-layout {
    grid-template-columns: 1fr;
  }
  .game-sidebar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 620px) {
  .container {
    width: min(100% - 24px, 1180px);
  }
  .header-inner {
    min-height: 63px;
    gap: 14px;
  }
  .nav {
    display: none;
  }
  .header-action .btn {
    padding: 9px 12px;
    font-size: 0.8rem;
  }
  .hero {
    padding: 46px 0 28px;
    grid-template-columns: 1fr;
  }
  .hero-art {
    display: none;
  }
  .hero p {
    font-size: 0.98rem;
  }
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .game-cover {
    height: 112px;
    font-size: 2.8rem;
  }
  .game-card-body {
    padding: 11px;
  }
  .game-card h3 {
    font-size: 0.93rem;
  }
  .game-card p {
    font-size: 0.78rem;
  }
  .section {
    padding: 22px 0;
  }
  .game-page {
    padding-top: 25px;
  }
  .game-stage {
    min-height: 370px;
    padding: 12px;
  }
  .game-sidebar {
    display: block;
  }
  .game-sidebar > * + * {
    margin-top: 14px;
  }
  .touch-controls {
    display: flex;
  }
  .game-canvas {
    width: 100%;
    height: auto;
  }
  .game-title {
    font-size: 2.15rem;
  }
  .footer-inner {
    display: block;
  }
  .footer-links {
    margin-top: 16px;
  }
  .memory-board {
    gap: 7px;
  }
  .memory-card {
    border-radius: 10px;
  }
  .rps-choices {
    gap: 8px;
  }
  .choice-btn {
    width: 82px;
    height: 76px;
    font-size: 2rem;
  }
}

/* Área pública clássica: mantém exatamente a linguagem arcade anterior ao banco. */
:root {
  --bg: #080b18;
  --surface: #12172a;
  --surface-2: #1a2140;
  --text: #f7f8ff;
  --muted: #aeb6d5;
  --purple: #8b5cf6;
  --pink: #f43f9e;
  --cyan: #22d3ee;
  --green: #35d07f;
  --yellow: #fbbf24;
  --radius: 20px;
  --shadow: 0 16px 40px #0006;
}
body {
  background:
    radial-gradient(circle at 10% 0, #262053 0, transparent 27rem),
    radial-gradient(circle at 90% 20%, #173c59 0, transparent 30rem), var(--bg);
  color: var(--text);
}
.site-header {
  background: #080b18e8;
  border-bottom: 1px solid #ffffff12;
}
.logo-mark {
  color: #0b1020;
  background: linear-gradient(135deg, var(--cyan), var(--purple) 55%, var(--pink));
  box-shadow: 0 5px 16px #7c3aed70;
}
.nav a:hover,
.nav a:focus {
  color: #fff;
}
.btn {
  min-height: 0;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--purple), #6d45e9);
  box-shadow: 0 8px 20px #7045d14c;
}
.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 8px 20px #7045d14c;
}
.btn.secondary {
  border: 1px solid #ffffff1e;
  background: #ffffff12;
  color: #fff;
  box-shadow: none;
}
.eyebrow {
  color: var(--cyan);
}
.eyebrow:before {
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
}
.search input {
  border: 1px solid #ffffff22;
  border-radius: 15px;
  background: #0c1124;
  color: #fff;
  box-shadow: var(--shadow);
}
.floating-card {
  border: 1px solid #ffffff24;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff1d, #ffffff09);
  box-shadow: var(--shadow);
}
.game-card {
  border: 1px solid #ffffff15;
  border-radius: var(--radius);
  background: linear-gradient(155deg, #ffffff12, #ffffff06);
  box-shadow: none;
}
.game-card:hover {
  border-color: #ffffff3c;
  box-shadow: var(--shadow);
}
.game-card-body {
  padding: 14px 15px 16px;
}
.game-card p,
.tag,
.hero p,
.instructions,
.stat span,
.breadcrumbs,
.game-description {
  color: var(--muted);
}
.tag {
  border: 1px solid #ffffff20;
  border-radius: 100px;
  background: #ffffff0c;
}
.tag:hover {
  border-color: var(--cyan);
  color: #fff;
}
.site-footer {
  background: #050710;
  border-top: 1px solid #ffffff10;
}
.game-shell {
  border: 1px solid #ffffff1d;
  border-radius: var(--radius);
  background: #0a0f20;
  box-shadow: var(--shadow);
}
.game-stage {
  background: transparent;
}
.stat-panel,
.info-panel {
  border: 1px solid #ffffff14;
  border-radius: 16px;
  background: #ffffff0b;
  box-shadow: none;
}
.stat {
  border-radius: 12px;
  background: #00000027;
}
.touch-controls button {
  border: 1px solid #ffffff26;
  border-radius: 14px;
  background: #ffffff10;
  color: #fff;
  box-shadow: none;
}
.overlay-box {
  border: 1px solid #ffffff24;
  border-radius: 18px;
  background: #111830;
  color: #fff;
  box-shadow: var(--shadow);
}
.memory-card,
.choice-btn,
.answer {
  border: 1px solid #ffffff28;
  box-shadow: none;
}
.game-2048 {
  border: 8px solid #ffffff12;
  border-radius: 16px;
  background: #ffffff12;
  padding: 0;
}
.tile {
  border-radius: 8px;
}

/* Os jogos clássicos acompanham a paleta escolhida na área pública. */
[data-palette='desert'] {
  --bg: #fff3df;
  --surface: #fffaf1;
  --surface-2: #f5dfba;
  --text: #3d2a24;
  --muted: #7e6457;
  --purple: #c96f45;
  --pink: #b77a85;
  --cyan: #71805d;
  --green: #7c925a;
  --yellow: #b87509;
  --shadow: 0 16px 40px #75442622;
}
[data-palette='amazon'] {
  --bg: #eef6df;
  --surface: #fbfff5;
  --surface-2: #dcecc3;
  --text: #18372c;
  --muted: #587365;
  --purple: #3f7c51;
  --pink: #6b9b79;
  --cyan: #16866f;
  --green: #55974c;
  --yellow: #97751a;
  --shadow: 0 16px 40px #1b472322;
}
[data-palette='desert'] body {
  background:
    radial-gradient(circle at 0 0, #ffdca5, transparent 31rem),
    radial-gradient(circle at 100% 0, #ead19f, transparent 29rem), var(--bg);
}
[data-palette='amazon'] body {
  background:
    radial-gradient(circle at 0 0, #d5ebad, transparent 31rem),
    radial-gradient(circle at 100% 0, #cbe9d4, transparent 29rem), var(--bg);
}
[data-palette='desert'] .site-header,
[data-palette='amazon'] .site-header {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-color: color-mix(in srgb, var(--text) 14%, transparent);
}
[data-palette='desert'] .game-card,
[data-palette='amazon'] .game-card {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--text) 10%, transparent);
}
[data-palette='desert'] .game-shell,
[data-palette='amazon'] .game-shell {
  background: color-mix(in srgb, var(--text) 90%, #000);
}
[data-palette='desert'] .stat-panel,
[data-palette='desert'] .info-panel,
[data-palette='amazon'] .stat-panel,
[data-palette='amazon'] .info-panel {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--text) 12%, transparent);
}
.classic-palette-button {
  width: 42px;
  height: 42px;
  border: 1px solid #ffffff26;
  border-radius: 13px;
  background: #ffffff10;
  color: inherit;
  font-size: 1rem;
}
[data-palette='desert'] .classic-palette-button,
[data-palette='amazon'] .classic-palette-button {
  border-color: color-mix(in srgb, var(--text) 15%, transparent);
  background: var(--surface);
}

/* PlayGroupe Arcade — identidade clara, tátil e mobile-first. */
.btn {
  min-height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #6c4dff, #8066ff);
  box-shadow:
    0 5px 0 #4e34d4,
    0 12px 20px #6c4dff2b;
}
.btn:hover {
  transform: translateY(2px);
  filter: none;
  box-shadow:
    0 3px 0 #4e34d4,
    0 15px 25px #6c4dff30;
}
.btn.secondary {
  border: 1px solid #e1ddf1;
  background: #fff;
  color: var(--text);
  box-shadow: 0 4px 0 #e1ddf1;
}
.eyebrow {
  color: var(--purple);
}
.eyebrow:before {
  background: var(--green);
  box-shadow: none;
}
.gradient-text {
  background: linear-gradient(100deg, #5f46e8, #7964fa 50%, #e95b8b);
  -webkit-background-clip: text;
  background-clip: text;
}
.search input {
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: var(--text);
  box-shadow:
    0 5px 0 #e1ddf1,
    var(--shadow);
}
.floating-card {
  background: #fff;
  border: 0;
  box-shadow:
    0 7px 0 #e1ddf1,
    var(--shadow);
}
.game-card {
  border: 0;
  border-radius: 22px;
  background: #fff;
  box-shadow:
    0 5px 0 #e1ddf1,
    var(--shadow);
}
.game-card:hover {
  border: 0;
  box-shadow:
    0 7px 0 #d9d3ee,
    0 16px 30px #3f2a7b19;
}
.game-card-body {
  padding: 16px;
}
.game-card p,
.tag,
.hero p,
.instructions,
.stat span,
.breadcrumbs,
.game-description {
  color: var(--muted);
}
.tag {
  border: 0;
  border-radius: 13px;
  background: #efedfa;
}
.tag:hover {
  border: 0;
  color: var(--purple);
}
.site-footer {
  background: #fff;
  border-top: 1px solid #e1ddf1;
}
.game-shell {
  border: 0;
  border-radius: 27px;
  background: #272046;
  box-shadow:
    0 9px 0 #16112e,
    0 23px 40px #3f2a7b27;
}
.game-stage {
  background: radial-gradient(circle at 50% 0, #40366f, #272046 62%);
}
.stat-panel,
.info-panel {
  border: 0;
  border-radius: 20px;
  background: #fff;
  box-shadow:
    0 5px 0 #e1ddf1,
    var(--shadow);
}
.stat {
  border-radius: 14px;
  background: #efedfa;
}
.touch-controls button {
  border: 0;
  border-radius: 15px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 4px 0 #e1ddf1;
}
.overlay-box {
  border: 0;
  border-radius: 22px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 12px 35px #120c2d55;
}
.memory-card,
.choice-btn,
.answer {
  border: 0;
  box-shadow: 0 4px 0 #17122e50;
}
.game-2048 {
  border: 0;
  background: #3a315d;
  border-radius: 20px;
  padding: 10px;
}
.tile {
  border-radius: 13px;
}
@media (max-width: 620px) {
  .game-shell {
    border-radius: 22px;
  }
  .game-stage {
    min-height: 330px;
  }
  .btn {
    min-height: 46px;
  }
}

/* Modal de escolha das paletas na vitrine clássica. */
.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 16px;
  background: #05071088;
}
.modal {
  width: min(100%, 440px);
  padding: 22px;
  border-radius: 23px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.modal h2 {
  margin: 0 0 8px;
}
.palette-options {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.palette-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 2px solid #ffffff1e;
  border-radius: 16px;
  background: #ffffff0c;
  color: inherit;
  text-align: left;
}
.palette-option.is-selected {
  border-color: var(--cyan);
}
.palette-option b,
.palette-option small {
  display: block;
}
.palette-option small {
  color: var(--muted);
}
.palette-swatch {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 13px;
  background: linear-gradient(135deg, #ffb992 0 33%, #ca774c 33% 65%, #78805b 65%);
}
.palette-option[data-palette='amazon'] .palette-swatch {
  background: linear-gradient(135deg, #dfeea1 0 33%, #649a49 33% 65%, #234a33 65%);
}
.palette-option[data-palette='city'] .palette-swatch {
  background: linear-gradient(135deg, #ff9e9e 0 33%, #082a47 33% 65%, #dc5c7b 65%);
}
@media (min-width: 640px) {
  .modal-backdrop {
    place-items: center;
  }
}

/* Paletas finais dos jogos clássicos. */
[data-palette='city'] {
  --bg: #111321;
  --surface: #1b1e32;
  --surface-2: #272b46;
  --text: #f8f7ff;
  --muted: #c7c2df;
  --purple: #ff718f;
  --cyan: #4ce3cf;
  --green: #4ce3cf;
  --shadow: 0 16px 40px #02030d55;
}
[data-palette='city'] body {
  background:
    radial-gradient(circle at 0 0, #2d2a5b 0, transparent 31rem),
    radial-gradient(circle at 100% 8%, #3a2442 0, transparent 29rem), var(--bg);
}
[data-palette] .btn {
  background: var(--purple);
  box-shadow:
    0 5px 0 color-mix(in srgb, var(--purple) 70%, #000),
    0 12px 20px color-mix(in srgb, var(--purple) 25%, transparent);
}
[data-palette] .btn.secondary {
  border-color: color-mix(in srgb, var(--text) 14%, transparent);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--text) 10%, transparent);
}
[data-palette] .game-card {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--text) 10%, transparent);
}
[data-palette] .site-header {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-color: color-mix(in srgb, var(--text) 12%, transparent);
}
[data-palette] .site-footer {
  background: color-mix(in srgb, var(--bg) 94%, #000);
  border-color: color-mix(in srgb, var(--text) 12%, transparent);
}
[data-palette] .game-shell {
  background: color-mix(in srgb, var(--text) 88%, #000);
}
[data-palette] .stat-panel,
[data-palette] .info-panel {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--text) 12%, transparent);
}
[data-palette] .stat {
  background: var(--surface-2);
}
[data-palette] .touch-controls button {
  background: var(--surface);
  color: var(--text);
  border-color: color-mix(in srgb, var(--text) 14%, transparent);
}
[data-palette] .game-card p,
[data-palette] .tag,
[data-palette] .hero p,
[data-palette] .instructions,
[data-palette] .stat span,
[data-palette] .breadcrumbs,
[data-palette] .game-description {
  color: var(--muted);
}

/*
 * Layout definitivo das páginas de arcade.
 * Este bloco fica no fim do arquivo de propósito: as páginas antigas possuem
 * mecânicas diferentes, mas todas usam esta mesma estrutura externa. Assim o
 * tabuleiro não herda regras antigas de flex e não vira uma faixa horizontal.
 */
.game-page {
  width: min(1180px, calc(100% - 28px));
  padding: 28px 0 64px;
}

.game-page .breadcrumbs {
  margin: 0 0 14px;
}

.game-page .game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.game-page .game-title {
  margin: 0 0 6px;
  font-size: clamp(2rem, 7vw, 3.15rem);
  line-height: 1;
}

.game-page .game-description {
  max-width: 62ch;
  margin: 0 0 16px;
  line-height: 1.55;
}

.game-page .game-shell {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--text) 13%, transparent);
  border-radius: 24px;
  background: color-mix(in srgb, var(--bg) 84%, #070914);
  box-shadow: var(--shadow);
}

.game-page .game-stage {
  position: relative;
  display: grid;
  min-height: clamp(300px, 65vw, 540px);
  place-items: center;
  padding: clamp(14px, 3vw, 30px);
  border-radius: 0;
  background:
    radial-gradient(
      circle at 50% 20%,
      color-mix(in srgb, var(--purple) 19%, transparent),
      transparent 52%
    ),
    #080b17;
  box-shadow: none;
}

.game-page .game-canvas {
  display: block;
  width: min(100%, 520px);
  height: auto;
  max-height: min(68vh, 520px);
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--text) 11%, transparent);
  border-radius: 18px;
  background: #050711;
  box-shadow: 0 14px 34px #00000052;
}

.game-page .board,
.game-page .game-2048,
.game-page .memory-board,
.game-page .quiz-board {
  max-width: 100%;
}

.game-page .touch-controls {
  display: grid;
  min-height: 0;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px 8px;
  border-top: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  background: color-mix(in srgb, var(--surface) 72%, var(--bg));
}

.game-page .touch-grid {
  grid-template-columns: repeat(3, 54px);
  grid-template-rows: repeat(2, 48px);
}

.game-page .touch-controls button {
  width: 54px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--text) 14%, transparent);
}

.game-page .touch-controls button:active {
  transform: translateY(3px);
  box-shadow: none;
}

.game-page .game-actions {
  display: flex;
  min-height: 0;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px 16px;
  border-top: 0;
  background: color-mix(in srgb, var(--surface) 72%, var(--bg));
}

.game-page .game-actions .btn {
  min-height: 44px;
}

.game-page .game-sidebar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.game-page .stat-panel,
.game-page .info-panel {
  min-width: 0;
  padding: 17px;
  border: 1px solid color-mix(in srgb, var(--text) 11%, transparent);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--bg) 14%, transparent);
}

.game-page .stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.game-page .stat {
  min-width: 0;
  padding: 11px 9px;
  background: var(--surface-2);
  text-align: center;
}

.game-page .stat strong {
  display: block;
  overflow-wrap: anywhere;
}

.game-page .instructions {
  margin: 0;
  color: var(--muted);
}

.game-page .overlay {
  background: #050713d9;
}

.game-page .overlay-box {
  width: min(100%, 340px);
  padding: 22px;
}

@media (min-width: 920px) {
  .game-page .game-layout {
    grid-template-columns: minmax(0, 1fr) minmax(245px, 290px);
    gap: 22px;
  }

  .game-page .game-sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .game-page {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .game-page .game-stage {
    min-height: min(78vw, 430px);
    padding: 10px;
  }

  .game-page .game-canvas {
    border-radius: 13px;
  }

  .game-page .game-actions .btn {
    flex: 1 1 150px;
  }

  .game-page .game-sidebar {
    grid-template-columns: 1fr;
  }
}

/* Base compartilhada dos jogos clássicos: usa as mesmas paletas e o mesmo
 * contraste da plataforma, sem alterar o funcionamento de cada jogo. */
html[data-palette] body {
  color: var(--text);
  font-family: 'DM Sans', Inter, ui-sans-serif, system-ui, sans-serif;
}

html[data-palette] h1,
html[data-palette] h2,
html[data-palette] h3 {
  font-family: Outfit, 'DM Sans', Inter, sans-serif;
  letter-spacing: -0.035em;
}

html[data-palette] .btn {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--purple) 72%, #000);
}

html[data-palette] .btn:hover {
  background: color-mix(in srgb, var(--purple) 86%, #000);
  color: #fff;
}

html[data-palette] .btn.secondary {
  border-color: color-mix(in srgb, var(--text) 15%, transparent);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--text) 12%, transparent);
}

html[data-palette] .site-header,
html[data-palette] .site-footer {
  border-color: color-mix(in srgb, var(--text) 12%, transparent);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

html[data-palette] .game-card,
html[data-palette] .stat-panel,
html[data-palette] .info-panel {
  border-color: color-mix(in srgb, var(--text) 12%, transparent);
  background: var(--surface);
  color: var(--text);
}

/* Todos os estados do jogo usam uma superfície clara com texto escuro
 * explícito. O cenário Cidade usa texto claro no restante do jogo; sem esta
 * regra, telas de início/pausa/fim ficavam com texto claro sobre fundo claro. */
html[data-palette] .game-page .overlay-box {
  border: 1px solid #ffffff;
  background: #fffdfa;
  color: #182238;
  box-shadow: 0 16px 42px #02081770;
}

html[data-palette] .game-page .overlay-box h1,
html[data-palette] .game-page .overlay-box h2,
html[data-palette] .game-page .overlay-box h3 {
  color: #182238;
}

html[data-palette] .game-page .overlay-box p,
html[data-palette] .game-page .overlay-box label {
  color: #5e6879;
}

html[data-palette] .game-page .overlay-box select,
html[data-palette] .game-page .overlay-box input {
  border: 1px solid #d9dfea;
  background: #fff;
  color: #182238;
}

html[data-palette] .game-page .overlay-box .btn {
  color: #fff;
}

html[data-palette] .game-page .game-top-tools button,
html[data-palette] .game-page .game-options {
  border: 1px solid color-mix(in srgb, #fff 22%, transparent);
  background: #101a30e8;
  color: #fff;
}

html[data-palette] .game-page .game-options select,
html[data-palette] .game-page .game-options input {
  color: #fff;
  accent-color: var(--purple);
}

/* Paleta única também para os jogos clássicos. */
html[data-palette='unified'],
html:not([data-palette]) {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #edf2f8;
  --text: #182338;
  --muted: #5c6b82;
  --purple: #3159d9;
  --pink: #3159d9;
  --cyan: #087f65;
  --green: #087f65;
  --yellow: #a86508;
  --shadow: 0 16px 40px #17243b18;
}

html[data-palette='unified'] body,
html:not([data-palette]) body {
  background: var(--bg);
}
