body {
  margin: 0;
  font-family: system-ui, Arial, sans-serif;
  line-height: 1.6;
  background: #ffffff;
  color: #000000;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
  counter-reset: figure-counter;
}

header {
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 2px solid #333;
}

header h1 {
  margin: 0 0 8px 0;
  font-size: 1.5em;
  font-weight: normal;
}

header h2 {
  margin: 0 0 16px 0;
  font-size: 2em;
  font-weight: bold;
}

.author-info {
  margin: 0;
  font-size: 0.95em;
  color: #555;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding: 12px 0;
  border-bottom: 1px solid #ddd;
}

nav a {
  text-decoration: none;
  color: #0055aa;
  padding: 4px 8px;
  border-radius: 3px;
}

nav a:hover {
  background-color: #f0f0f0;
  text-decoration: underline;
}

.video-container {
  margin: 32px auto;
  text-align: center;
  max-width: 900px;
}

.video-container iframe {
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  width: 100%;
  max-width: 560px;
}

.video-label {
  margin-top: 16px;
  font-size: 1.1em;
  color: #333;
  font-weight: normal;
}

section {
  margin-bottom: 48px;
}

section h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.8em;
  color: #003366;
  border-bottom: 1px solid #ccc;
  padding-bottom: 8px;
}

section h3 {
  margin-top: 24px;
  margin-bottom: 12px;
  font-size: 1.3em;
  color: #004488;
}

section h4 {
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 1.1em;
  color: #0055aa;
}

p {
  margin: 12px 0;
}

.sound-bite {
  font-size: 1.1em;
  font-style: italic;
  margin: 16px 0;
  padding-left: 16px;
  border-left: 3px solid #0055aa;
}

ul, ol {
  margin: 12px 0;
  padding-left: 24px;
}

li {
  margin: 6px 0;
}

/* Checkmark list styling */
ul.checkmark-list {
  list-style: none;
  padding-left: 0;
}

ul.checkmark-list li {
  padding-left: 1.5em;
  position: relative;
}

ul.checkmark-list li::before {
  content: "✓";
  color: #22a722;
  font-weight: bold;
  position: absolute;
  left: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 16px auto;
}

/* Smaller image size for chessboard in introduction */
#intro img {
  max-width: 60%;
}

/* Small image for inline figures */
figure.small-image img {
  max-width: 50%;
}

.image-placeholder {
  min-height: 200px;
  padding: 40px 20px;
  margin: 16px auto;
  border: 2px dashed #999;
  background-color: #f9f9f9;
  text-align: center;
  color: #666;
  border-radius: 4px;
}

.image-placeholder strong {
  display: block;
  margin-bottom: 12px;
  color: #0055aa;
  font-size: 1.1em;
}

figure {
  margin: 24px 0;
  counter-increment: figure-counter;
}

figcaption {
  text-align: center;
  font-size: 0.9em;
  color: #444;
  font-style: italic;
  margin-top: 8px;
}

figcaption::before {
  content: "Figure " counter(figure-counter) ": ";
  font-weight: bold;
}

/* Side-by-side image layout */
figure.side-by-side .side-by-side-images {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
}

figure.side-by-side .side-by-side-images img {
  flex: 1;
  max-width: 48%;
  margin: 0;
}

@media (max-width: 600px) {
  figure.side-by-side .side-by-side-images {
    flex-direction: column;
  }

  figure.side-by-side .side-by-side-images img {
    max-width: 100%;
  }
}

/* Screenshot grid for gameplay images */
.screenshot-grid {
  margin: 24px 0;
}

.screenshot-pair {
  margin-bottom: 24px;
}

.screenshot-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: nowrap;
}

.screenshot-row .image-placeholder,
.screenshot-row img {
  flex: 1 1 0;
  max-width: 48%;
  min-width: 0;
  margin: 0 !important;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .screenshot-row {
    flex-direction: column;
  }

  .screenshot-row .image-placeholder,
  .screenshot-row img {
    max-width: 100%;
  }
}

pre {
  background: #f4f4f4;
  padding: 12px;
  overflow-x: auto;
  border-left: 3px solid #0055aa;
  margin: 16px 0;
}

code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
  background-color: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
}

pre code {
  display: block;
  white-space: pre;
  background-color: #f4f4f4;
  padding: 12px;
  border-radius: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

table th,
table td {
  border: 1px solid #ddd;
  padding: 8px 12px;
  text-align: left;
}

table td:first-child {
  white-space: nowrap;
}

table th {
  background-color: #f0f0f0;
  font-weight: bold;
  color: #003366;
}

table tr:nth-child(even) {
  background-color: #f9f9f9;
}

a {
  color: #0055aa;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 600px) {
  main {
    padding: 12px;
  }

  header h1 {
    font-size: 1.2em;
  }

  header h2 {
    font-size: 1.5em;
  }

  section h2 {
    font-size: 1.5em;
  }

  nav {
    flex-direction: column;
    gap: 8px;
  }

  nav a {
    display: block;
    padding: 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
  }

  table {
    font-size: 0.9em;
  }

  table th,
  table td {
    padding: 6px 8px;
  }

  pre {
    font-size: 0.85em;
    padding: 8px;
  }
}
