* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

html, body {
  height: 100%;
  width: 100%;
}

body {
  background-color: #0b1118;
  color: #d7e3f4;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.small-header {
  flex-shrink: 0;
}

.game-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  width: 100%;
  flex: 1;
  min-height: 0;
}

.game-container {
  background-color: #0b1118;
  border-radius: 12px;
  box-shadow: none;
  padding: 10px;
  width: 100%;
  height: 100%;
  text-align: center;
  border: none;
  display: flex;
  flex-direction: column;
  position: relative;
}

.game-info {
  margin: 0 auto 10px auto;
  display: flex;
  justify-content: space-between;
  flex-shrink: 0;
  width: 100%;
  max-width: 700px;
}

h1 {
  color: #8a96a8;
  margin-bottom: 0;
  font-size: 1.2rem;
}

.timer-section {
  text-align: right;
}

.timer {
  font-size: 1.2rem;
  font-weight: bold;
  color: #88f0b0;
  margin-bottom: 0;
}

.timer.rescued {
  color: #4CAF50;
}

.best-score {
  font-size: 0.8rem;
  color: #6a7a8a;
  margin-top: 2px;
}

.rescued-label {
  color: #4CAF50;
  margin-right: 8px;
  font-size: 1rem;
  display: inline;
}

.instructions {
  color: #b8c4d4;
  margin-bottom: 15px;
}

.game-area {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.controls {
  margin-top: 20px;
}

.red-text {
  color: #ff4d4d;
}

.green-text {
  color: #4caf50;
}

button {
  background-color: #2ea043;
  border: none;
  color: white;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 10px 2px;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #25913b;
}

.control-info {
  color: #9fb0c2;
  font-size: 0.9em;
  margin-bottom: 10px;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #111a24;
  margin: auto;
  padding: 25px;
  border-radius: 10px;
  width: 80%;
  max-width: 450px;
  text-align: left;
  color: #d9e5f5;

  .story-section {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(80, 255, 140, 0.2);
    margin-bottom: 15px;

    .story-text {
      font-size: 1.1rem;
      color: #88f0b0;
      margin: 8px 0;
      line-height: 1.4;
    }
  }

  .instructions {
    padding: 10px 0px;

    h3 {
      font-size: 0.9rem;
      color: #8a96a8;
      margin-bottom: 12px;
      text-transform: uppercase;
      letter-spacing: 1px;
    }

    p {
      margin: 10px 0px;
      font-size: 0.95rem;
      color: #b8c4d4;
    }
  }
}

#gameOverMessage {
  margin-bottom: 15px;
  color: #e6f4ff;
}

#gameOverReason {
  margin-bottom: 20px;
  color: #b8c4d4;
}

/* For mobile devices */
@media (max-width: 600px) {
  .game-container {
    padding: 10px;
  }

  button {
    padding: 8px 16px;
    font-size: 14px;
  }
}
