:root {
  --story-border: #333;
  --story-bg: #2a2a2a;
  --choice-bg: #1e1e1e;
  --choice-hover: #333;
  --choice-active: #8c52ff;
  --inventory-border: #444;
  --inventory-bg: #1e1e1e;
  --inventory-item: #2a2a2a;
  --health-good: #4caf50;
  --health-warning: #ff9800;
  --health-danger: #ff5252;
}

main {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-title {
  text-align: center;
  margin-bottom: 2rem;
}

.game-title h1 {
  font-size: 2.5rem;
  color: var(--accent);
}

.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
  width: 100%;
}

.game-stats {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 700px;
  margin-bottom: 1rem;
}

.stat {
  background-color: var(--bg-secondary);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  min-width: 100px;
  text-align: center;
  flex: 1;
  margin: 0 0.5rem;
}

.stat-value {
  font-weight: bold;
  color: var(--accent);
}

#health.low {
  color: var(--health-danger);
}

#health.medium {
  color: var(--health-warning);
}

#health.high {
  color: var(--health-good);
}

#game-board {
  width: 100%;
  max-width: 700px;
  min-height: 550px;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  border: 2px solid #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
}

.story-container {
  width: 100%;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.story-text {
  background-color: var(--story-bg);
  border: 1px solid var(--story-border);
  border-radius: 8px;
  padding: 1.25rem;
  min-height: 150px;
  font-size: 1.1rem;
  line-height: 1.6;
}

.story-text p {
  margin-bottom: 0.75rem;
}

.story-text p:last-child {
  margin-bottom: 0;
}

.story-image {
  background-color: var(--story-bg);
  border: 1px solid var(--story-border);
  border-radius: 8px;
  height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.choices-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.choice-button {
  background-color: var(--choice-bg);
  color: var(--text-primary);
  border: 1px solid var(--story-border);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.choice-button:hover:not(:disabled) {
  background-color: var(--choice-hover);
  border-color: var(--accent);
}

.choice-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.choice-button.active {
  background-color: var(--choice-active);
  color: var(--bg-primary);
}

.inventory-container {
  width: 100%;
  background-color: var(--inventory-bg);
  border: 1px solid var(--inventory-border);
  border-radius: 8px;
  padding: 1rem;
}

.inventory-container h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.inventory-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.inventory-item {
  background-color: var(--inventory-item);
  border: 1px solid var(--story-border);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.inventory-item-icon {
  color: var(--accent);
  font-size: 1rem;
}

.empty-inventory {
  color: var(--text-secondary);
  font-style: italic;
}

.game-over {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
  visibility: hidden;
  padding: 2rem;
  text-align: center;
}

.game-over h2 {
  color: var(--accent);
  font-size: 2rem;
  margin-bottom: 1rem;
}

.game-over p {
  color: var(--text-primary);
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  max-width: 500px;
}

.game-controls {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.game-info {
  margin-top: 1rem;
  font-size: 1.2rem;
  color: var(--text-secondary);
}

#adventure-type {
  color: var(--accent);
  font-weight: bold;
}

@media (max-width: 768px) {
  .game-stats {
    flex-direction: column;
    gap: 0.5rem;
  }

  .stat {
    margin: 0;
  }

  #game-board {
    padding: 1rem;
  }

  .story-text {
    min-height: 120px;
    font-size: 1rem;
  }

  .story-image {
    height: 150px;
  }
}
