/* ============ PapaBazar Games ============ */
:root {
  --bg: #08010f;
  --bg-alt: #0d0221;
  --surface: rgba(255, 255, 255, 0.04);
  --border: rgba(45, 226, 230, 0.15);
  --text: #eae6f2;
  --text-dim: #9b93ad;
  --cyan: #2de2e6;
  --magenta: #ff2ea6;
  --purple: #7b2ff7;
  --amber: #ffb800;
  --font-display: 'Chakra Petch', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

::selection { background: var(--magenta); color: #fff; }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.1; }
h2 { font-size: clamp(2rem, 5vw, 3.2rem); text-transform: uppercase; letter-spacing: 0.02em; }
h3 { font-size: 1.25rem; }

a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

.text-gradient {
  background: linear-gradient(100deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead { font-size: 1.15rem; color: var(--text); margin-bottom: 1rem; }

/* ---------- Background layers ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -2;
  background-image:
    linear-gradient(rgba(45, 226, 230, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 226, 230, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black 30%, transparent 80%);
}

.bg-glow {
  position: fixed; z-index: -3; border-radius: 50%;
  filter: blur(140px); opacity: 0.35; pointer-events: none;
}
.bg-glow-1 { width: 600px; height: 600px; top: -180px; right: -120px; background: var(--purple); }
.bg-glow-2 { width: 500px; height: 500px; bottom: -160px; left: -140px; background: var(--magenta); opacity: 0.2; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(8, 1, 15, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
.nav-inner {
  max-width: 1160px; margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-img {
  height: 42px; width: auto;
  filter: drop-shadow(0 0 10px rgba(255, 46, 166, 0.35));
  transition: filter 0.25s ease;
}
.logo:hover .logo-img { filter: drop-shadow(0 0 16px rgba(45, 226, 230, 0.6)); }
.logo-img-footer { height: 110px; }
.logo-mark {
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem;
  width: 38px; height: 38px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  color: #08010f; border-radius: 8px;
  box-shadow: 0 0 18px rgba(255, 46, 166, 0.45);
}
.logo-text { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.02em; }
.logo-accent { color: var(--cyan); }

.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a:not(.btn) {
  font-size: 0.92rem; font-weight: 500; color: var(--text-dim);
  transition: color 0.2s;
}
.nav-links a:not(.btn):hover { color: var(--cyan); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span {
  display: block; width: 24px; height: 2px; background: var(--text); margin: 5px 0;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font-family: var(--font-display); font-weight: 600;
  font-size: 0.95rem; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 14px 30px; border-radius: 6px; border: none; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}
.btn-primary {
  background: linear-gradient(100deg, var(--magenta), var(--purple));
  color: #fff;
  box-shadow: 0 0 24px rgba(255, 46, 166, 0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 36px rgba(255, 46, 166, 0.65); }
.btn-ghost {
  background: transparent; color: var(--cyan);
  border: 1px solid var(--cyan);
  box-shadow: inset 0 0 12px rgba(45, 226, 230, 0.1);
}
.btn-ghost:hover { background: rgba(45, 226, 230, 0.1); box-shadow: 0 0 20px rgba(45, 226, 230, 0.35); }
.btn-outline { border: 1px solid var(--magenta); color: var(--magenta); background: transparent; }
.btn-outline:hover { background: var(--magenta); color: #fff; }
.btn-small { padding: 9px 20px; font-size: 0.82rem; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  position: relative; padding: 120px 24px 0;
}
.hero-kicker {
  font-family: var(--font-display); color: var(--cyan);
  text-transform: uppercase; letter-spacing: 0.35em; font-size: 0.85rem;
  margin-bottom: 18px;
}
.hero-title { font-size: clamp(3rem, 10vw, 7rem); text-transform: uppercase; }
.hero-logo {
  width: min(680px, 88vw); height: auto; margin: 0 auto;
  filter: drop-shadow(0 0 40px rgba(255, 46, 166, 0.45));
  animation: heroPulse 4s ease-in-out infinite;
}
@keyframes heroPulse {
  0%, 100% { filter: drop-shadow(0 0 30px rgba(255, 46, 166, 0.35)); }
  50% { filter: drop-shadow(0 0 55px rgba(45, 226, 230, 0.55)); }
}
.hero-title .glitch { display: block; color: var(--text); }
.hero-title-legends {
  display: block;
  background: linear-gradient(100deg, var(--cyan) 10%, var(--magenta) 60%, var(--amber));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 24px rgba(255, 46, 166, 0.5));
}
.hero-sub { max-width: 560px; margin: 22px auto 0; color: var(--text-dim); font-size: 1.08rem; }
.hero-cta { display: flex; gap: 16px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.hero-platforms {
  margin-top: 44px; display: flex; align-items: center; gap: 16px;
  color: var(--text-dim); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.15em;
  flex-wrap: wrap; justify-content: center;
}
.platform-badges { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.badge {
  font-family: var(--font-display); font-size: 0.75rem; font-weight: 600;
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 4px;
  color: var(--text); background: var(--surface); letter-spacing: 0.1em;
}
.badge-steam {
  border-color: var(--cyan); color: var(--cyan);
  transition: background 0.2s, box-shadow 0.2s;
}
.badge-steam:hover { background: rgba(45, 226, 230, 0.12); box-shadow: 0 0 14px rgba(45, 226, 230, 0.35); }

.hero-skyline { position: absolute; inset: auto 0 0 0; height: 30vh; min-height: 180px; z-index: -1; opacity: 0.9; }
.hero-skyline canvas { width: 100%; height: 100%; }

.scroll-hint { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); }
.scroll-hint-line {
  display: block; width: 2px; height: 44px;
  background: linear-gradient(var(--cyan), transparent);
  animation: scrollPulse 1.8s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); }
}

/* Glitch effect */
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; inset: 0; overflow: hidden;
  clip-path: inset(0 0 0 0);
  opacity: 0;
}
.glitch::before { color: var(--cyan); animation: glitchA 3.5s infinite steps(1); }
.glitch::after { color: var(--magenta); animation: glitchB 3.5s infinite steps(1); }
@keyframes glitchA {
  0%, 92%, 100% { opacity: 0; transform: none; }
  93% { opacity: 0.8; transform: translate(-4px, 2px); clip-path: inset(20% 0 40% 0); }
  95% { opacity: 0.8; transform: translate(3px, -1px); clip-path: inset(60% 0 10% 0); }
  97% { opacity: 0; }
}
@keyframes glitchB {
  0%, 91%, 100% { opacity: 0; transform: none; }
  92% { opacity: 0.8; transform: translate(4px, -2px); clip-path: inset(50% 0 20% 0); }
  96% { opacity: 0.8; transform: translate(-3px, 1px); clip-path: inset(10% 0 70% 0); }
  98% { opacity: 0; }
}

/* ---------- Sections ---------- */
.section { padding: 110px 0; position: relative; }
.section-alt {
  background: linear-gradient(180deg, transparent, rgba(123, 47, 247, 0.06) 30%, rgba(123, 47, 247, 0.06) 70%, transparent);
}
.section-head { margin-bottom: 56px; }
.section-kicker {
  font-family: var(--font-display); color: var(--magenta);
  letter-spacing: 0.25em; text-transform: uppercase; font-size: 0.8rem;
  margin-bottom: 12px;
}

/* ---------- Game showcase ---------- */
.game-grid {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center;
}
.game-copy p { color: var(--text-dim); margin-bottom: 1rem; }
.game-copy .lead { color: var(--text); }

.stat-row { display: flex; gap: 40px; list-style: none; margin-top: 32px; flex-wrap: wrap; }
.stat-row li { display: flex; flex-direction: column; }
.stat-num {
  font-family: var(--font-display); font-size: 2.4rem; font-weight: 700;
  color: var(--cyan); text-shadow: 0 0 20px rgba(45, 226, 230, 0.5);
}
.stat-row span { font-size: 0.85rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; }

.screen-frame {
  position: relative; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border);
  transform: perspective(1000px) rotateY(-6deg) rotateX(2deg);
  transition: transform 0.5s ease;
}
.screen-frame:hover { transform: perspective(1000px) rotateY(0) rotateX(0); }
.screen-frame-glow {
  position: absolute; inset: -40px; z-index: -1;
  background: radial-gradient(circle, rgba(255, 46, 166, 0.3), transparent 70%);
  filter: blur(30px);
}
.screen-art { width: 100%; height: auto; display: block; }

.art-label {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  font-family: var(--font-display); font-size: 0.62rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.18em;
  padding: 4px 10px; border-radius: 4px;
  color: var(--text-dim); background: rgba(8, 1, 15, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
}

/* ---------- Feature cards ---------- */
.cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 30px 26px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 46, 166, 0.5);
  box-shadow: 0 12px 40px rgba(255, 46, 166, 0.15);
}
.card-icon {
  font-size: 1.7rem; width: 54px; height: 54px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(45, 226, 230, 0.12), rgba(255, 46, 166, 0.12));
  border: 1px solid var(--border); border-radius: 10px; margin-bottom: 18px;
}
.card h3 { margin-bottom: 10px; color: var(--text); }
.card p { color: var(--text-dim); font-size: 0.95rem; }

/* ---------- Legends (characters) ---------- */
.legend {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.legend:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 46, 166, 0.5);
  box-shadow: 0 16px 50px rgba(255, 46, 166, 0.15);
}
.legend-art { position: relative; overflow: hidden; }
.legend-art img {
  width: 100%; height: 480px; object-fit: cover; object-position: center 22%;
  transition: transform 0.5s ease;
}
.legend:hover .legend-art img { transform: scale(1.03); }
.legend-art::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 70%, rgba(8, 1, 15, 0.55));
}
.legend-art-wide img { height: auto; object-fit: contain; object-position: center; }
.legend-info { padding: 28px 30px 32px; }

.legend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }

.legend-create { margin-top: 26px; }
.legend-create .legend-info { max-width: 820px; }

.legend-role {
  font-family: var(--font-display); font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.25em; margin-bottom: 8px;
}
.legend-role-villain { color: #8aff3c; }
.legend-role-law { color: var(--cyan); }
.legend-role-neutral { color: var(--amber); }
.legend-role-create { color: var(--magenta); }
.legend-name {
  font-size: 2rem; text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 12px;
  background: linear-gradient(100deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.legend-quote {
  font-style: italic; color: var(--text); border-left: 3px solid var(--magenta);
  padding-left: 14px; margin-bottom: 14px; font-size: 0.98rem;
}
.legend-bio { color: var(--text-dim); font-size: 0.95rem; }
.legend-bio + .legend-bio { margin-top: 10px; }

/* ---------- Studio ---------- */
.studio-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.studio-grid h2 { margin-bottom: 12px; }
.studio-mantra {
  font-family: var(--font-display); font-weight: 600; font-size: 1.15rem;
  text-transform: uppercase; letter-spacing: 0.18em;
  background: linear-gradient(100deg, var(--cyan), var(--magenta), var(--amber));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 20px;
}
.studio-grid p { color: var(--text-dim); margin-bottom: 1rem; }
.studio-grid .lead { color: var(--text); }

.values { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; }
.value { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 500; }
.value-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 10px var(--cyan);
}

.terminal {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: rgba(8, 1, 15, 0.9);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(45, 226, 230, 0.08);
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
}
.terminal-bar {
  display: flex; align-items: center; gap: 7px; padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04); border-bottom: 1px solid var(--border);
}
.t-dot { width: 11px; height: 11px; border-radius: 50%; }
.t-red { background: #ff5f57; } .t-yellow { background: #febc2e; } .t-green { background: #28c840; }
.terminal-title { margin-left: 10px; font-size: 0.78rem; color: var(--text-dim); }
.terminal-body { padding: 22px; font-size: 0.88rem; line-height: 2; }
.t-prompt { color: var(--magenta); margin-right: 8px; }
.t-out { color: var(--cyan); }
.t-cursor { animation: blink 1s steps(1) infinite; color: var(--cyan); }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- News ---------- */
.news-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 72px; }
.news-item {
  display: flex; align-items: center; gap: 20px;
  padding: 22px 20px; border: 1px solid transparent; border-radius: 10px;
  transition: background 0.2s, border-color 0.2s;
}
.news-item:hover { background: var(--surface); border-color: var(--border); }
.news-item:hover .news-arrow { transform: translateX(6px); color: var(--cyan); }
.news-date {
  font-family: var(--font-display); color: var(--magenta);
  font-size: 0.85rem; letter-spacing: 0.08em; flex-shrink: 0; width: 70px;
}
.news-tag {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em;
  padding: 3px 10px; border: 1px solid var(--cyan); color: var(--cyan);
  border-radius: 20px; flex-shrink: 0;
}
.news-title { font-weight: 500; flex: 1; }
.news-arrow { color: var(--text-dim); transition: transform 0.2s, color 0.2s; }

.signup {
  text-align: center; padding: 56px 32px;
  border: 1px solid var(--border); border-radius: 16px;
  background: linear-gradient(160deg, rgba(45, 226, 230, 0.05), rgba(255, 46, 166, 0.05));
}
.signup h3 { font-size: 1.7rem; text-transform: uppercase; margin-bottom: 8px; }
.signup p { color: var(--text-dim); }
.signup-form {
  display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap;
}
.signup-form input {
  background: rgba(8, 1, 15, 0.8); border: 1px solid var(--border);
  border-radius: 6px; padding: 14px 18px; color: var(--text);
  font-family: var(--font-body); font-size: 0.95rem; min-width: 280px;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.signup-form input:focus { border-color: var(--cyan); box-shadow: 0 0 16px rgba(45, 226, 230, 0.25); }
.signup-note { margin-top: 16px; color: var(--cyan); font-size: 0.9rem; min-height: 1.4em; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 64px 0 0; background: rgba(8, 1, 15, 0.6); }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 48px;
}
.footer-tag { color: var(--text-dim); margin-top: 14px; font-size: 0.92rem; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 {
  text-transform: uppercase; letter-spacing: 0.15em; font-size: 0.8rem;
  color: var(--cyan); margin-bottom: 6px;
}
.footer-col a { color: var(--text-dim); font-size: 0.92rem; transition: color 0.2s; }
.footer-col a:hover { color: var(--magenta); }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 22px 24px; text-align: center;
  color: var(--text-dim); font-size: 0.82rem;
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .glitch::before, .glitch::after, .scroll-hint-line, .t-cursor { animation: none; }
}

/* ---------- Trailer lightbox ---------- */
.trailer-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; }
.trailer-modal[hidden] { display: none; }
.trailer-backdrop {
  position: absolute; inset: 0;
  background: rgba(8, 1, 15, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.trailer-frame {
  position: relative; width: min(1080px, 94vw);
  border-radius: 12px; border: 1px solid var(--cyan);
  box-shadow: 0 0 60px rgba(45, 226, 230, 0.35), 0 0 120px rgba(255, 46, 166, 0.2);
  background: #000; overflow: hidden;
  animation: trailerIn 0.3s ease;
}
@keyframes trailerIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}
.trailer-frame video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.trailer-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--cyan); background: rgba(8, 1, 15, 0.75);
  color: var(--cyan); font-size: 1rem; cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}
.trailer-close:hover { background: rgba(45, 226, 230, 0.15); box-shadow: 0 0 16px rgba(45, 226, 230, 0.4); }

@media (prefers-reduced-motion: reduce) {
  .trailer-frame { animation: none; }
}

/* Cap hero height on very tall viewports */
@media (min-height: 1600px) {
  .hero { min-height: 1000px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .game-grid, .studio-grid { grid-template-columns: 1fr; gap: 40px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .legend-grid { grid-template-columns: 1fr; }
  .legend-art img { height: 420px; }
}

@media (max-width: 640px) {
  .cards { grid-template-columns: 1fr; }
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; top: 70px; left: 0; right: 0;
    flex-direction: column; align-items: center; gap: 22px;
    background: rgba(8, 1, 15, 0.97); backdrop-filter: blur(14px);
    padding: 32px 0; border-bottom: 1px solid var(--border);
    transform: translateY(-130%); transition: transform 0.3s ease;
  }
  .nav-links.open { transform: translateY(0); }
  .section { padding: 80px 0; }
  .stat-row { gap: 26px; }
  .signup-form input { min-width: 0; width: 100%; }
  .signup-form { flex-direction: column; }
}
