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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #2c3e50;
  color: #ecf0f1;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.game-section {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Typography for overlays */
h1, h2, h3 {
  color: #2c3e50;
  margin-bottom: 20px;
}

h1 {
  font-size: 2.5em;
}

h2 {
  color: #34495e;
  margin: 20px 0 10px 0;
}

h3 {
  color: #34495e;
  margin: 15px 0 10px 0;
  font-size: 1.3em;
}

p {
  margin-bottom: 15px;
  color: #2c3e50;
}

ul {
  margin-left: 20px;
  margin-bottom: 15px;
}

li {
  margin-bottom: 5px;
  color: #2c3e50;
}

strong {
  color: #2c3e50;
  font-weight: bold;
}

a {
  color: #3498db;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

#canvas {
  background: #2c3e50;
  max-width: 100vw;
  max-height: 100vh;
}

#canvas.hidden {
  display: none;
}

/* Screen overlay system */
.screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.screen-overlay.hidden {
  display: none;
}

.screen-content {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  text-align: center;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.title-icon {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.screen-title {
  font-size: 3em;
  color: #2c3e50;
  margin-bottom: 30px;
  font-weight: bold;
}

.game-button {
  background: #3498db;
  color: white;
  border: none;
  padding: 15px 30px;
  font-size: 1.2em;
  border-radius: 6px;
  cursor: pointer;
  margin: 10px;
  transition: background-color 0.3s;
}

.game-button:hover {
  background: #2980b9;
}

.game-button:focus {
  outline: 2px solid #3498db;
  outline-offset: 2px;
}

/* Responsive breakpoints for smaller screen heights */
@media (max-height: 800px) {
  .screen-content {
    padding: 30px;
    max-width: 450px;
    max-height: 85vh;
  }
  
  .title-icon svg {
    width: 56px;
    height: 56px;
  }
  
  .screen-title {
    font-size: 2.5em;
    margin-bottom: 25px;
  }
  
  h1 {
    font-size: 2.2em;
  }
  
  h2 {
    margin: 15px 0 8px 0;
  }
  
  h3 {
    margin: 12px 0 8px 0;
    font-size: 1.2em;
  }
  
  p {
    margin-bottom: 12px;
  }
  
  ul {
    margin-bottom: 12px;
  }
  
  .game-button {
    padding: 12px 24px;
    font-size: 1.1em;
  }
}

@media (max-height: 500px) {
  .screen-content {
    padding: 20px;
    max-width: 400px;
    max-height: 80vh;
  }
  
  .title-icon svg {
    width: 48px;
    height: 48px;
  }
  
  .screen-title {
    font-size: 2em;
    margin-bottom: 20px;
  }
  
  h1 {
    font-size: 1.8em;
  }
  
  h2 {
    margin: 10px 0 6px 0;
  }
  
  h3 {
    margin: 8px 0 6px 0;
    font-size: 1.1em;
  }
  
  p {
    margin-bottom: 8px;
  }
  
  ul {
    margin-bottom: 8px;
  }
  
  li {
    margin-bottom: 3px;
  }
  
  .game-button {
    padding: 10px 20px;
    font-size: 1em;
    margin: 8px;
  }
}

@media (max-height: 300px) {
  .screen-content {
    padding: 15px;
    max-width: 350px;
    max-height: 75vh;
  }
  
  .title-icon svg {
    width: 40px;
    height: 40px;
  }
  
  .screen-title {
    font-size: 1.5em;
    margin-bottom: 15px;
  }
  
  h1 {
    font-size: 1.4em;
  }
  
  h2 {
    margin: 8px 0 4px 0;
  }
  
  h3 {
    margin: 6px 0 4px 0;
    font-size: 1em;
  }
  
  p {
    margin-bottom: 6px;
  }
  
  ul {
    margin-left: 15px;
    margin-bottom: 6px;
  }
  
  li {
    margin-bottom: 2px;
  }
  
  .game-button {
    padding: 8px 16px;
    font-size: 0.9em;
    margin: 6px;
  }
}