body {
  font-family: sans-serif;
  color: #222;
  background: #fff;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  transition: background 0.2s, color 0.2s;
}

/* Dark mode */
body.dark {
  background: #0d1117;
  color: #e6edf3;
}

body.dark a {
  color: #58a6ff;
}

body.dark h3 {
  border-bottom-color: #30363d;
}

/* Toggle button */
#theme-toggle {
  position: fixed;
  top: 16px;
  right: 20px;
  background: none;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 100;
  transition: border-color 0.2s;
}

#theme-toggle:hover {
  border-color: #888;
}

body.dark #theme-toggle {
  border-color: #444;
}

a {
  color: #0366d6;
}

.container {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
}

/* Bio section */
.bio {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin-bottom: 32px;
}

.photo img {
  width: 180px;
  border-radius: 8px;
}

.info h1 {
  margin: 0 0 6px;
  font-size: 1.8rem;
}

.info p {
  margin: 0 0 10px;
}

/* Section headings */
h3 {
  border-bottom: 1px solid #ddd;
  padding-bottom: 6px;
  margin-bottom: 16px;
}

/* Paper entries */
.paper {
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ===== Blog button ===== */
#blog-btn {
  position: fixed;
  top: 16px;
  right: 116px;
  background: none;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 100;
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  transition: border-color 0.2s, transform 0.15s;
}

#blog-btn:hover {
  border-color: #888;
  transform: scale(1.15);
}

body.dark #blog-btn {
  border-color: #444;
  color: #e6edf3;
}

/* ===== Game button ===== */
#game-btn {
  position: fixed;
  top: 16px;
  right: 68px;
  background: none;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 100;
  transition: border-color 0.2s, transform 0.15s;
}

#game-btn:hover {
  border-color: #888;
  transform: scale(1.15);
}

body.dark #game-btn {
  border-color: #444;
}

/* ===== Game overlay ===== */
#game-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.80);
  z-index: 999;
  align-items: center;
  justify-content: center;
}

#game-overlay.active {
  display: flex;
}

#game-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #0e0e14;
  border-radius: 16px;
  padding: 24px 20px 20px;
  box-shadow: 0 0 60px rgba(0,0,0,0.9);
  min-width: 320px;
  max-width: 95vw;
}

#game-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: #666;
  font-size: 1.3rem;
  cursor: pointer;
  z-index: 10;
  line-height: 1;
}

#game-close:hover { color: #fff; }

/* ── Launcher ── */
#game-launcher.hidden,
#game-area.hidden { display: none !important; }

#launcher-title {
  color: #fff;
  font-size: 1.5rem;
  text-align: center;
  margin: 0 0 18px;
  font-family: monospace;
  letter-spacing: 1px;
}

#game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: #1a1a2e;
  border: 1px solid #2a2a40;
  border-radius: 12px;
  padding: 16px 12px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, border-color 0.2s;
  color: #fff;
  text-align: center;
  min-width: 120px;
}

.game-card:hover {
  background: #252540;
  border-color: #5555cc;
  transform: translateY(-3px);
}

.gc-icon  { font-size: 2.2rem; }
.gc-name  { font-size: 0.92rem; font-weight: 700; }
.gc-desc  { font-size: 0.72rem; color: #aaa; line-height: 1.3; }

/* ── Active game area ── */
#game-area {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#back-btn {
  align-self: flex-start;
  background: none;
  border: none;
  color: #888;
  font-size: 0.9rem;
  cursor: pointer;
  margin-bottom: 10px;
  padding: 0;
}

#back-btn:hover { color: #fff; }

#game-canvas {
  display: block;
  border-radius: 6px;
  image-rendering: pixelated;
}

#game-hud {
  display: flex;
  gap: 24px;
  color: #eee;
  font-family: monospace;
  font-size: 0.95rem;
  margin-top: 10px;
}

/* Game message (game over / start) */
#game-msg {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.72);
  border-radius: 16px;
  color: #fff;
  text-align: center;
  padding: 20px;
}

#game-msg.hidden { display: none; }

#msg-title {
  font-size: 2rem;
  margin-bottom: 8px;
}

#msg-sub {
  font-size: 1rem;
  color: #ccc;
  margin-bottom: 20px;
}

#msg-btn {
  padding: 10px 28px;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  background: #e63946;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

#msg-btn:hover { background: #c1121f; }

/* ===== Responsive ===== */
@media (max-width: 600px) {
  #game-grid { grid-template-columns: repeat(2, 1fr); }

  .bio {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .photo img {
    width: 150px;
  }
}
