body {
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 0;
  background: #f4f4f4;
  color: #333;
}
header {
  background: #0078d4;
  color: white;
  padding: 1rem;
  text-align: center;
}
nav a {
  margin: 0 1rem;
  color: white;
  text-decoration: none;
}
main {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
canvas {
  background: #222;
  display: block;
  margin: 1rem auto;
  border: 1px solid #ccc;
}
input {
  margin-top: 1rem;
  padding: 0.5rem;
  width: 200px;
}
button {
  margin-left: 1rem;
  padding: 0.5rem 1rem;
  background: #0078d4;
  color: white;
  border: none;
  cursor: pointer;
}
footer {
  text-align: center;
  padding: 1rem;
  background: #eee;
  margin-top: 2rem;
}

/* --- Only affects snake game page --- */
.snake-main {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.snake-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 3rem;
  justify-content: flex-start;
  max-width: 1000px;
  margin: 0 auto;
}
.snake-sidebar {
  min-width: 260px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.snake-leaderboard {
  max-width: 420px;
  background: #fff8e1;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  padding: 1rem;
  margin-left: 0;
}
.snake-game-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.snake-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 1rem;
  margin-bottom: 2rem;
  max-width: 600px;
}
.snake-main canvas {
  display: block;
  margin-left: 0;
  margin-right: auto;
}
@media (max-width: 900px) {
  main, .snake-main {
    margin-left: 0.5rem;
    padding: 1rem;
    max-width: 99vw;
  }
  .snake-layout {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    max-width: 99vw;
  }
  .snake-sidebar, .snake-game-container, .snake-leaderboard, .snake-controls, .snake-main canvas {
    max-width: 99vw;
    align-items: center;
  }
}

.diagram-section {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.diagram-text {
  flex: 1 1 320px;
  min-width: 260px;
  max-width: 450px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.diagram-image {
  flex: 1 1 400px;
  min-width: 260px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}

.diagram-image img {
  max-width: none;        /* Allow actual size */
  width: 400px;           /* Make the image larger */
  height: auto;
  border: 1px solid #ccc;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-top: 48px;       /* Move image further down */
  margin-left: 44px;      /* Move image further right */
  cursor: zoom-in;
  transition: box-shadow 0.2s;
}

.diagram-image img:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.20);
}

@media (max-width: 900px) {
  .diagram-section {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
  }
  .diagram-image img {
    width: 95vw;
    max-width: 99vw;
    margin-left: 0;
    margin-top: 16px;
  }
}

@media (max-width: 900px) {
  .diagram-section {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
  }
  .diagram-image img {
    width: 97vw !important;
    max-width: 99vw !important;
    margin-left: 0 !important;
    margin-top: 16px !important;
  }
}

.diagram-text ul {
  font-size: 1.15em;   /* About one step up from normal (default is 1em) */
  line-height: 1.6;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.diagram-text li {
  margin-bottom: 0.5em; /* Adds a little space between bullet points */
}

.diagram-placeholder {
  min-height: 5em;    /* Gives you 4-5 lines of space for text */
  font-size: 1.08em;
  color: #444;
  padding-bottom: 0.5em;
}

.aboutme-text {
  max-width: 900px;  
  flex: 2 1 600px;   /* Optionally, give it a bit more space than the image */
}

/* For enlarging lab.html diagrams */
.diagram-image img.enlarge-diagram {
  width: 560px;      
  max-width: 95vw;   /* never overflow viewport */
}
