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

body {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #1a1a1a;
  color: #ccc;
  min-height: 100vh;
}

a {
  color: #7eb8f7;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Nav */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 48px;
  background: #111;
  border-bottom: 1px solid #333;
  transition: transform 0.3s ease;
}

.site-nav.nav-hidden {
  transform: translateY(-100%);
  pointer-events: none;
}

.site-nav .logo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.site-nav .logo:hover {
  text-decoration: none;
  color: #fff;
}

.site-nav .logo-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.site-nav .nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.site-nav .nav-links a {
  color: #aaa;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.site-nav .nav-links a:hover,
.site-nav .nav-links a.active {
  color: #fff;
  text-decoration: none;
}

/* Game container */
.game-container {
  width: 100%;
  height: calc(100vh - 48px - 60px); /* viewport minus nav and footer */
  position: relative;
  overflow: hidden;
  transition: none;
}

.game-container.fullscreen {
  position: fixed;
  inset: 0;
  height: 100vh;
  z-index: 100;
}

.game-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Footer */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 0 1.5rem;
  height: 60px;
  background: #111;
  border-top: 1px solid #333;
  font-size: 0.8rem;
  color: #666;
}

.site-footer a {
  color: #888;
}

.site-footer a:hover {
  color: #ccc;
}

/* Content pages */
.content-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 0.3rem 0.3rem;
  line-height: 1.7;
}

.content-page h1 {
  color: #fff;
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.content-page h2 {
  color: #eee;
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.content-page p {
  margin-bottom: 1rem;
}

.content-page ul, .content-page ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.content-page li {
  margin-bottom: 0.4rem;
}

/* Book card */
.book-card {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  margin: 2rem 0;
  background: #222;
  border: 1px solid #333;
  border-radius: 8px;
  align-items: center;
}

.book-card .book-info {
  flex: 1;
}

.book-card .book-info h3 {
  color: #fff;
  margin-bottom: 0.5rem;
}

.book-card .book-link {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.5rem 1.25rem;
  background: #f0c14b;
  color: #111;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.9rem;
}

.book-card .book-link:hover {
  background: #ddb347;
  text-decoration: none;
}

   
/* Pi grid */
.pi-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: 'Courier New', monospace;
  margin: 0.75rem 0 1rem;
}
.pi-label {
  font-size: 0.85rem;
  color: #6b7280;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  margin-right: 2px;
}
.pi-group { display: inline-flex; gap: 3px; background: #1a1d27; border: 1px solid #2d2f3e; border-radius: 6px; padding: 3px 5px; }
.digit {
  width: 1.8rem; height: 1.8rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px; font-size: 1rem; font-weight: bold;
  cursor: default; transition: transform 0.12s;
}
.digit:hover { transform: scale(1.3); }
.d0{background:#1e293b;color:#94a3b8} .d1{background:#1e3a5f;color:#60a5fa}
.d2{background:#14532d;color:#4ade80} .d3{background:#431407;color:#fb923c}
.d4{background:#2e1065;color:#c084fc} .d5{background:#500724;color:#f472b6}
.d6{background:#422006;color:#fbbf24} .d7{background:#134e4a;color:#2dd4bf}
.d8{background:#450a0a;color:#f87171} .d9{background:#052e16;color:#86efac}
    

/* Mobile nav */
@media (max-width: 480px) {
  .site-nav .logo {
    display: none;
  }
}
