/* Vega Tech LLC — shared styles (mobile-first, aurora edition) */
:root {
  --bg: #0b0d28;
  --panel: rgba(24, 27, 66, 0.55);
  --panel-solid: #181b42;
  --panel-2: #20245a;
  --accent: #7c6cff;
  --accent-2: #4dd0e1;
  --accent-3: #ff6ec7;
  --text: #f2f3ff;
  --muted: #a6a9d6;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --glow: 0 0 24px rgba(124, 108, 255, 0.35);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  /* subtle starfield */
  background-image:
    radial-gradient(1.5px 1.5px at 24px 36px, rgba(255, 255, 255, 0.55) 50%, transparent 52%),
    radial-gradient(1px 1px at 130px 90px, rgba(255, 255, 255, 0.4) 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 200px 170px, rgba(180, 190, 255, 0.5) 50%, transparent 52%),
    radial-gradient(1px 1px at 70px 210px, rgba(255, 255, 255, 0.35) 50%, transparent 52%),
    radial-gradient(1px 1px at 160px 260px, rgba(160, 230, 255, 0.45) 50%, transparent 52%);
  background-size: 260px 300px;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

/* Animated aurora glow orbs (pure CSS) */
body::before, body::after {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}

body::before {
  background:
    radial-gradient(42% 36% at 24% 18%, rgba(124, 108, 255, 0.4), transparent 70%),
    radial-gradient(34% 30% at 82% 12%, rgba(77, 208, 225, 0.28), transparent 70%);
  animation: aurora-a 26s ease-in-out infinite alternate;
}

body::after {
  background:
    radial-gradient(38% 34% at 78% 84%, rgba(255, 110, 199, 0.24), transparent 70%),
    radial-gradient(40% 36% at 16% 88%, rgba(90, 75, 255, 0.3), transparent 70%);
  animation: aurora-b 34s ease-in-out infinite alternate;
}

@keyframes aurora-a {
  from { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  to   { transform: translate3d(4%, 6%, 0) scale(1.18) rotate(6deg); }
}

@keyframes aurora-b {
  from { transform: translate3d(0, 0, 0) scale(1.1); }
  to   { transform: translate3d(-5%, -4%, 0) scale(1) rotate(-5deg); }
}

/* Phone-style shell: the whole site renders as a mobile layout */
.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: linear-gradient(180deg, rgba(20, 23, 60, 0.86) 0%, rgba(12, 14, 44, 0.92) 100%);
  display: flex;
  flex-direction: column;
}

@media (min-width: 520px) {
  body { padding: 24px 0; align-items: flex-start; }
  .app {
    min-height: calc(100vh - 48px);
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow), 0 0 60px rgba(124, 108, 255, 0.18);
    overflow: hidden;
  }
}

/* Reveal-on-load animation */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero, main section { animation: rise 0.7s ease both; }
main section:nth-of-type(1) { animation-delay: 0.08s; }
main section:nth-of-type(2) { animation-delay: 0.16s; }
main section:nth-of-type(3) { animation-delay: 0.24s; }
main section:nth-of-type(4) { animation-delay: 0.32s; }
main section:nth-of-type(5) { animation-delay: 0.4s; }
main section:nth-of-type(6) { animation-delay: 0.48s; }

@media (prefers-reduced-motion: reduce) {
  body::before, body::after, .hero, main section { animation: none; }
}

/* Top navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(12, 14, 44, 0.6);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.3px;
  color: var(--text);
  text-decoration: none;
}

.nav .brand .logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px rgba(124, 108, 255, 0.55);
}

.nav .links { display: flex; gap: 14px; }

.nav .links a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 4px 2px;
  transition: color 0.15s ease;
}

.nav .links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: right 0.2s ease;
}

.nav .links a:hover, .nav .links a.active { color: var(--text); }
.nav .links a:hover::after, .nav .links a.active::after { right: 0; }

main { flex: 1; padding: 22px 18px 30px; }

/* Hero */
.hero { text-align: center; padding: 30px 6px 32px; }

.hero .badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-2);
  background: rgba(77, 208, 225, 0.1);
  border: 1px solid rgba(77, 208, 225, 0.35);
  box-shadow: 0 0 16px rgba(77, 208, 225, 0.15) inset;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: 34px;
  line-height: 1.15;
  background: linear-gradient(92deg, #ffffff 10%, #b9b4ff 55%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 12px;
}

.hero p { color: var(--muted); font-size: 15px; line-height: 1.6; }

.hero .cta-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

/* Sections */
section { margin-bottom: 34px; }

.section-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
  background: linear-gradient(90deg, #ffffff, #c9c4ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-sub { color: var(--muted); font-size: 14px; margin-bottom: 16px; }

/* Game cards (glass) */
.game-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.game-card:active { transform: scale(0.98); }
.game-card:hover {
  transform: translateY(-3px);
  border-color: rgba(124, 108, 255, 0.65);
  box-shadow: var(--glow);
}

.game-card .row { display: flex; align-items: center; gap: 14px; }

.game-card .thumb {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 32px;
  background: linear-gradient(135deg, var(--panel-2), #2c3070);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 18px rgba(124, 108, 255, 0.25) inset;
}

.game-card h3 { font-size: 17px; margin-bottom: 4px; }
.game-card p { color: var(--muted); font-size: 13px; line-height: 1.5; }

/* Large game cards (games.html) */
.game-card.large { padding: 0; overflow: hidden; }

.game-card .banner {
  height: 110px;
  display: grid;
  place-items: center;
  font-size: 54px;
  background:
    radial-gradient(80% 120% at 50% 0%, rgba(124, 108, 255, 0.35), transparent 70%),
    linear-gradient(135deg, #23276b, #161a4a);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-shadow: 0 0 26px rgba(124, 108, 255, 0.8);
}

.game-card .banner.alt {
  background:
    radial-gradient(80% 120% at 50% 0%, rgba(255, 110, 199, 0.28), transparent 70%),
    linear-gradient(135deg, #3a1f5e, #1a1445);
  text-shadow: 0 0 26px rgba(255, 110, 199, 0.7);
}

.game-card .body { padding: 16px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }

.tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--accent-2);
  background: rgba(77, 208, 225, 0.1);
  border: 1px solid rgba(77, 208, 225, 0.28);
  padding: 4px 10px;
  border-radius: 999px;
}

.game-card.soon {
  opacity: 0.55;
  text-align: center;
  cursor: default;
  border-style: dashed;
}

.game-card.soon:hover { transform: none; box-shadow: none; border-color: rgba(255, 255, 255, 0.09); }

.note {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  background: rgba(124, 108, 255, 0.08);
  border: 1px solid rgba(124, 108, 255, 0.25);
  border-radius: 14px;
  padding: 12px 16px;
}

.play-pill {
  margin-left: auto;
  flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent), #5a4bff);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(124, 108, 255, 0.4);
}

/* Generic card / text blocks (glass) */
.card {
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}

.card h3 { font-size: 16px; margin-bottom: 8px; }
.card p, .card li { color: var(--muted); font-size: 14px; line-height: 1.65; }
.card ul { padding-left: 18px; }
.card li + li { margin-top: 6px; }
.card li::marker { color: var(--accent); }

/* Feature grid (What We Do) */
.feat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.feat {
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  padding: 16px 14px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.feat:hover {
  transform: translateY(-3px);
  border-color: rgba(77, 208, 225, 0.5);
  box-shadow: 0 0 20px rgba(77, 208, 225, 0.18);
}

.feat .icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, rgba(124, 108, 255, 0.3), rgba(77, 208, 225, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.feat h3 { font-size: 15px; margin-bottom: 4px; }
.feat p { color: var(--muted); font-size: 12.5px; line-height: 1.55; }

/* Stats row */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.stat {
  text-align: center;
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  padding: 14px 6px;
}

.stat b {
  display: block;
  font-size: 19px;
  background: linear-gradient(135deg, #ffffff, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 3px;
}

.stat span { display: block; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.3px; margin-top: 2px; }

.page-body p { color: var(--muted); font-size: 14px; line-height: 1.7; margin-bottom: 12px; }
.page-body h2 { font-size: 17px; margin: 20px 0 8px; }
.page-body ul { color: var(--muted); font-size: 14px; line-height: 1.7; padding-left: 18px; margin-bottom: 12px; }
.page-body li + li { margin-top: 4px; }
.page-body li::marker { color: var(--accent); }

a.mail, .page-body a { color: var(--accent-2); text-decoration: none; }
a.mail:hover, .page-body a:hover { text-decoration: underline; }

/* Buttons */
.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), #5a4bff);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 13px 22px;
  border: none;
  border-radius: 14px;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 6px 18px rgba(124, 108, 255, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(124, 108, 255, 0.55); }

.btn.ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--text);
  box-shadow: none;
}

.btn.ghost:hover { box-shadow: 0 0 16px rgba(255, 255, 255, 0.12); }

.btn:active { transform: scale(0.97); }

/* Back link on sub pages */
.back {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 16px;
  transition: color 0.15s ease;
}
.back:hover { color: var(--accent-2); }

/* Footer */
footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 22px 18px 30px;
  text-align: center;
  background: rgba(10, 12, 36, 0.4);
}

footer .f-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 12px;
}

footer .f-links a { color: var(--muted); text-decoration: none; font-size: 13px; transition: color 0.15s ease; }
footer .f-links a:hover { color: var(--accent-2); }

footer p { color: #6f72a3; font-size: 12px; line-height: 1.6; }

/* ===== Games ===== */
.game-wrap { text-align: center; }

.hud {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-bottom: 14px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--muted);
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
}

.hud b { color: var(--text); font-size: 16px; }

canvas.game {
  background: #0a0c24;
  border-radius: 16px;
  border: 1px solid rgba(124, 108, 255, 0.3);
  box-shadow: 0 0 30px rgba(124, 108, 255, 0.2);
  max-width: 100%;
  touch-action: none;
}

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 62px);
  grid-template-rows: repeat(2, 52px);
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.dpad button {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  touch-action: manipulation;
}

.dpad button:active { background: var(--accent); }
.dpad .up { grid-column: 2; }
.dpad .left { grid-column: 1; grid-row: 2; }
.dpad .down { grid-column: 2; grid-row: 2; }
.dpad .right { grid-column: 3; grid-row: 2; }

.hint { color: #6f72a3; font-size: 12px; margin-top: 14px; }

/* Memory match board */
.mem-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 0 auto;
  max-width: 360px;
}

.mem-card {
  aspect-ratio: 3 / 4;
  perspective: 600px;
  cursor: pointer;
  touch-action: manipulation;
}

.mem-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.35s;
  transform-style: preserve-3d;
}

.mem-card.flip .mem-inner { transform: rotateY(180deg); }

.mem-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  font-size: 30px;
}

.mem-front {
  background: linear-gradient(135deg, var(--panel-2), #2c3070);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.25);
}

.mem-back {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transform: rotateY(180deg);
}

.mem-card.matched .mem-back {
  background: linear-gradient(135deg, #2e7d32, #4dd0e1);
}

/* Overlay (game over / win) */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 28, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.overlay.show { display: flex; }

.overlay .box {
  background: rgba(24, 27, 66, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(124, 108, 255, 0.35);
  box-shadow: var(--glow);
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  width: 100%;
  max-width: 320px;
  animation: rise 0.3s ease both;
}

.overlay .box h2 { font-size: 22px; margin-bottom: 8px; }
.overlay .box p { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
