:root {
  /* PEAR36 palette */
  --bg: #272736;
  --bg-2: #2d2c40;
  --card: #322947;
  --card-2: #323e4f;
  --line: rgba(255, 255, 235, .08);
  --text: #ffffeb;
  --muted: #c2c2d1;
  --dim: #7e7e8f;
  --accent: #cfff70;
  --pink: #ff6b97;
  --cyan: #66ffe3;
  --teal: #3d6e70;
  --blue: #4b5bab;
  --ink: #272736;
  --radius: 18px;
  --font: "Outfit", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { display: block; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem clamp(1rem, 4vw, 3rem);
  background: rgba(39, 39, 54, .7); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.logo img { height: 34px; width: auto; }
.nav nav { display: flex; gap: clamp(1rem, 3vw, 2.2rem); }
.nav nav a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: .95rem; transition: color .2s; }
.nav nav a:hover { color: var(--accent); }

/* Hero */
.hero { position: relative; min-height: 86vh; display: grid; place-items: center; overflow: hidden; text-align: center; padding: 5rem 1rem; }
.glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .45; pointer-events: none; }
.glow-1 { width: 520px; height: 520px; background: var(--teal); top: -120px; left: -120px; }
.glow-2 { width: 460px; height: 460px; background: #5a265e; bottom: -160px; right: -100px; }
.glow-3 { width: 300px; height: 300px; background: var(--blue); top: 40%; left: 55%; opacity: .3; }
.hero-inner { position: relative; max-width: 780px; }
.hero-logo { width: min(260px, 60vw); height: auto; margin: 0 auto 2.2rem; filter: drop-shadow(0 20px 40px rgba(0,0,0,.35)); }
h1 { font-size: clamp(2.4rem, 6.5vw, 4.6rem); line-height: 1.05; font-weight: 700; letter-spacing: -.03em; }
.accent { color: var(--accent); }
.lead { color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); max-width: 560px; margin: 1.4rem auto 2.4rem; }
.cta { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: .85rem 1.5rem; border-radius: 999px;
  background: rgba(255, 255, 235, .06); color: var(--text); border: 1px solid rgba(255, 255, 235, .14);
  transition: transform .2s, background .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); background: rgba(255, 255, 235, .1); }
.btn-primary { background: var(--accent); color: var(--ink); border-color: transparent; box-shadow: 0 8px 24px rgba(207, 255, 112, .2); }
.btn-primary:hover { background: var(--accent); box-shadow: 0 12px 32px rgba(207, 255, 112, .3); }
.btn-sm { font-size: .85rem; padding: .6rem 1.1rem; margin-top: 1rem; }

/* Sections */
.section { padding: clamp(4rem, 9vw, 7rem) clamp(1rem, 4vw, 3rem); max-width: 1200px; margin: 0 auto; }
.section.alt { max-width: none; background: var(--bg-2); }
.section.alt > * { max-width: 1200px; margin-left: auto; margin-right: auto; }
.section-title { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -.02em; margin-bottom: 2.2rem; }
.section-lead { color: var(--muted); margin: -1.2rem 0 2.4rem; max-width: 620px; font-size: 1.05rem; }
.section.alt > .section-lead { max-width: 1200px; margin-top: -1.2rem; }

.grid { display: grid; gap: 1.25rem; }
.games { grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(207, 255, 112, .35); box-shadow: 0 18px 40px rgba(0, 0, 0, .3); }

.card { display: flex; gap: 1.3rem; align-items: flex-start; padding: 1.4rem; }
.card img { width: 92px; height: 92px; flex: none; border-radius: 20px; box-shadow: 0 8px 20px rgba(0, 0, 0, .3); }
.card h3 { font-size: 1.25rem; font-weight: 600; margin: .3rem 0 .25rem; letter-spacing: -.01em; }
.card p { color: var(--muted); font-size: .97rem; }
.meta { margin-top: .5rem; color: var(--accent) !important; font-weight: 500; }
.tag { font-size: .72rem; font-weight: 600; color: var(--cyan); text-transform: uppercase; letter-spacing: .1em; }



.about-body { max-width: 720px; display: grid; gap: 1rem; font-size: 1.15rem; color: var(--muted); }

.socials { display: flex; flex-wrap: wrap; gap: .9rem; }
.social {
  display: flex; align-items: center; gap: .7rem; text-decoration: none; font-weight: 500;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .85rem 1.4rem;
  transition: transform .2s, border-color .2s, color .2s;
}
.social:hover { transform: translateY(-2px); border-color: rgba(207, 255, 112, .4); color: var(--accent); }
.social svg { width: 20px; height: 20px; fill: currentColor; }

.footer { text-align: center; padding: 2.2rem 1rem; color: var(--dim); font-size: .9rem; border-top: 1px solid var(--line); }

@media (max-width: 640px) {
  .nav { flex-direction: column; gap: .6rem; }
  .card { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
.footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.footer a:hover { color: var(--accent); }

/* Legal pages */
.legal { max-width: 780px; color: var(--muted); }
.legal .section-title { color: var(--text); margin-bottom: .4rem; }
.legal .updated { color: var(--dim); margin-bottom: 2rem; }
.legal h2 { color: var(--text); font-size: 1.4rem; font-weight: 600; margin: 2.4rem 0 .8rem; }
.legal h3 { color: var(--text); font-size: 1.1rem; font-weight: 600; margin: 1.6rem 0 .5rem; }
.legal p, .legal ul { margin-bottom: 1rem; }
.legal ul { padding-left: 1.3rem; }
.legal li { margin-bottom: .35rem; }
.legal a { color: var(--accent); text-underline-offset: 3px; }
.legal strong { color: var(--text); font-weight: 600; }
.legal ol { padding-left: 1.3rem; margin-bottom: 1rem; }
.toc { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.toc a { text-decoration: none; font-size: .9rem; font-weight: 500; padding: .45rem 1rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--text) !important; }
.toc a:hover { border-color: rgba(207, 255, 112, .4); }
.legal h2[id] { scroll-margin-top: 5rem; }
.table-wrap { overflow-x: auto; margin-bottom: 1.4rem; border: 1px solid var(--line); border-radius: 14px; }
.legal table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.legal th, .legal td { text-align: left; padding: .8rem 1rem; vertical-align: top; border-bottom: 1px solid var(--line); }
.legal th { color: var(--text); background: var(--card); font-weight: 600; }
.legal tr:last-child td { border-bottom: 0; }
.legal td:first-child { color: var(--text); width: 38%; }

/* 404 */
.notfound { min-height: 78vh; }
.notfound-mark { width: 96px; height: auto; margin: 0 auto 1.2rem; animation: bob 3s ease-in-out infinite; }
.notfound-code { font-size: clamp(4.5rem, 14vw, 8rem); font-weight: 700; line-height: 1; letter-spacing: -.04em; color: var(--accent); margin-bottom: .6rem; }
@keyframes bob { 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .notfound-mark { animation: none; } }

/* Game pages */
.game-hero { position: relative; overflow: hidden; padding: clamp(4rem, 9vw, 6.5rem) clamp(1rem, 4vw, 3rem); }
.game-hero-inner { position: relative; max-width: 1200px; margin: 0 auto; display: flex; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.game-hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); margin: .3rem 0 0; }
.game-hero .lead { margin: 1rem 0 2rem; }
.game-hero .cta { justify-content: flex-start; }
.game-icon { width: clamp(120px, 18vw, 180px); height: auto; aspect-ratio: 1; flex: none; border-radius: 22%; box-shadow: 0 20px 50px rgba(0, 0, 0, .4); }
.gallery { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 1rem; scrollbar-color: var(--line) transparent; }
.gallery img { flex: none; height: clamp(240px, 45vw, 420px); width: auto; border-radius: 16px; scroll-snap-align: start; border: 1px solid var(--line); }
.game-links { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 2rem; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card-links { display: flex; gap: .6rem; flex-wrap: wrap; }
.crumbs { font-size: .9rem; color: var(--dim); margin-bottom: 1rem; }
.crumbs a { color: var(--muted) !important; }
.summary { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.6rem .6rem; margin: 1.6rem 0; }
.summary h2 { margin-top: 0 !important; }
@media (max-width: 640px) {
  .game-hero-inner { flex-direction: column; align-items: flex-start; }
}
.game-hero.has-banner::before { content: ""; position: absolute; inset: 0; background: var(--banner) center / cover no-repeat; opacity: .22; -webkit-mask-image: linear-gradient(#000 40%, transparent); mask-image: linear-gradient(#000 40%, transparent); }
.gallery-wrap { position: relative; }
.gallery img { cursor: pointer; user-select: none; -webkit-user-drag: none; }
.gallery:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 16px; }
.gal-btn {
  position: absolute; top: calc(50% - .5rem); transform: translateY(-50%); z-index: 2;
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 235, .18);
  background: rgba(39, 39, 54, .82); backdrop-filter: blur(8px); color: var(--text);
  font: 600 2rem/1 var(--font); cursor: pointer; display: grid; place-items: center; padding-bottom: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35); transition: background .2s, color .2s, transform .2s;
}
.gal-btn:hover { background: var(--accent); color: var(--ink); }
.gal-btn[hidden] { display: none; }
.gal-prev { left: -12px; }
.gal-next { right: -12px; }
@media (max-width: 640px) { .gal-prev { left: 4px; } .gal-next { right: 4px; } }
