body {
  margin: 0;
  font-family: 'Trebuchet MS', sans-serif;
  background: linear-gradient(180deg, #131c3f, #1c264f);
  color: #f3f6ff;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

#root {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.game-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.canvas-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a2035;
  position: relative;
}

.hud {
  width: 320px;
  max-width: 100%;
  background: rgba(8, 12, 28, 0.85);
  padding: 12px;
  box-sizing: border-box;
  overflow-y: auto;
}

button {
  background: #3f5fb3;
  border: none;
  border-radius: 6px;
  color: #fff;
  padding: 8px 12px;
  margin: 4px 0;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

button:hover,
button:focus {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

button:disabled {
  background: #2a2f4f;
  cursor: not-allowed;
  opacity: 0.6;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-bar span {
  font-size: 0.9rem;
}

.team-list,
.inventory-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.team-list li,
.inventory-list li {
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 14, 0.85);
  color: #fff;
  flex-direction: column;
  text-align: center;
  padding: 16px;
}

.flex-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.battle-log {
  height: 120px;
  overflow-y: auto;
  background: rgba(12, 16, 28, 0.9);
  padding: 8px;
  border-radius: 8px;
  margin-top: 8px;
}

.small-text {
  font-size: 0.75rem;
  opacity: 0.8;
}

.touch-controls {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 50px);
  grid-template-rows: repeat(3, 50px);
  gap: 8px;
}

.touch-controls button {
  padding: 0;
  width: 50px;
  height: 50px;
}

@media (max-width: 768px) {
  .game-container {
    flex-direction: column;
  }

  .hud {
    width: 100%;
    max-height: 280px;
  }
}
