html,
body {
  margin: 0;
  min-height: 100%;
  background: #1a1a1a;
  color: #fff;
  font-family: Arial, sans-serif;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

#app {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen {
  display: none;
  width: 100%;
  min-height: 100vh;
}

.screen.active {
  display: flex;
}

#menu-screen {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: #1a1a1a;
  padding: 30px 16px 24px;
  box-sizing: border-box;
}

#intro-video {
  max-width: min(90vw, 700px);
  height: auto;
  margin-top: 8px;
  background: #000;
  border: 1px solid #333;
}

.subtitle {
  margin: 8px 0 18px;
  color: #c9c9c9;
  font-size: 16px;
}

.menu-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

button {
  border: 1px solid #666;
  background: #5a5a5a;
  color: #fff;
  font: inherit;
  font-size: 22px;
  font-weight: 700;
  padding: 12px 24px;
  min-width: 320px;
  cursor: pointer;
}

button:hover,
button:focus-visible {
  background: #6b6b6b;
  outline: none;
}

#game-screen {
  align-items: center;
  justify-content: center;
  background: #111;
  padding: 12px;
  box-sizing: border-box;
}

#canvas-shell {
  width: min(100vw - 24px, 1280px);
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  image-rendering: auto;
}

.playing #game-canvas {
  cursor: none;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  z-index: 10;
}

.modal.hidden {
  display: none;
}

.modal-panel {
  width: min(92vw, 860px);
  max-height: 88vh;
  overflow: auto;
  background: #1a1a1a;
  border: 1px solid #666;
  padding: 20px 24px 24px;
  box-sizing: border-box;
}

.modal-panel h2 {
  margin: 0 0 16px;
  text-align: center;
  font-size: 38px;
}

.modal-panel p {
  margin: 8px 0;
  line-height: 1.35;
  text-align: center;
}

.modal-panel .large-text {
  font-size: 28px;
  font-weight: 700;
}

.modal-panel .summary-line {
  font-size: 24px;
  color: #ccc;
}

.modal-panel .help-line {
  margin-top: 14px;
  font-size: 18px;
}

.modal-images-3,
.modal-images-2 {
  display: grid;
  gap: 18px;
  align-items: start;
  margin: 18px 0 10px;
}

.modal-images-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.modal-images-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal-card {
  text-align: center;
}

.modal-card img {
  max-width: 100%;
  height: auto;
  max-height: 240px;
}

.modal-card p {
  margin: 10px 0 0;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.modal-actions button {
  min-width: 180px;
  font-size: 18px;
}

.options-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px 18px;
  align-items: center;
  margin: 8px auto 0;
  width: min(100%, 420px);
}

.options-grid label {
  text-align: right;
  font-size: 18px;
  font-weight: 700;
}

.options-grid input,
.options-grid select {
  width: 100%;
  font: inherit;
  font-size: 18px;
  padding: 8px 10px;
  box-sizing: border-box;
  background: #3a3a3a;
  color: #fff;
  border: 1px solid #666;
}

.rules-shot {
  width: min(100%, 700px);
  display: block;
  margin: 18px auto 0;
  border: 1px solid #444;
}

@media (max-width: 720px) {
  button {
    min-width: min(88vw, 320px);
    font-size: 20px;
  }

  .modal-images-3,
  .modal-images-2,
  .options-grid {
    grid-template-columns: 1fr;
  }

  .options-grid label {
    text-align: left;
  }

  .modal-panel h2 {
    font-size: 30px;
  }
}
