/* gameapps.css - the densest possible style */
:root {
  --bg: #0a0a12;
  --bg2: #14141f;
  --bg3: #1a1a2a;
  --fg: #e0e0f0;
  --fg2: #c0c0d0;
  --accent: #7c3aed;
  --accent2: #4a7fbf;
  --accent3: #06b6d4;
  --muted: #888;
  --muted2: #666;
  --green: #10b981;
  --yellow: #f59e0b;
  --red: #ef4444;
  --border: #2a2a3a;
  --border2: #3a3a4a;
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { color: #7fbfff; }

code, pre {
  font: 13px/1.5 "SF Mono", Monaco, Menlo, monospace;
}

code {
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--accent3);
}

pre {
  background: #000;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  color: var(--fg2);
  white-space: pre;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* === HEADER === */
header {
  background: linear-gradient(135deg, #0a0a12 0%, #1a0a2e 50%, #0a1a2e 100%);
  border-bottom: 1px solid var(--border);
  padding: 80px 20px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.1) 0%, transparent 50%);
  animation: pulse 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

header h1 {
  font-size: 56px;
  font-weight: 800;
  background: linear-gradient(135deg, #7c3aed, #4a7fbf, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  letter-spacing: -1px;
  position: relative;
}

header .tagline {
  color: var(--muted);
  font-size: 20px;
  margin-bottom: 32px;
  position: relative;
}

header .stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  position: relative;
}

header .stat {
  color: var(--accent);
  font-weight: 600;
  font-size: 15px;
  padding: 8px 16px;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 20px;
}

header .stat strong {
  display: block;
  font-size: 24px;
  color: var(--fg);
  margin-bottom: 2px;
}

/* === NAV === */
nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(20, 20, 31, 0.9);
}

nav .container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

nav .logo {
  font-weight: 700;
  color: var(--accent);
  font-size: 18px;
}

nav .links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

nav .links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

nav .links a:hover {
  color: var(--fg);
}

/* === MAIN === */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

section {
  margin-bottom: 80px;
}

section h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--fg);
  border-left: 4px solid var(--accent);
  padding-left: 16px;
}

section h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--accent);
}

section p {
  color: var(--fg2);
  margin-bottom: 12px;
}

section .lead {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.7;
}

/* === INTRO === */
.intro {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(180deg, var(--bg2) 0%, var(--bg) 100%);
  border-radius: 12px;
  margin-bottom: 60px;
  border: 1px solid var(--border);
}

.intro h2 {
  border-left: none;
  padding-left: 0;
  font-size: 36px;
  margin-bottom: 16px;
}

.intro .subtitle {
  font-size: 18px;
  color: var(--muted);
  max-width: 700px;
  margin: 0 auto 24px;
  line-height: 1.7;
}

.intro .principle {
  display: inline-block;
  padding: 12px 24px;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: 16px;
  color: var(--accent);
  font-weight: 500;
}

/* === GRID === */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card, var(--bg2));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  transition: transform 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.card .number {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
  align-self: flex-start;
}

.card h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--fg);
}

.card .tagline {
  color: var(--accent3);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 10px;
}

.card .desc {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
  flex: 1;
}

.card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.card .meta .latency {
  color: var(--green);
  font-weight: 600;
  font-family: monospace;
}

.card .actions {
  display: flex;
  gap: 8px;
}

.card .btn {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  border: 0;
  cursor: pointer;
}

.card .btn-primary {
  background: var(--accent);
  color: white;
}

.card .btn-primary:hover {
  background: #8b5cf6;
  color: white;
}

.card .btn-secondary {
  background: transparent;
  color: var(--accent2);
  border: 1px solid var(--border);
}

.card .btn-secondary:hover {
  border-color: var(--accent2);
  color: #7fbfff;
}

/* === FEATURE CARDS === */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.feature {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.feature .icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.feature h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--fg);
}

.feature p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* === COMPARISON === */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
  font-size: 14px;
}

.comparison-table th, .comparison-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.comparison-table th {
  background: var(--bg2);
  color: var(--accent);
  font-weight: 600;
}

.comparison-table td {
  color: var(--fg2);
}

.comparison-table td code {
  font-size: 12px;
}

/* === CODE BLOCKS === */
.code-block {
  background: #000;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  font: 13px/1.6 "SF Mono", Monaco, Menlo, monospace;
  color: var(--fg2);
  margin: 16px 0;
}

.code-block .keyword { color: #c792ea; }
.code-block .string { color: #c3e88d; }
.code-block .comment { color: #5c6370; font-style: italic; }
.code-block .number { color: #f78c6c; }
.code-block .function { color: #82aaff; }

/* === DEMO PAGE === */
.demo-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

.demo-page .back {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--muted);
}

.demo-page h1 {
  font-size: 36px;
  margin-bottom: 8px;
}

.demo-page h1 .num {
  color: var(--accent);
  margin-right: 12px;
}

.demo-page .subtitle {
  color: var(--accent3);
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
}

.demo-page .desc {
  color: var(--muted);
  margin-bottom: 24px;
  font-size: 15px;
}

.demo-page .quick-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.demo-page .quick-info .item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
}

.demo-page .quick-info .item .label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.demo-page .quick-info .item .value {
  font-size: 16px;
  color: var(--fg);
  font-weight: 600;
}

.demo-page .run-btn {
  background: var(--accent);
  color: white;
  border: 0;
  padding: 14px 28px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 20px;
  transition: all 0.2s;
}

.demo-page .run-btn:hover {
  background: #8b5cf6;
  transform: translateY(-1px);
}

.demo-page .run-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.demo-page .run-btn.secondary {
  background: transparent;
  color: var(--accent2);
  border: 1px solid var(--accent2);
  margin-left: 8px;
}

.demo-page .output {
  background: #000;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  min-height: 200px;
  font: 13px/1.5 "SF Mono", Monaco, Menlo, monospace;
  color: var(--fg2);
  white-space: pre-wrap;
  overflow-x: auto;
  margin-bottom: 24px;
}

.demo-page .section-title {
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 32px 0 12px;
  font-weight: 600;
}

.demo-page pre.source {
  font-size: 12px;
  max-height: 600px;
  overflow-y: auto;
}

/* === FOOTER === */
footer {
  text-align: center;
  padding: 60px 20px 40px;
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

footer .container {
  max-width: 1200px;
  margin: 0 auto;
}

footer .footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
  text-align: left;
}

footer .footer-col h4 {
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

footer .footer-col a {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

footer .footer-col a:hover { color: var(--accent2); }

footer .copyright {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted2);
  font-size: 12px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  header h1 { font-size: 36px; }
  header .tagline { font-size: 16px; }
  header .stats { gap: 12px; }
  header .stat { font-size: 12px; padding: 6px 10px; }
  nav .container { flex-direction: column; align-items: flex-start; }
  section h2 { font-size: 24px; }
  .intro h2 { font-size: 28px; }
  .grid { grid-template-columns: 1fr; }
}
