.container {
  max-width: 800px;
  margin: 5px auto;
  text-align: center;
  padding: 5px;
}

h1, h2 {
  color: #333;
}

.hint {
  color: #666;
  font-style: italic;
  margin-bottom: 20px;
}

.game-area {
  position: relative;
  margin: 10px auto;
  width: 700px;
  height: 550px;
}

.game-area img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.item {
  position: absolute;
  cursor: pointer;
  background: transparent;
  transition: background-color 0.3s;
  z-index: 1;
}

.item:hover {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
}

.popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  font-size: 24px;
  z-index: 1000;
  animation: popIn 0.3s ease-out;
}

.story-section {
  margin-top: 30px;
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 10px;
}

#story {
  font-size: 18px;
  line-height: 2;
  margin: 20px 0;
  text-align: left;
  padding: 0 20px;
}

.sentence {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
  padding-right: 40px;
}

.word-input, .article-input {
  display: inline-flex;
  gap: 4px;
}

.letter-input {
  width: 25px;
  height: 30px;
  text-align: center;
  font-size: 18px;
  border: 2px solid #ccc;
  border-radius: 4px;
}

.letter-input.capital {
  background-color: #f0f8ff;
}

.letter-input.correct {
  border-color: #4CAF50;
  background-color: #e8f5e9;
}

.letter-input.incorrect {
  border-color: #f44336;
  background-color: #ffebee;
}

.button-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.story-button, .check-button, .clear-button {
  padding: 12px 24px;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.story-button {
  background-color: #2196F3;
  color: white;
}

.check-button {
  background-color: #4CAF50;
  color: white;
}

.story-button:hover {
  background-color: #1976D2;
}

.check-button:hover {
  background-color: #45a049;
}

.play-button {
  background-color: #2196F3;
  color: white;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background-color 0.3s;
  padding: 0;
  line-height: 1;
}

.play-button:hover {
  background-color: #1976D2;
}

.navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  padding: 0 20px;
}

.nav-button {
  background-color: #2196F3;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 5px;
  font-size: 24px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.3s;
}

.nav-button:hover {
  background-color: #1976D2;
}

@keyframes popIn {
  from { transform: translate(-50%, -50%) scale(0); }
  to { transform: translate(-50%, -50%) scale(1); }
}
