/* =========================================================
   Eternal Games On — portal (estilo do site Astral Tale)
   ========================================================= */
:root {
  --ink: #4b1f45;
  --pink: #ff5fa2;
  --pink-dark: #d63c80;
  --sky: #c48dff;
  --sky-dark: #9b5de5;
  --f-title: "M PLUS Rounded 1c", "Zen Kaku Gothic New", system-ui, sans-serif;
  --f-body: "Zen Kaku Gothic New", "M PLUS Rounded 1c", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
  font-family: var(--f-body); color: var(--ink);
  background: #ffeef6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, p { margin: 0; }

/* ---------------- Fundo ---------------- */
.bg {
  position: fixed; inset: 0; z-index: -3;
  background: url(img/bg.webp) center 40% / cover no-repeat;
  animation: bgdrift 40s ease-in-out infinite alternate;
}
.bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(255, 250, 252, .92), rgba(255, 245, 250, .55) 55%, rgba(255, 240, 248, .25)),
    linear-gradient(0deg, rgba(255, 246, 250, .95) 0%, rgba(255, 246, 250, 0) 35%);
}
@keyframes bgdrift { to { transform: scale(1.08) translateX(-1.5%); } }

.sparkles i {
  position: fixed; z-index: -2; width: 14px; height: 14px; background: #fff;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  filter: drop-shadow(0 0 6px #ff9cc9);
  animation: twinkle 3.2s ease-in-out infinite;
}
.sparkles i:nth-child(1) { top: 14%; left: 44%; }
.sparkles i:nth-child(2) { top: 24%; left: 90%; width: 10px; height: 10px; animation-delay: -1s; }
.sparkles i:nth-child(3) { top: 62%; left: 3%; width: 8px; height: 8px; animation-delay: -2s; }
.sparkles i:nth-child(4) { top: 9%;  left: 70%; width: 18px; height: 18px; animation-delay: -.5s; background: #ffd1e6; }
.sparkles i:nth-child(5) { top: 48%; left: 97%; animation-delay: -1.6s; }
.sparkles i:nth-child(6) { top: 36%; left: 6%;  width: 9px; height: 9px; animation-delay: -2.4s; }
.sparkles i:nth-child(7) { top: 86%; left: 52%; width: 11px; height: 11px; animation-delay: -.9s; background: #ffd1e6; }
.sparkles i:nth-child(8) { top: 18%; left: 22%; width: 7px; height: 7px; animation-delay: -2.8s; }
@keyframes twinkle { 0%, 100% { transform: scale(.4) rotate(0); opacity: .3; } 50% { transform: scale(1) rotate(45deg); opacity: 1; } }

.falling i {
  position: fixed; z-index: -2; top: -10%; width: 2px; height: 160px;
  background: linear-gradient(180deg, transparent, #fff); border-radius: 2px;
  transform: rotate(35deg); opacity: 0;
  animation: fall 8s linear infinite;
}
.falling i::after {
  content: ""; position: absolute; bottom: -3px; left: -3px; width: 8px; height: 8px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 14px 4px #ff9cc9;
}
.falling i:nth-child(1) { left: 58%; }
.falling i:nth-child(2) { left: 84%; animation-delay: 3s; animation-duration: 10s; }
.falling i:nth-child(3) { left: 30%; animation-delay: 6s; animation-duration: 9s; }
@keyframes fall {
  0% { opacity: 0; transform: rotate(35deg) translateY(0); }
  3% { opacity: 1; }
  14%, 100% { opacity: 0; transform: rotate(35deg) translateY(620px); }
}

.jp-side {
  position: fixed; left: 18px; top: 50%; transform: translateY(-50%);
  writing-mode: vertical-rl;
  font: 700 .72rem var(--f-title); letter-spacing: .6em;
  color: rgba(255, 95, 162, .45);
}

/* ---------------- Cabeçalho ---------------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px clamp(24px, 4vw, 64px);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand svg {
  width: 38px; height: 38px; fill: var(--pink);
  filter: drop-shadow(0 0 10px rgba(255, 95, 162, .55));
  animation: spin 18s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.brand span { display: flex; flex-direction: column; line-height: 1; }
.brand small {
  font: 800 .62rem var(--f-title); letter-spacing: .38em; text-transform: uppercase; color: var(--pink-dark);
  margin-left: 2px;
}
.brand b {
  font: 800 1.6rem var(--f-title); letter-spacing: -.01em;
  transform: skewX(-8deg); transform-origin: left;
  background: linear-gradient(180deg, var(--ink) 30%, var(--pink-dark));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.lang {
  display: flex; padding: 3px; gap: 2px; border-radius: 999px;
  background: rgba(255, 255, 255, .7); border: 1px solid rgba(255, 95, 162, .25);
  backdrop-filter: blur(6px);
}
.lang button {
  min-width: 38px; height: 32px; padding: 0 8px; border-radius: 999px;
  font: 800 .75rem var(--f-title); letter-spacing: .06em; color: rgba(75, 31, 69, .6);
  transition: background .2s, color .2s;
}
.lang button:hover { color: var(--pink-dark); }
.lang button.on { background: var(--pink); color: #fff; }
.lang button:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }

/* ---------------- Texto ---------------- */
main {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 2vh clamp(20px, 4vw, 64px) 40px;
}
.intro { text-align: center; max-width: 720px; animation: up .9s var(--ease) both; }
@keyframes up { from { opacity: 0; transform: translateY(24px); } }
.kicker {
  display: inline-block; padding: 7px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .8); border: 1px solid rgba(255, 95, 162, .25);
  font: 800 .78rem var(--f-title); letter-spacing: .14em; text-transform: uppercase; color: var(--pink-dark);
}
.intro h1 {
  margin: 16px 0 12px;
  font: 800 clamp(2.2rem, 4.4vw, 3.8rem)/1.12 var(--f-title); letter-spacing: -.01em;
  text-shadow: 0 2px 18px rgba(255, 255, 255, .9);
}
.intro h1 em { font-style: normal; position: relative; display: inline-block; color: var(--pink); }
.intro h1 em::after {
  content: ""; position: absolute; left: -4px; right: -6px; bottom: .02em; height: .26em; z-index: -1;
  background: #ffd3e7; border-radius: 60% 30% 50% 40% / 60% 50% 40% 50%; transform: rotate(-2deg);
}
.lead { font-size: 1.05rem; line-height: 1.7; color: rgba(75, 31, 69, .82); }

/* ---------------- Cards ---------------- */
.games {
  width: 100%; max-width: 1440px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 32px);
  margin-top: clamp(28px, 5vh, 48px);
}
.game {
  position: relative; display: flex; flex-direction: column;
  border-radius: 26px; overflow: hidden;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 20px 44px -18px rgba(150, 40, 100, .45), 0 0 0 1px rgba(255, 255, 255, .9) inset;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
  animation: up .8s var(--ease) both;
}
.game:nth-child(2) { animation-delay: .08s; }
.game:nth-child(3) { animation-delay: .16s; }
.game:nth-child(4) { animation-delay: .24s; }
.game:hover, .game:focus-visible {
  transform: translateY(-8px);
  box-shadow: 0 30px 60px -20px color-mix(in srgb, var(--c) 70%, transparent), 0 0 0 3px var(--c);
}
.game:focus-visible { outline: none; }

.art {
  position: relative; aspect-ratio: 4 / 4.4;
  background-size: cover; background-position: center;
  overflow: hidden; isolation: isolate;
}
.art::before {                     /* brilho na cor do jogo */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(circle at 50% 62%, color-mix(in srgb, var(--c) 45%, transparent), transparent 60%);
}
.art::after {                      /* funde a arte com o card */
  content: ""; position: absolute; inset: auto 0 0; height: 38%;
  background: linear-gradient(0deg, rgba(255, 255, 255, .92), transparent);
}
.art { background-color: var(--c); }
.char {
  position: absolute; left: 50%; bottom: 0; height: 96%; width: auto; max-width: none;
  transform: translateX(-50%);
  filter: drop-shadow(0 14px 24px rgba(40, 10, 40, .35));
  transition: transform .5s var(--ease);
}
.char-sm { height: 84%; bottom: 4%; }   /* arte de origem pequena (250px) */
.game:hover .char { transform: translateX(-50%) scale(1.04) translateY(-6px); }
.game:hover .art { background-position: center 45%; }
.genre {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(6px);
  font: 800 .7rem var(--f-title); letter-spacing: .12em; text-transform: uppercase;
  color: color-mix(in srgb, var(--c) 65%, var(--ink));
}

.info {
  position: relative; flex: 1;
  display: flex; flex-direction: column; gap: 6px;
  padding: 4px 24px 24px;
}
.info::before {                     /* traço de cor, como o card de classe */
  content: ""; position: absolute; left: 0; top: 8px; height: 46px; width: 5px; border-radius: 0 4px 4px 0;
  background: var(--c);
}
.info small { font: 800 .72rem var(--f-title); letter-spacing: .2em; text-transform: uppercase; color: #c08aa8; }
.info h2 { font: 800 clamp(1.2rem, 1.6vw, 1.45rem)/1.2 var(--f-title); }
.info p { font-size: .92rem; line-height: 1.6; color: #85587a; margin-bottom: 14px; }

.btn {
  margin-top: auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 50px; border-radius: 999px;
  font: 800 1rem var(--f-title); letter-spacing: .02em; color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 60%, #fff), var(--c) 50%, color-mix(in srgb, var(--c) 85%, #000));
  box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 70%, #000), 0 12px 24px -8px color-mix(in srgb, var(--c) 80%, transparent);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .25);
  transition: transform .15s var(--ease), box-shadow .15s, filter .2s;
}
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.game:hover .btn { filter: brightness(1.06); transform: translateY(-2px); }
.game:active .btn { transform: translateY(3px); box-shadow: 0 2px 0 color-mix(in srgb, var(--c) 70%, #000); }

/* ---------------- Rodapé ---------------- */
.foot {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px;
  padding: 18px 24px 24px;
  font-size: .8rem; color: #a06a92; text-align: center;
}

/* ---------------- Responsivo ---------------- */
@media (max-width: 1180px) {
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 820px; }
}
@media (max-width: 900px) {
  .jp-side { display: none; }
  .games { grid-template-columns: 1fr; max-width: 420px; }
}
@media (max-width: 520px) {
  .top { padding: 14px 18px; }
  .brand b { font-size: 1.3rem; }
  .brand svg { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
