:root {
  --bg: #050b1f;
  --bg-2: #0b1633;
  --card: #0f1d42;
  --line: #1e3366;
  --text: #e8eeff;
  --muted: #9aa8cc;
  --blue: #2f7bff;
  --cyan: #2fd4ff;
  --grad: linear-gradient(135deg, #2f7bff 0%, #2fd4ff 100%);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: min(1140px, 100% - 32px); margin-inline: auto; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(5, 11, 31, .8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header .container { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.35rem; letter-spacing: .5px; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px; object-fit: cover; display: block;
  box-shadow: 0 0 20px rgba(47, 123, 255, .5);
}
.logo span b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { display: flex; gap: 28px; }
.nav a { color: var(--muted); font-weight: 500; transition: color .2s; }
.nav a:hover, .nav a.active { color: var(--text); }
.menu-btn { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.menu-btn i { display: block; width: 24px; height: 2px; background: var(--text); border-radius: 2px; margin: 5px 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px; border-radius: 999px; font-weight: 600;
  border: 1px solid var(--line); transition: transform .2s, box-shadow .2s, background .2s;
  cursor: pointer; font-size: 1rem; color: var(--text); background: transparent; font-family: inherit;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 8px 30px rgba(47, 123, 255, .35); }
.btn-primary:hover { box-shadow: 0 12px 40px rgba(47, 212, 255, .45); }

/* Hero */
.hero { position: relative; padding: 110px 0 90px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(47, 123, 255, .35), transparent 65%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: auto auto -50% -15%; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(47, 212, 255, .18), transparent 65%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.tag {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: rgba(47, 123, 255, .15); border: 1px solid rgba(47, 123, 255, .4);
  color: var(--cyan); font-size: .85rem; font-weight: 600; margin-bottom: 20px;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.15; font-weight: 800; margin-bottom: 20px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 540px; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-art { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hero-tile {
  aspect-ratio: 1; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 3.2rem;
  animation: float 6s ease-in-out infinite;
}
.hero-tile:nth-child(2) { animation-delay: -1.5s; transform: translateY(24px); }
.hero-tile:nth-child(3) { animation-delay: -3s; }
.hero-tile:nth-child(4) { animation-delay: -4.5s; transform: translateY(24px); }
@keyframes float { 50% { translate: 0 -12px; } }

/* Sections */
section { padding: 90px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 52px; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; margin-bottom: 12px; }
.section-head p { color: var(--muted); }
.alt { background: var(--bg-2); border-block: 1px solid var(--line); }

.grid { display: grid; gap: 22px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; transition: transform .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); border-color: var(--blue); }
.card .icon {
  width: 52px; height: 52px; border-radius: 14px; background: rgba(47, 123, 255, .15);
  display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 18px;
}
.card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .95rem; }

/* Game cards */
.game-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.game-thumb {
  aspect-ratio: 16/10; display: grid; place-items: center; font-size: 4rem;
  position: relative;
}
.game-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.game-body .meta { font-size: .8rem; color: var(--cyan); font-weight: 600; text-transform: uppercase; letter-spacing: .8px; }
.game-body .btn { margin-top: auto; align-self: flex-start; padding: 9px 20px; font-size: .9rem; }
.t-2048 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.t-snake { background: linear-gradient(135deg, #10b981, #065f46); }
.t-flappy { background: linear-gradient(135deg, #38bdf8, #1d4ed8); }
.t-memory { background: linear-gradient(135deg, #a855f7, #4c1d95); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; text-align: center; }
.stat b { display: block; font-size: 2.4rem; font-weight: 800; }
.stat span { color: var(--muted); font-size: .95rem; }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.info-list { list-style: none; display: grid; gap: 18px; }
.info-list li { display: flex; gap: 14px; }
.info-list .icon { flex: none; width: 44px; height: 44px; border-radius: 12px; background: rgba(47, 123, 255, .15); display: grid; place-items: center; }
.info-list small { color: var(--muted); display: block; }
form { display: grid; gap: 14px; }
input, textarea {
  width: 100%; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit;
}
input:focus, textarea:focus { outline: none; border-color: var(--blue); }
textarea { min-height: 130px; resize: vertical; }

/* Footer */
.footer { padding: 48px 0 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer h4 { color: var(--text); margin-bottom: 12px; }
.footer ul { list-style: none; display: grid; gap: 8px; }
.footer a:hover { color: var(--text); }
.copyright { border-top: 1px solid var(--line); padding-top: 22px; text-align: center; }

/* Responsive */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg-2); border-bottom: 1px solid var(--line); display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 16px; border-top: 1px solid var(--line); }
  .hero { padding: 64px 0; }
  .hero .container, .contact, .footer-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 340px; }
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
  section { padding: 64px 0; }
}

/* ===== Game page shell ===== */
.game-page { min-height: 100vh; display: flex; flex-direction: column; }
.game-page main { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 28px 16px 48px; gap: 18px; }
.game-page h1 { font-size: 1.8rem; font-weight: 800; }
.game-hud { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.hud-box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 18px; text-align: center; min-width: 96px; }
.hud-box small { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; }
.hud-box b { font-size: 1.3rem; }
.game-help { color: var(--muted); font-size: .9rem; text-align: center; max-width: 480px; }
canvas.game-canvas { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); max-width: 100%; touch-action: none; }
.overlay-msg { font-weight: 700; color: var(--cyan); min-height: 1.6em; text-align: center; }
